Skipping test cases in build
sbt 'set test in assembly := {}' clean assembly
sbt 'set test in assembly := {}' clean package
Referring to the local jar in sbt
unmanagedJars in Compile += file("/Users/basan/Documents/Projects/application/application-core/target/scala-2.11/application-core-assembly-1.8.2.jar")
https://www.scala-sbt.org/1.x/docs/Library-Management.html
unmanagedBase := baseDirectory.value / "custom_lib"
https://github.com/sbt/sbt-assembly/blob/master/src/sbt-test/sbt-assembly/deps/build.sbt
lazy val root = (project in file(".")). settings( version := "0.1", scalaVersion := "2.11.12", libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.1" % "test", libraryDependencies += "ch.qos.logback" % "logback-classic" % "0.9.29" % "runtime", unmanagedJars in Compile ++= { (baseDirectory.value / "lib" / "compile" ** "*.jar").classpath }, unmanagedJars in Runtime ++= { (baseDirectory.value / "lib" / "runtime" ** "*.jar").classpath }, unmanagedJars in Test ++= { (baseDirectory.value / "lib" / "test" ** "*.jar").classpath }, assemblyExcludedJars in assembly := { (fullClasspath in assembly).value filter {_.data.getName == "compile-0.1.0.jar"} }, assemblyJarName in assembly := "foo.jar", TaskKey[Unit]("check") := { val process = sys.process.Process("java", Seq("-jar", (crossTarget.value / "foo.jar").toString)) val out = (process!!) if (out.trim != "hello") sys.error("unexpected output: " + out) () } )
No comments:
Post a Comment