diff --git a/bin/test-2.11 b/bin/test-2.11 index fb251a20c9..a7e2407217 100755 --- a/bin/test-2.11 +++ b/bin/test-2.11 @@ -2,4 +2,4 @@ . "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/scriptLib" -runSbtNoisy "+++2.11.12 test" +runSbtNoisy "++2.11.12 test" diff --git a/bin/test-2.12 b/bin/test-2.12 index 68ba5f8592..7a315ae1fa 100755 --- a/bin/test-2.12 +++ b/bin/test-2.12 @@ -2,4 +2,4 @@ . "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/scriptLib" -runSbtNoisy "+++2.12.8 test" +runSbtNoisy "++2.12.8 test" diff --git a/build.sbt b/build.sbt index 3849d2ef7f..b9975861b4 100644 --- a/build.sbt +++ b/build.sbt @@ -10,7 +10,6 @@ import lagom.Protobuf import com.typesafe.sbt.SbtScalariform.ScalariformKeys import de.heikoseeberger.sbtheader.{ HeaderKey, HeaderPattern } import com.typesafe.tools.mima.core._ -import sbt.CrossVersion._ // Turn off "Resolving" log messages that clutter build logs ivyLoggingLevel in ThisBuild := UpdateLogging.Quiet @@ -140,7 +139,7 @@ def releaseStepCommandAndRemaining(command: String): State => State = { original if (newState.remainingCommands.isEmpty) { newState } else { - runCommand(newState.remainingCommands.head, newState.copy(remainingCommands = newState.remainingCommands.tail)) + runCommand(newState.remainingCommands.head.commandLine, newState.copy(remainingCommands = newState.remainingCommands.tail)) } } @@ -168,8 +167,6 @@ def runtimeLibCommon: Seq[Setting[_]] = common ++ runtimeScalaSettings ++ Seq( Dependencies.pruneWhitelistSetting, Dependencies.dependencyWhitelistSetting, - incOptions := incOptions.value.withNameHashing(true), - // show full stack traces and test case durations testOptions in Test += Tests.Argument("-oDF"), // -v Log "test run started" / "test started" / "test run finished" events on log level "info" instead of "debug". @@ -193,11 +190,11 @@ val defaultMultiJvmOptions: List[String] = { // -Djava.net.preferIPv4Stack=true or -Dmultinode.Xmx512m val MultinodeJvmArgs = "multinode\\.(D|X)(.*)".r val knownPrefix = Set("akka.", "lagom.") - val properties = System.getProperties.propertyNames.asScala.toList.collect { + val properties = System.getProperties.stringPropertyNames.asScala.toList.collect { case MultinodeJvmArgs(a, b) => val value = System.getProperty("multinode." + a + b) "-" + a + b + (if (value == "") "" else "=" + value) - case key: String if knownPrefix.exists(pre => key.startsWith(pre)) => "-D" + key + "=" + System.getProperty(key) + case key if knownPrefix.exists(pre => key.startsWith(pre)) => "-D" + key + "=" + System.getProperty(key) } "-Xmx128m" :: properties @@ -247,11 +244,15 @@ def multiJvmTestSettings: Seq[Setting[_]] = { executeTests in Test := { val testResults = (executeTests in Test).value val multiNodeResults = (executeTests in MultiJvm).value - val overall = - if (testResults.overall.id < multiNodeResults.overall.id) - multiNodeResults.overall - else - testResults.overall + import TestResult.{ Passed, Failed, Error } + val overall = (testResults.overall, multiNodeResults.overall) match { + case (Passed, Passed) => Passed + case (Failed, Failed) => Failed + case (Error, Error) => Error + case (Passed, Failed) | (Failed, Passed) => Failed + case (Passed, Error) | (Error, Passed) => Error + case (Failed, Error) | (Error, Failed) => Error + } Tests.Output(overall, testResults.events ++ multiNodeResults.events, testResults.summaries ++ multiNodeResults.summaries) @@ -265,7 +266,7 @@ def macroCompileSettings: Seq[Setting[_]] = Seq( compile in Test ~= { a => // Delete classes in "compile" packages after compiling. // These are used for compile-time tests and should be recompiled every time. - val products = a.relations.allProducts.toSeq ** new SimpleFileFilter(_.getParentFile.getName == "compile") + val products = (a.asInstanceOf[sbt.internal.inc.Analysis]).relations.allProducts.toSeq ** new SimpleFileFilter(_.getParentFile.getName == "compile") IO.delete(products.get) a } @@ -370,9 +371,8 @@ val sbtScriptedProjects = Seq[Project]( lazy val root = (project in file(".")) .settings(name := "lagom") .settings(runtimeLibCommon: _*) - .enablePlugins(CrossPerProjectPlugin) .settings( - crossScalaVersions := Dependencies.ScalaVersions, + crossScalaVersions := Nil, scalaVersion := Dependencies.ScalaVersions.head, PgpKeys.publishSigned := {}, publishLocal := {}, @@ -653,12 +653,12 @@ def forkedTests: Seq[Setting[_]] = Seq( def singleTestsGrouping(tests: Seq[TestDefinition]) = { // We could group non Cassandra tests into another group // to avoid new JVM for each test, see http://www.scala-sbt.org/release/docs/Testing.html - val javaOptions = Seq("-Xms256M", "-Xmx512M") + val javaOptions = Vector("-Xms256M", "-Xmx512M") tests map { test => Tests.Group( name = test.name, tests = Seq(test), - runPolicy = Tests.SubProcess(ForkOptions(runJVMOptions = javaOptions)) + runPolicy = Tests.SubProcess(ForkOptions().withRunJVMOptions(javaOptions)) ) } } @@ -1093,10 +1093,9 @@ lazy val `sbt-build-tool-support` = (project in file("dev") / "build-tool-suppor lazy val `sbt-plugin` = (project in file("dev") / "sbt-plugin") .settings(common: _*) .settings(scriptedSettings: _*) - .enablePlugins(SbtPluginPlugins) + .enablePlugins(SbtPluginPlugins, SbtPlugin) .settings( name := "lagom-sbt-plugin", - sbtPlugin := true, crossScalaVersions := Dependencies.SbtScalaVersions, scalaVersion := Dependencies.SbtScalaVersions.head, sbtVersion in pluginCrossBuild := defineSbtVersion(scalaBinaryVersion.value), @@ -1116,10 +1115,11 @@ lazy val `sbt-plugin` = (project in file("dev") / "sbt-plugin") val () = (publishLocal in `sbt-scripted-library`).value }, publishTo := { + val old = publishTo.value if (isSnapshot.value) { // Bintray doesn't support publishing snapshots, publish to Sonatype snapshots instead Some(Opts.resolver.sonatypeSnapshots) - } else publishTo.value + } else old }, publishMavenStyle := isSnapshot.value ).dependsOn(`sbt-build-tool-support`) @@ -1154,7 +1154,7 @@ lazy val `maven-launcher` = (project in file("dev") / "maven-launcher") Dependencies.`maven-launcher` ) -def scriptedSettings: Seq[Setting[_]] = ScriptedPlugin.scriptedSettings ++ +def scriptedSettings: Seq[Setting[_]] = Seq(scriptedLaunchOpts += s"-Dproject.version=${version.value}") ++ Seq( scripted := scripted.tag(Tags.Test).evaluated, @@ -1226,7 +1226,7 @@ lazy val `maven-dependencies` = (project in file("dev") / "maven-dependencies") Dependencies.ScalaVersions.map { supportedVersion => // we are sure this won't be a None val crossFunc = - CrossVersion(new Binary(binaryScalaVersion), supportedVersion, binaryScalaVersion(supportedVersion)).get + CrossVersion(Binary(), supportedVersion, CrossVersion.binaryScalaVersion(supportedVersion)).get // convert artifactName to match the desired scala version val artifactId = crossFunc(artifactName) @@ -1265,7 +1265,7 @@ lazy val `maven-dependencies` = (project in file("dev") / "maven-dependencies") // if it's a Scala dependency, // generate block for each supported scala version Dependencies.ScalaVersions.map { supportedVersion => - val crossDep = CrossVersion(supportedVersion, binaryScalaVersion(supportedVersion))(dep) + val crossDep = CrossVersion(supportedVersion, CrossVersion.binaryScalaVersion(supportedVersion))(dep) {crossDep.organization} {crossDep.name} @@ -1277,11 +1277,11 @@ lazy val `maven-dependencies` = (project in file("dev") / "maven-dependencies") } - } - ).settings( + }, // This disables creating jar, source jar and javadocs, and will cause the packaging type to be "pom" when the // pom is created - Classpaths.defaultPackageKeys.map(key => publishArtifact in key := false): _* + Classpaths.defaultPackageKeys.map(key => publishArtifact in key := false), + publishMavenStyle := true, // Disable publishing ("delivering") the ivy.xml file ) // This project doesn't get aggregated, it is only executed by the sbt-plugin scripted dependencies diff --git a/docs/build.sbt b/docs/build.sbt index c7c267f6c7..63e465ee27 100644 --- a/docs/build.sbt +++ b/docs/build.sbt @@ -12,6 +12,7 @@ val HibernateVersion = "5.2.12.Final" val ValidationApiVersion = "2.0.1.Final" val branch = { + import scala.sys.process._ val rev = "git rev-parse --abbrev-ref HEAD".!!.trim if (rev == "HEAD") { // not on a branch, get the hash @@ -128,12 +129,13 @@ def forkedTests: Seq[Setting[_]] = Seq( def singleTestsGrouping(tests: Seq[TestDefinition]) = { // We could group non Cassandra tests into another group // to avoid new JVM for each test, see https://www.scala-sbt.org/release/docs/Testing.html - val javaOptions = Seq("-Xms256M", "-Xmx512M") + val javaOptions = Vector("-Xms256M", "-Xmx512M") tests map { test => new Tests.Group( name = test.name, tests = Seq(test), - runPolicy = Tests.SubProcess(javaOptions)) + runPolicy = Tests.SubProcess(ForkOptions().withRunJVMOptions(javaOptions)), + ) } } diff --git a/docs/manual/common/guide/devmode/code/dev-environment.sbt b/docs/manual/common/guide/devmode/code/dev-environment.sbt index 5bf964559a..9a571c6f6f 100644 --- a/docs/manual/common/guide/devmode/code/dev-environment.sbt +++ b/docs/manual/common/guide/devmode/code/dev-environment.sbt @@ -21,6 +21,7 @@ startElasticSearch in ThisBuild := { elasticsearch / "bin" / "elasticsearch" } + import scala.sys.process._ val process = Process(binFile.getAbsolutePath, elasticsearch).run(log) log.info("Elastic search started on port 9200") diff --git a/docs/project/build.properties b/docs/project/build.properties index 133a8f197e..c0bab04941 100644 --- a/docs/project/build.properties +++ b/docs/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.17 +sbt.version=1.2.8 diff --git a/docs/project/plugins.sbt b/docs/project/plugins.sbt index 2ee13b5062..c53c32def6 100644 --- a/docs/project/plugins.sbt +++ b/docs/project/plugins.sbt @@ -2,13 +2,11 @@ lazy val plugins = (project in file(".")).dependsOn(dev) lazy val dev = ProjectRef(Path.fileProperty("user.dir").getParentFile, "sbt-plugin") -resolvers += Resolver.typesafeIvyRepo("releases") -addSbtPlugin("com.lightbend.markdown" %% "sbt-lightbend-markdown" % "1.6.1") +addSbtPlugin("com.lightbend.markdown" %% "sbt-lightbend-markdown" % "1.7.0") -// Needed for bintray configuration code samples -addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0") +addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4") -addSbtPlugin("com.typesafe.sbt" % "sbt-web" % "1.2.2") -addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.1.1") -addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.1.1") -addSbtPlugin("com.typesafe.sbt" % "sbt-uglify" % "1.0.3") +addSbtPlugin("com.typesafe.sbt" % "sbt-web" % "1.4.4") +addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.4.0") +addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.1.2") +addSbtPlugin("com.typesafe.sbt" % "sbt-uglify" % "2.0.0") diff --git a/project/Dependencies.scala b/project/Dependencies.scala index e1c40527a2..78b1b31a03 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -124,8 +124,7 @@ object Dependencies { "jackson-datatype-jdk8", "jackson-datatype-jsr310", "jackson-datatype-guava", "jackson-datatype-pcollections" ) - - val scalaParserCombinatorOverrides = Set(scalaParserCombinators) + val scalaParserCombinatorOverrides = Seq(scalaParserCombinators) // A whitelist of dependencies that Lagom is allowed to depend on, either directly or transitively. // This list is used to validate all of Lagom's dependencies. diff --git a/project/Protobuf.scala b/project/Protobuf.scala index a0f6737454..5f3d2ae69a 100644 --- a/project/Protobuf.scala +++ b/project/Protobuf.scala @@ -5,8 +5,9 @@ package lagom import sbt._ -import Process._ -import Keys._ +import sbt.Keys._ +import sbt.util.CacheStoreFactory +import scala.sys.process._ import com.typesafe.sbt.preprocess.Preprocess._ import java.io.File diff --git a/project/SbtMavenPlugin.scala b/project/SbtMavenPlugin.scala index 8e05c10a6a..772ef796aa 100644 --- a/project/SbtMavenPlugin.scala +++ b/project/SbtMavenPlugin.scala @@ -119,7 +119,7 @@ object SbtMavenPlugin extends AutoPlugin { test.getName -> mavenExecutions.foldLeft(true) { (success, execution) => if (success) { log.info(s"Executing mvn $execution") - val rc = Fork.java(ForkOptions(workingDirectory = Some(testDir)), args ++ execution.split(" +")) + val rc = Fork.java(ForkOptions().withWorkingDirectory(testDir), args ++ execution.split(" +")) rc == 0 } else { false diff --git a/project/build.properties b/project/build.properties index 133a8f197e..c0bab04941 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.17 +sbt.version=1.2.8 diff --git a/project/plugins.sbt b/project/plugins.sbt index 9723e48f0b..34bb63d092 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,10 +3,6 @@ buildInfoSettings sourceGenerators in Compile += buildInfo.taskValue -libraryDependencies ++= Seq( - "org.scala-sbt" % "scripted-plugin" % sbtVersion.value -) - addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.3.3") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "1.8.0") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "0.5.0") @@ -17,9 +13,8 @@ addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0") addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.7.1") addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.6.0") addSbtPlugin("com.typesafe.sbt" % "sbt-multi-jvm" % "0.3.8") -addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.1") +addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.4") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.3.0") -addSbtPlugin("com.eed3si9n" % "sbt-doge" % "0.1.5") addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2") addSbtPlugin("com.lightbend" % "sbt-whitesource" % "0.1.14")