From e13cd369dd0b8f4750be4db653d5ae13c98c5392 Mon Sep 17 00:00:00 2001 From: Kamil Podsiadlo Date: Mon, 14 Feb 2022 09:33:40 +0100 Subject: [PATCH 01/13] chore: bump sbt version --- .github/workflows/ci.yml | 2 +- bin/sbt-ci-release.bat | 2 +- project/build.properties | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c741f0483b..a398805b07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -208,7 +208,7 @@ jobs: # cmd. # Keep the sbt version in sync with `sbt-ci-release.bat`. run: | - sbt -sbt-version 1.4.9 version + sbt -sbt-version 1.6.2 version shell: bash - name: Publish GraalVM Native artifacts run: >- diff --git a/bin/sbt-ci-release.bat b/bin/sbt-ci-release.bat index 7cb7c292bd..e3477d6668 100644 --- a/bin/sbt-ci-release.bat +++ b/bin/sbt-ci-release.bat @@ -1,2 +1,2 @@ Rem Keep ci.yaml in sync with the sbt version -sbt -sbt-version 1.4.9 bloopgun/graalvm-native-image:packageBin +sbt -sbt-version 1.6.2 bloopgun/graalvm-native-image:packageBin diff --git a/project/build.properties b/project/build.properties index dbae93bcfd..c8fcab543a 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.9 +sbt.version=1.6.2 From 8ea80fe9aa077ada6e564f8895624c05175f3c5c Mon Sep 17 00:00:00 2001 From: Kamil Podsiadlo Date: Tue, 15 Feb 2022 08:28:27 +0100 Subject: [PATCH 02/13] chore: bump graphviz version --- frontend/src/test/scala/bloop/DagSpec.scala | 2 +- project/Dependencies.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/test/scala/bloop/DagSpec.scala b/frontend/src/test/scala/bloop/DagSpec.scala index 70fd18d23d..ac5a74e179 100644 --- a/frontend/src/test/scala/bloop/DagSpec.scala +++ b/frontend/src/test/scala/bloop/DagSpec.scala @@ -136,7 +136,7 @@ class DagSpec { val projectsMap = TestProjects.complete.map(p => p.name -> p).toMap val dags = fromMap(projectsMap) val dotContents = Dag.toDotGraph(dags) - Parser.read(dotContents) + (new Parser()).read(dotContents) () } diff --git a/project/Dependencies.scala b/project/Dependencies.scala index f41cb15380..73137c4010 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -28,7 +28,7 @@ object Dependencies { val sbtTestInterfaceVersion = "1.0" val sbtTestAgentVersion = "1.4.4" val junitVersion = "0.11" - val graphvizVersion = "0.2.2" + val graphvizVersion = "0.18.1" val directoryWatcherVersion = "0.8.0+6-f651bd93" val mavenApiVersion = "3.6.1" val mavenAnnotationsVersion = "3.5" From 2ff269bf6e3226eba2f8405a6afda75368b18445 Mon Sep 17 00:00:00 2001 From: Kamil Podsiadlo Date: Tue, 15 Feb 2022 08:47:37 +0100 Subject: [PATCH 03/13] chore: remove graphviz dependnecy --- build.sbt | 1 - frontend/src/test/scala/bloop/DagSpec.scala | 22 +++++++++++++++++---- project/Dependencies.scala | 2 -- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/build.sbt b/build.sbt index 2a331b40fe..ee545a642a 100644 --- a/build.sbt +++ b/build.sbt @@ -289,7 +289,6 @@ lazy val frontend: Project = project javaOptions in run ++= jvmOptions, javaOptions in Test ++= jvmOptions, javaOptions in IntegrationTest ++= jvmOptions, - libraryDependencies += Dependencies.graphviz % Test, fork in run := true, fork in Test := true, fork in run in IntegrationTest := true, diff --git a/frontend/src/test/scala/bloop/DagSpec.scala b/frontend/src/test/scala/bloop/DagSpec.scala index ac5a74e179..2f237a4ee5 100644 --- a/frontend/src/test/scala/bloop/DagSpec.scala +++ b/frontend/src/test/scala/bloop/DagSpec.scala @@ -7,14 +7,12 @@ import bloop.engine.Dag.{DagResult, RecursiveTrace} import bloop.engine.{Aggregate, Dag, Leaf, Parent} import bloop.logging.RecordingLogger import bloop.util.TestUtil -import guru.nidi.graphviz.parse.Parser import org.junit.experimental.categories.Category import org.junit.{Assert, Test} @Category(Array(classOf[bloop.FastTests])) class DagSpec { - //sddf private val logger = new RecordingLogger private val compileOptions = Config.CompileSetup.empty private val dummyInstance = TestUtil.scalaInstance @@ -136,8 +134,24 @@ class DagSpec { val projectsMap = TestProjects.complete.map(p => p.name -> p).toMap val dags = fromMap(projectsMap) val dotContents = Dag.toDotGraph(dags) - (new Parser()).read(dotContents) - () + val expected = + s"""|digraph "project" { + | graph [ranksep=0, rankdir=LR]; + | "b" [label="b"]; + | "d" [label="d"]; + | "e" [label="e"]; + | "f" [label="f"]; + | "c" [label="c"]; + | "a" [label="a"]; + | + | "f" -> "d"; + | "d" -> "c"; + | "b" -> "a"; + | "c" -> "a"; + | "d" -> "a"; + |} + |""".stripMargin + TestUtil.assertNoDiff(expected, dotContents) } @Test def EmptyDfs(): Unit = { diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 73137c4010..05e4ef553f 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -28,7 +28,6 @@ object Dependencies { val sbtTestInterfaceVersion = "1.0" val sbtTestAgentVersion = "1.4.4" val junitVersion = "0.11" - val graphvizVersion = "0.18.1" val directoryWatcherVersion = "0.8.0+6-f651bd93" val mavenApiVersion = "3.6.1" val mavenAnnotationsVersion = "3.5" @@ -85,7 +84,6 @@ object Dependencies { val pprint = "com.lihaoyi" %% "pprint" % "0.5.5" val scalacheck = "org.scalacheck" %% "scalacheck" % "1.13.4" val junit = "com.novocode" % "junit-interface" % junitVersion - val graphviz = "guru.nidi" % "graphviz-java" % graphvizVersion val directoryWatcher = "ch.epfl.scala" % "directory-watcher" % directoryWatcherVersion val difflib = "com.googlecode.java-diff-utils" % "diffutils" % difflibVersion From b1b22509050be24a7203f860e73ad6f1bb0a2154 Mon Sep 17 00:00:00 2001 From: Kamil Podsiadlo Date: Tue, 22 Feb 2022 10:50:12 +0100 Subject: [PATCH 04/13] chore: update sbt version in resources' projects --- .../compiler-plugin-whitelist/project/build.properties | 2 +- .../compiler-plugin-whitelist/project/project/build.properties | 2 +- .../cross-test-build-scala-native-0.4/project/build.properties | 2 +- .../cross-test-build-scalajs-0.6/project/build.properties | 2 +- .../project/project/build.properties | 2 +- .../cross-test-build-scalajs-1.0/project/build.properties | 2 +- .../project/project/build.properties | 2 +- .../cross-test-build-scalajs-1.x/project/build.properties | 2 +- .../project/project/build.properties | 2 +- .../resources/custom-test-framework/project/build.properties | 2 +- .../custom-test-framework/project/project/build.properties | 2 +- .../test/resources/no-test-frameworks/project/build.properties | 2 +- .../no-test-frameworks/project/project/build.properties | 2 +- .../test/resources/scala-seed-project/project/build.properties | 2 +- .../src/test/resources/simple-build/project/build.properties | 2 +- zinc | 1 + 16 files changed, 16 insertions(+), 15 deletions(-) create mode 160000 zinc diff --git a/frontend/src/test/resources/compiler-plugin-whitelist/project/build.properties b/frontend/src/test/resources/compiler-plugin-whitelist/project/build.properties index 0b2e09c5ac..c8fcab543a 100644 --- a/frontend/src/test/resources/compiler-plugin-whitelist/project/build.properties +++ b/frontend/src/test/resources/compiler-plugin-whitelist/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.6.2 diff --git a/frontend/src/test/resources/compiler-plugin-whitelist/project/project/build.properties b/frontend/src/test/resources/compiler-plugin-whitelist/project/project/build.properties index 0b2e09c5ac..c8fcab543a 100644 --- a/frontend/src/test/resources/compiler-plugin-whitelist/project/project/build.properties +++ b/frontend/src/test/resources/compiler-plugin-whitelist/project/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.6.2 diff --git a/frontend/src/test/resources/cross-test-build-scala-native-0.4/project/build.properties b/frontend/src/test/resources/cross-test-build-scala-native-0.4/project/build.properties index 0b2e09c5ac..c8fcab543a 100644 --- a/frontend/src/test/resources/cross-test-build-scala-native-0.4/project/build.properties +++ b/frontend/src/test/resources/cross-test-build-scala-native-0.4/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.6.2 diff --git a/frontend/src/test/resources/cross-test-build-scalajs-0.6/project/build.properties b/frontend/src/test/resources/cross-test-build-scalajs-0.6/project/build.properties index 0b2e09c5ac..c8fcab543a 100644 --- a/frontend/src/test/resources/cross-test-build-scalajs-0.6/project/build.properties +++ b/frontend/src/test/resources/cross-test-build-scalajs-0.6/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.6.2 diff --git a/frontend/src/test/resources/cross-test-build-scalajs-0.6/project/project/build.properties b/frontend/src/test/resources/cross-test-build-scalajs-0.6/project/project/build.properties index 0b2e09c5ac..c8fcab543a 100644 --- a/frontend/src/test/resources/cross-test-build-scalajs-0.6/project/project/build.properties +++ b/frontend/src/test/resources/cross-test-build-scalajs-0.6/project/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.6.2 diff --git a/frontend/src/test/resources/cross-test-build-scalajs-1.0/project/build.properties b/frontend/src/test/resources/cross-test-build-scalajs-1.0/project/build.properties index 0b2e09c5ac..c8fcab543a 100644 --- a/frontend/src/test/resources/cross-test-build-scalajs-1.0/project/build.properties +++ b/frontend/src/test/resources/cross-test-build-scalajs-1.0/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.6.2 diff --git a/frontend/src/test/resources/cross-test-build-scalajs-1.0/project/project/build.properties b/frontend/src/test/resources/cross-test-build-scalajs-1.0/project/project/build.properties index 0b2e09c5ac..c8fcab543a 100644 --- a/frontend/src/test/resources/cross-test-build-scalajs-1.0/project/project/build.properties +++ b/frontend/src/test/resources/cross-test-build-scalajs-1.0/project/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.6.2 diff --git a/frontend/src/test/resources/cross-test-build-scalajs-1.x/project/build.properties b/frontend/src/test/resources/cross-test-build-scalajs-1.x/project/build.properties index 0b2e09c5ac..c8fcab543a 100644 --- a/frontend/src/test/resources/cross-test-build-scalajs-1.x/project/build.properties +++ b/frontend/src/test/resources/cross-test-build-scalajs-1.x/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.6.2 diff --git a/frontend/src/test/resources/cross-test-build-scalajs-1.x/project/project/build.properties b/frontend/src/test/resources/cross-test-build-scalajs-1.x/project/project/build.properties index 0b2e09c5ac..c8fcab543a 100644 --- a/frontend/src/test/resources/cross-test-build-scalajs-1.x/project/project/build.properties +++ b/frontend/src/test/resources/cross-test-build-scalajs-1.x/project/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.6.2 diff --git a/frontend/src/test/resources/custom-test-framework/project/build.properties b/frontend/src/test/resources/custom-test-framework/project/build.properties index 0b2e09c5ac..c8fcab543a 100644 --- a/frontend/src/test/resources/custom-test-framework/project/build.properties +++ b/frontend/src/test/resources/custom-test-framework/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.6.2 diff --git a/frontend/src/test/resources/custom-test-framework/project/project/build.properties b/frontend/src/test/resources/custom-test-framework/project/project/build.properties index 0b2e09c5ac..c8fcab543a 100644 --- a/frontend/src/test/resources/custom-test-framework/project/project/build.properties +++ b/frontend/src/test/resources/custom-test-framework/project/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.6.2 diff --git a/frontend/src/test/resources/no-test-frameworks/project/build.properties b/frontend/src/test/resources/no-test-frameworks/project/build.properties index 0b2e09c5ac..c8fcab543a 100644 --- a/frontend/src/test/resources/no-test-frameworks/project/build.properties +++ b/frontend/src/test/resources/no-test-frameworks/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.6.2 diff --git a/frontend/src/test/resources/no-test-frameworks/project/project/build.properties b/frontend/src/test/resources/no-test-frameworks/project/project/build.properties index 0b2e09c5ac..c8fcab543a 100644 --- a/frontend/src/test/resources/no-test-frameworks/project/project/build.properties +++ b/frontend/src/test/resources/no-test-frameworks/project/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.6.2 diff --git a/frontend/src/test/resources/scala-seed-project/project/build.properties b/frontend/src/test/resources/scala-seed-project/project/build.properties index 0b2e09c5ac..c8fcab543a 100644 --- a/frontend/src/test/resources/scala-seed-project/project/build.properties +++ b/frontend/src/test/resources/scala-seed-project/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.6.2 diff --git a/frontend/src/test/resources/simple-build/project/build.properties b/frontend/src/test/resources/simple-build/project/build.properties index 0b2e09c5ac..c8fcab543a 100644 --- a/frontend/src/test/resources/simple-build/project/build.properties +++ b/frontend/src/test/resources/simple-build/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.6.2 diff --git a/zinc b/zinc new file mode 160000 index 0000000000..d881fa2feb --- /dev/null +++ b/zinc @@ -0,0 +1 @@ +Subproject commit d881fa2feb68b74c9c5afd1b8f62935a4e52b299 From 51f1cf743bed3714fc6a04224bdfccc06254b4f8 Mon Sep 17 00:00:00 2001 From: Kamil Podsiadlo Date: Tue, 22 Feb 2022 11:01:20 +0100 Subject: [PATCH 05/13] execute `git rm --cached ./zinc` --- zinc | 1 - 1 file changed, 1 deletion(-) delete mode 160000 zinc diff --git a/zinc b/zinc deleted file mode 160000 index d881fa2feb..0000000000 --- a/zinc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d881fa2feb68b74c9c5afd1b8f62935a4e52b299 From 8b7b3ee14340a602151b1b757c5d46cb600a77c1 Mon Sep 17 00:00:00 2001 From: Kamil Podsiadlo Date: Tue, 22 Feb 2022 17:17:00 +0100 Subject: [PATCH 06/13] misc: benchmark-bridge and scala 2.12.15 attempt2 --- .../sbt-bloop/src/sbt-test/sbt-bloop/lagom-compat/build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/sbt-bloop/src/sbt-test/sbt-bloop/lagom-compat/build.sbt b/integrations/sbt-bloop/src/sbt-test/sbt-bloop/lagom-compat/build.sbt index 632f6a2944..74a1b9a11e 100644 --- a/integrations/sbt-bloop/src/sbt-test/sbt-bloop/lagom-compat/build.sbt +++ b/integrations/sbt-bloop/src/sbt-test/sbt-bloop/lagom-compat/build.sbt @@ -2,7 +2,7 @@ organization in ThisBuild := "com.example" version in ThisBuild := "1.0-SNAPSHOT" // the Scala version that will be used for cross-compiled libraries -scalaVersion in ThisBuild := "2.12.4" +scalaVersion in ThisBuild := "2.12.15" val macwire = "com.softwaremill.macwire" %% "macros" % "2.3.0" % "provided" val scalaTest = "org.scalatest" %% "scalatest" % "3.0.4" % Test From 4d64dcec5b9c185d0f6bf317bb2d123738fce941 Mon Sep 17 00:00:00 2001 From: Kamil Podsiadlo Date: Wed, 23 Feb 2022 09:37:45 +0100 Subject: [PATCH 07/13] misc: checkout to the specific commit --- benchmark-bridge | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark-bridge b/benchmark-bridge index 8489b0de9f..841e2f2c9a 160000 --- a/benchmark-bridge +++ b/benchmark-bridge @@ -1 +1 @@ -Subproject commit 8489b0de9ff82d7bbe2450da07b938fabb6605b1 +Subproject commit 841e2f2c9ac4cf1f4384a141efa073756b91bc6b From 341155ad6e07bdcc719a796c35caa6545b5e600c Mon Sep 17 00:00:00 2001 From: Kamil Podsiadlo Date: Fri, 25 Feb 2022 12:03:47 +0100 Subject: [PATCH 08/13] chore: run scalfix with https://eed3si9n.com/syntactic-scalafix-rule-for-unified-slash-syntax/ --- build.sbt | 128 ++++++++++++++------------- project/BuildPlugin.scala | 86 +++++++++--------- project/MavenPluginIntegration.scala | 26 +++--- 3 files changed, 122 insertions(+), 118 deletions(-) diff --git a/build.sbt b/build.sbt index ee545a642a..f941086161 100644 --- a/build.sbt +++ b/build.sbt @@ -2,14 +2,14 @@ import _root_.bloop.integrations.sbt.BloopDefaults import build.BuildImplementation.BuildDefaults import xerial.sbt.Sonatype.SonatypeKeys -useGpg in Global := false +(Global / useGpg) := false -dynverSeparator in ThisBuild := "-" +(ThisBuild / dynverSeparator) := "-" // Tell bloop to aggregate source deps (benchmark) config files in the same bloop config dir -bloopAggregateSourceDependencies in Global := true +(Global / bloopAggregateSourceDependencies) := true -bloopExportJarClassifiers in ThisBuild := Some(Set("sources")) +(ThisBuild / bloopExportJarClassifiers) := Some(Set("sources")) /** * ************************************************************************************************ @@ -24,9 +24,9 @@ val benchmarkBridge = project .disablePlugins(ScriptedPlugin) .settings( releaseEarly := { () }, - skip in publish := true, - bloopGenerate in Compile := None, - bloopGenerate in Test := None + (publish / skip) := true, + (Compile / bloopGenerate) := None, + (Test / bloopGenerate) := None ) lazy val bloopShared = (project in file("shared")) @@ -147,7 +147,7 @@ lazy val jsonConfig211 = crossProject(JSPlatform, JVMPlatform) .settings( name := "bloop-config", scalaVersion := Scala211Version, - unmanagedSourceDirectories in Compile += + (Compile / unmanagedSourceDirectories) += Keys.baseDirectory.value / ".." / "src" / "main" / "scala-2.11-13", testResourceSettings ) @@ -176,9 +176,9 @@ lazy val jsonConfig212 = crossProject(JSPlatform, JVMPlatform) .settings(publishJsonModuleSettings) .settings( name := "bloop-config", - unmanagedSourceDirectories in Compile += + (Compile / unmanagedSourceDirectories) += Keys.baseDirectory.value / ".." / "src" / "main" / "scala-2.11-13", - scalaVersion := Keys.scalaVersion.in(backend).value, + scalaVersion := (backend / Keys.scalaVersion).value, scalacOptions := { scalacOptions.value.filterNot(opt => opt == "-deprecation"), }, @@ -208,7 +208,7 @@ lazy val jsonConfig213 = crossProject(JSPlatform, JVMPlatform) .settings(publishJsonModuleSettings) .settings( name := "bloop-config", - unmanagedSourceDirectories in Compile += + (Compile / unmanagedSourceDirectories) += Keys.baseDirectory.value / ".." / "src" / "main" / "scala-2.11-13", scalaVersion := "2.13.1", testResourceSettings @@ -234,7 +234,7 @@ lazy val sockets: Project = project description := "IPC: Unix Domain Socket and Windows Named Pipes for Java", libraryDependencies ++= Seq(Dependencies.jna, Dependencies.jnaPlatform), javacOptions ++= Seq("-source", "1.8", "-target", "1.8"), - sources in (Compile, doc) := Nil + (Compile / doc / sources) := Nil ) import build.BuildImplementation.jvmOptions @@ -266,7 +266,7 @@ lazy val frontend: Project = project ownProductDirectories ++ dependencyClasspath } ), - includeFilter in unmanagedResources in Test := { + (Test / unmanagedResources / includeFilter) := { new FileFilter { def accept(file: File): Boolean = { val abs = file.getAbsolutePath @@ -282,17 +282,17 @@ lazy val frontend: Project = project .settings( name := "bloop-frontend", bloopName := "bloop", - mainClass in Compile in run := Some("bloop.Cli"), - bloopMainClass in Compile in run := Some("bloop.Cli"), + (Compile / run / mainClass) := Some("bloop.Cli"), + (Compile / run / bloopMainClass) := Some("bloop.Cli"), buildInfoPackage := "bloop.internal.build", buildInfoKeys := bloopInfoKeys(nativeBridge04, jsBridge06, jsBridge1), - javaOptions in run ++= jvmOptions, - javaOptions in Test ++= jvmOptions, - javaOptions in IntegrationTest ++= jvmOptions, - fork in run := true, - fork in Test := true, - fork in run in IntegrationTest := true, - parallelExecution in test := false, + (run / javaOptions) ++= jvmOptions, + (Test / javaOptions) ++= jvmOptions, + (IntegrationTest / javaOptions) ++= jvmOptions, + (run / fork) := true, + (Test / fork) := true, + (IntegrationTest / run / fork) := true, + (test / parallelExecution) := false, libraryDependencies ++= List( Dependencies.jsoniterMacros % Provided, Dependencies.scalazCore, @@ -305,9 +305,9 @@ lazy val frontend: Project = project lazy val bloopgunSettings = Seq( name := "bloopgun-core", - fork in run := true, - fork in Test := true, - parallelExecution in Test := false, + (run / fork) := true, + (Test / fork) := true, + (Test / parallelExecution) := false, buildInfoPackage := "bloopgun.internal.build", buildInfoKeys := List(Keys.version), buildInfoObject := "BloopgunInfo", @@ -322,16 +322,16 @@ lazy val bloopgunSettings = Seq( Dependencies.jsoniterCore, Dependencies.jsoniterMacros % Provided ), - mainClass in GraalVMNativeImage := Some("bloop.bloopgun.Bloopgun"), + (GraalVMNativeImage / mainClass) := Some("bloop.bloopgun.Bloopgun"), graalVMNativeImageCommand := { val oldPath = graalVMNativeImageCommand.value if (!scala.util.Properties.isWin) oldPath else "C:/Users/runneradmin/.jabba/jdk/graalvm-ce-java11@21.1.0/bin/native-image.cmd" }, graalVMNativeImageOptions ++= { - val reflectionFile = Keys.sourceDirectory.in(Compile).value./("graal")./("reflection.json") + val reflectionFile = (Compile / Keys.sourceDirectory).value./("graal")./("reflection.json") val securityOverridesFile = - Keys.sourceDirectory.in(Compile).value./("graal")./("java.security.overrides") + (Compile / Keys.sourceDirectory).value./("graal")./("java.security.overrides") assert(reflectionFile.exists, s"${reflectionFile.getAbsolutePath()} doesn't exist") assert( securityOverridesFile.exists, @@ -379,8 +379,9 @@ lazy val bloopgun213: Project = project .settings(bloopgunSettings) def shadeSettingsForModule(moduleId: String, module: Reference) = List( - packageBin in Compile := { + (Compile / packageBin) := { Def.taskDyn { + // todo val baseJar = Keys.packageBin.in(module).in(Compile).value val unshadedJarDependencies = internalDependencyAsJars.in(Compile).in(module).value.map(_.data) @@ -388,6 +389,7 @@ def shadeSettingsForModule(moduleId: String, module: Reference) = List( }.value }, toShadeJars := { + // todo val dependencyJars = dependencyClasspath.in(Runtime).in(module).value.map(_.data) dependencyJars.flatMap { path => val ppath = path.toString @@ -425,10 +427,10 @@ def shadeSettingsForModule(moduleId: String, module: Reference) = List( lazy val bloopgunShadedSettings = Seq( name := "bloopgun", - fork in run := true, - fork in Test := true, - bloopGenerate in Compile := None, - bloopGenerate in Test := None, + (run / fork) := true, + (Test / fork) := true, + (Compile / bloopGenerate) := None, + (Test / bloopGenerate) := None, libraryDependencies ++= List(Dependencies.scalaCollectionCompat) ) @@ -458,8 +460,8 @@ lazy val launcherTest = project .settings(testSuiteSettings) .settings( name := "bloop-launcher-test", - fork in Test := true, - parallelExecution in Test := false, + (Test / fork) := true, + (Test / parallelExecution) := false, libraryDependencies ++= List( Dependencies.coursierInterface ) @@ -488,10 +490,10 @@ lazy val launcher213 = project lazy val launcherShadedSettings = Seq( name := "bloop-launcher", - fork in run := true, - fork in Test := true, - bloopGenerate in Compile := None, - bloopGenerate in Test := None, + (run / fork) := true, + (Test / fork) := true, + (Compile / bloopGenerate) := None, + (Test / bloopGenerate) := None, libraryDependencies ++= List( "net.java.dev.jna" % "jna" % "4.5.0", "net.java.dev.jna" % "jna-platform" % "4.5.0", @@ -523,8 +525,8 @@ lazy val bloop4j = project .dependsOn(jsonConfig212.jvm) .settings( name := "bloop4j", - fork in run := true, - fork in Test := true, + (run / fork) := true, + (Test / fork) := true, libraryDependencies ++= List( Dependencies.bsp4j ) @@ -536,7 +538,7 @@ lazy val benchmarks = project .enablePlugins(BuildInfoPlugin, JmhPlugin) .settings(benchmarksSettings(frontend)) .settings( - skip in publish := true + (publish / skip) := true ) val integrations = file("integrations") @@ -552,7 +554,8 @@ def shadeSbtSettingsForModule( module: Reference ) = { List( - packageBin in Compile := { + (Compile / packageBin) := { + // todo Def.taskDyn { val baseJar = Keys.packageBin.in(module).in(Compile).value val unshadedJarDependencies = @@ -566,6 +569,7 @@ def shadeSbtSettingsForModule( val eclipseJarsUnsignedDir = (Keys.crossTarget.value / "eclipse-jars-unsigned").toPath java.nio.file.Files.createDirectories(eclipseJarsUnsignedDir) + // todo val dependencyJars = dependencyClasspath.in(Runtime).in(module).value.map(_.data) dependencyJars.flatMap { path => val ppath = path.toString @@ -642,10 +646,10 @@ def defineShadedSbtPlugin( .settings(shadedModuleSettings) .settings(shadeSbtSettingsForModule("sbt-bloop-core", sbtBloop)) .settings( - fork in run := true, - fork in Test := true, - bloopGenerate in Compile := None, - bloopGenerate in Test := None, + (run / fork) := true, + (Test / fork) := true, + (Compile / bloopGenerate) := None, + (Test / bloopGenerate) := None, target := (file("integrations") / "sbt-bloop-shaded" / "target" / sbtVersion).getAbsoluteFile ) } @@ -659,7 +663,7 @@ lazy val sbtBloop10: Project = project lazy val sbtBloop10Shaded: Project = defineShadedSbtPlugin("sbtBloop10Shaded", Sbt1Version, sbtBloop10).settings( - scalaVersion := (scalaVersion in sbtBloop10).value, + scalaVersion := (sbtBloop10 / scalaVersion).value, // Add dependencies that are not shaded and are required to be unchanged to work at runtime libraryDependencies ++= List( "net.java.dev.jna" % "jna" % "4.5.0", @@ -680,7 +684,7 @@ lazy val sbtBloop013 = project lazy val sbtBloop013Shaded = defineShadedSbtPlugin("sbtBloop013Shaded", Sbt013Version, sbtBloop013).settings( - scalaVersion := (scalaVersion in sbtBloop013).value + scalaVersion := (sbtBloop013 / scalaVersion).value ) lazy val mavenBloop = project @@ -706,7 +710,7 @@ lazy val gradleBloop211 = project .settings(name := "gradle-bloop") .settings(BuildDefaults.gradlePluginBuildSettings) .settings(BuildInfoPlugin.buildInfoScopedSettings(Test)) - .settings(scalaVersion := Keys.scalaVersion.in(jsonConfig211.jvm).value) + .settings(scalaVersion := Dependencies.Scala211Version) .settings( libraryDependencies += Dependencies.classgraph % Test, target := (file( @@ -718,7 +722,7 @@ lazy val gradleBloop211 = project Test / bloopGenerate := None, Test / compile / skip := true, Test / test / skip := true, - publishLocal := publishLocal.dependsOn(publishLocal.in(jsonConfig211.jvm)).value + publishLocal := publishLocal.dependsOn((jsonConfig211.jvm / publishLocal)).value ) lazy val gradleBloop212 = project @@ -729,7 +733,7 @@ lazy val gradleBloop212 = project .dependsOn(jsonConfig212.jvm % "compile->compile;test->test", frontend % "test->test") .settings(BuildDefaults.gradlePluginBuildSettings, testSettings) .settings(BuildInfoPlugin.buildInfoScopedSettings(Test)) - .settings(scalaVersion := Keys.scalaVersion.in(jsonConfig212.jvm).value) + .settings(scalaVersion := Dependencies.Scala211Version) .settings( target := (file( "integrations" @@ -737,7 +741,7 @@ lazy val gradleBloop212 = project ) .settings( libraryDependencies += Dependencies.classgraph % Test, - publishLocal := publishLocal.dependsOn(publishLocal.in(jsonConfig212.jvm)).value + publishLocal := publishLocal.dependsOn((jsonConfig212.jvm / publishLocal)).value ) lazy val buildpressConfig = (project in file("buildpress-config")) @@ -769,12 +773,12 @@ val docs = project .settings( name := "bloop-docs", moduleName := "bloop-docs", - skip in publish := true, + (publish / skip) := true, scalaVersion := Scala212Version, - mdoc := run.in(Compile).evaluated, - mainClass.in(Compile) := Some("bloop.Docs"), - resources.in(Compile) ++= { - List(baseDirectory.in(ThisBuild).value / "docs") + mdoc := (Compile / run).evaluated, + (Compile / mainClass) := Some("bloop.Docs"), + (Compile / resources) ++= { + List((ThisBuild / baseDirectory).value / "docs") } ) @@ -817,8 +821,8 @@ lazy val nativeBridge04 = project .settings( name := "bloop-native-bridge-0.4", libraryDependencies += Dependencies.scalaNativeTools04, - javaOptions in Test ++= jvmOptions, - fork in Test := true + (Test / javaOptions) ++= jvmOptions, + (Test / fork) := true ) /* This project has the only purpose of forcing the resolution of some artifacts that fail spuriously to be fetched. */ @@ -902,10 +906,10 @@ val bloop = project .aggregate(allProjectReferences: _*) .settings( releaseEarly := { () }, - skip in publish := true, + (publish / skip) := true, crossSbtVersions := Seq(Sbt1Version, Sbt013Version), commands += BuildDefaults.exportProjectsInTestResourcesCmd, - buildIntegrationsBase := (Keys.baseDirectory in ThisBuild).value / "build-integrations", + buildIntegrationsBase := (ThisBuild / Keys.baseDirectory).value / "build-integrations", twitterDodo := buildIntegrationsBase.value./("build-twitter"), publishLocalAllModules := { BuildDefaults diff --git a/project/BuildPlugin.scala b/project/BuildPlugin.scala index bd4b22d36b..a84259e117 100644 --- a/project/BuildPlugin.scala +++ b/project/BuildPlugin.scala @@ -80,7 +80,7 @@ object BuildKeys { final val BenchmarkBridgeCompilation = ProjectRef(BenchmarkBridgeProject.build, "compilation") import sbt.{Test, TestFrameworks, Tests} - val buildBase = Keys.baseDirectory in ThisBuild + val buildBase = (ThisBuild / Keys.baseDirectory) val buildIntegrationsBase = Def.settingKey[File]("The base directory for our integration builds.") val twitterDodo = Def.settingKey[File]("The location of Twitter's dodo build tool") val exportCommunityBuild = Def.taskKey[Unit]("Clone and export the community build.") @@ -126,7 +126,7 @@ object BuildKeys { import sbt.Compile val buildpressSettings: Seq[Def.Setting[_]] = List( - Keys.fork in Keys.run := true + (Keys.run / Keys.fork) := true ) import ohnosequences.sbt.GithubRelease.{keys => GHReleaseKeys} @@ -140,7 +140,7 @@ object BuildKeys { GHReleaseKeys.ghreleaseRepoOrg := "scalacenter", GHReleaseKeys.ghreleaseRepoName := "bloop", GHReleaseKeys.ghreleaseAssets ++= { - val baseDir = Keys.baseDirectory.in(ThisBuild).value + val baseDir = (ThisBuild / Keys.baseDirectory).value val releaseTargetDir = Keys.target.value / "ghrelease-assets" val originBloopWindowsBinary = Keys.target.value / "graalvm-binaries" / "bloop-windows" @@ -207,9 +207,9 @@ object BuildKeys { } // Add only the artifact name for 0.6 bridge because we replace it - val jsBridge06Key = fromIvyModule("jsBridge06", Keys.ivyModule in jsBridge06) - val jsBridge10Key = fromIvyModule("jsBridge1", Keys.ivyModule in jsBridge1) - val nativeBridge04Key = fromIvyModule("nativeBridge04", Keys.ivyModule in nativeBridge04) + val jsBridge06Key = fromIvyModule("jsBridge06", (jsBridge06 / Keys.ivyModule)) + val jsBridge10Key = fromIvyModule("jsBridge1", (jsBridge1 / Keys.ivyModule)) + val nativeBridge04Key = fromIvyModule("nativeBridge04", (nativeBridge04 / Keys.ivyModule)) val bspKey = BuildInfoKey.constant("bspVersion" -> Dependencies.bspVersion) val extra = List( zincKey, @@ -243,14 +243,14 @@ object BuildKeys { import sbtassembly.{AssemblyKeys, MergeStrategy} val assemblySettings: Seq[Def.Setting[_]] = List( - Keys.mainClass in AssemblyKeys.assembly := Some("bloop.Bloop"), - Keys.test in AssemblyKeys.assembly := {}, - AssemblyKeys.assemblyMergeStrategy in AssemblyKeys.assembly := { + (AssemblyKeys.assembly / Keys.mainClass) := Some("bloop.Bloop"), + (AssemblyKeys.assembly / Keys.test) := {}, + (AssemblyKeys.assembly / AssemblyKeys.assemblyMergeStrategy) := { case "LICENSE.md" => MergeStrategy.first case "NOTICE.md" => MergeStrategy.first case PathList("io", "github", "soc", "directories", _ @_*) => MergeStrategy.first case x => - val oldStrategy = (AssemblyKeys.assemblyMergeStrategy in AssemblyKeys.assembly).value + val oldStrategy = (AssemblyKeys.assembly / AssemblyKeys.assemblyMergeStrategy).value oldStrategy(x) } ) @@ -272,7 +272,7 @@ object BuildKeys { ) def benchmarksSettings(dep: Reference): Seq[Def.Setting[_]] = List( - Keys.skip in Keys.publish := true, + (Keys.publish / Keys.skip) := true, BuildInfoKeys.buildInfoKeys := { val fullClasspathFiles = BuildInfoKey.map(BuildKeys.lazyFullClasspath.in(sbt.Compile).in(dep)) { @@ -298,8 +298,8 @@ object BuildKeys { .split(java.io.File.pathSeparatorChar) .find(_.contains("sbt-launch")) .getOrElse("")), - "-DbloopVersion=" + Keys.version.in(dep).value, - "-DbloopRef=" + refOf(Keys.version.in(dep).value), + "-DbloopVersion=" + (dep / Keys.version).value, + "-DbloopRef=" + refOf((dep / Keys.version).value), "-Dgit.localdir=" + buildBase.value.getAbsolutePath ) } @@ -320,10 +320,10 @@ object BuildImplementation { final val globalSettings: Seq[Def.Setting[_]] = Seq( Keys.cancelable := true, BuildKeys.schemaVersion := "4.2-refresh-3", - Keys.testOptions in Test += sbt.Tests.Argument("-oD"), + (Test / Keys.testOptions) += sbt.Tests.Argument("-oD"), Keys.onLoadMessage := Header.intro, Keys.onLoad := BuildDefaults.bloopOnLoad.value, - Keys.publishArtifact in Test := false + (Test / Keys.publishArtifact) := false ) private final val ThisRepo = GitHub("scalacenter", "bloop") @@ -385,21 +385,21 @@ object BuildImplementation { } }, // Legal requirement: license and notice files must be in the published jar - Keys.resources in Compile ++= BuildDefaults.getLicense.value, - Keys.sources in (Compile, Keys.doc) := Nil, - Keys.sources in (Test, Keys.doc) := Nil, - Keys.publishArtifact in Test := false, - Keys.publishArtifact in (Compile, Keys.packageDoc) := { + (Compile / Keys.resources) ++= BuildDefaults.getLicense.value, + (Compile / Keys.doc / Keys.sources) := Nil, + (Test / Keys.doc / Keys.sources) := Nil, + (Test / Keys.publishArtifact) := false, + (Compile / Keys.packageDoc / Keys.publishArtifact) := { val output = DynVerKeys.dynverGitDescribeOutput.value val version = Keys.version.value BuildDefaults.publishDocAndSourceArtifact(output, version) }, - Keys.publishArtifact in (Compile, Keys.packageSrc) := { + (Compile / Keys.packageSrc / Keys.publishArtifact) := { val output = DynVerKeys.dynverGitDescribeOutput.value val version = Keys.version.value BuildDefaults.publishDocAndSourceArtifact(output, version) }, - Keys.publishLocalConfiguration in Compile := + (Compile / Keys.publishLocalConfiguration) := Keys.publishLocalConfiguration.value.withOverwrite(true) ) // ++ metalsSettings @@ -530,7 +530,7 @@ object BuildImplementation { import sbtbuildinfo.BuildInfoPlugin.{autoImport => BuildInfoKeys} val gradlePluginBuildSettings: Seq[Def.Setting[_]] = { sbtbuildinfo.BuildInfoPlugin.buildInfoScopedSettings(Test) ++ List( - Keys.fork in Test := true, + (Test / Keys.fork) := true, Keys.resolvers ++= List( MavenRepository("Gradle releases", "https://repo.gradle.org/gradle/libs-releases-local/"), MavenRepository("Android plugin", "https://maven.google.com/"), @@ -543,16 +543,16 @@ object BuildImplementation { Dependencies.gradleAndroidPlugin ), Keys.publishLocal := Keys.publishLocal.dependsOn(Keys.publishM2).value, - Keys.unmanagedJars.in(Compile) := unmanagedJarsWithGradleApi.value, + (Compile / Keys.unmanagedJars) := unmanagedJarsWithGradleApi.value, BuildKeys.fetchGradleApi := { val logger = Keys.streams.value.log - val targetDir = (Keys.baseDirectory in Compile).value / "lib" + val targetDir = (Compile / Keys.baseDirectory).value / "lib" GradleIntegration.fetchGradleApi(Dependencies.gradleVersion, targetDir, logger) }, // Only generate for tests (they are not published and can contain user-dependent data) - BuildInfoKeys.buildInfo in Compile := Nil, - BuildInfoKeys.buildInfoPackage in Test := "bloop.internal.build", - BuildInfoKeys.buildInfoObject in Test := "BloopGradleIntegration" + (Compile / BuildInfoKeys.buildInfo) := Nil, + (Test / BuildInfoKeys.buildInfoPackage) := "bloop.internal.build", + (Test / BuildInfoKeys.buildInfoObject) := "BloopGradleIntegration" ) } @@ -560,24 +560,24 @@ object BuildImplementation { sbtbuildinfo.BuildInfoPlugin.buildInfoScopedSettings(Test) ++ List( BuildKeys.bloopCoursierJson := ReleaseUtils.bloopCoursierJson.value, BuildKeys.bloopLocalCoursierJson := ReleaseUtils.bloopLocalCoursierJson.value, - BuildInfoKeys.buildInfoKeys in Test := { + (Test / BuildInfoKeys.buildInfoKeys) := { import sbtbuildinfo.BuildInfoKey - val junitTestJars = BuildInfoKey.map(Keys.externalDependencyClasspath in Test) { + val junitTestJars = BuildInfoKey.map((Test / Keys.externalDependencyClasspath)) { case (_, classpath) => val jars = classpath.map(_.data.getAbsolutePath) val junitJars = jars.filter(j => j.contains("junit") || j.contains("hamcrest")) "junitTestJars" -> junitJars } - List(junitTestJars, BuildKeys.bloopCoursierJson, Keys.baseDirectory in ThisBuild) + List(junitTestJars, BuildKeys.bloopCoursierJson, (ThisBuild / Keys.baseDirectory)) }, - BuildInfoKeys.buildInfoPackage in Test := "bloop.internal.build", - BuildInfoKeys.buildInfoObject in Test := "BuildTestInfo" + (Test / BuildInfoKeys.buildInfoPackage) := "bloop.internal.build", + (Test / BuildInfoKeys.buildInfoObject) := "BuildTestInfo" ) } lazy val unmanagedJarsWithGradleApi: Def.Initialize[Task[Keys.Classpath]] = Def.taskDyn { - val unmanagedJarsTask = Keys.unmanagedJars.in(Compile).taskValue + val unmanagedJarsTask = (Compile / Keys.unmanagedJars).taskValue val _ = BuildKeys.fetchGradleApi.value Def.task(unmanagedJarsTask.value) } @@ -623,15 +623,15 @@ object BuildImplementation { val fixScalaVersionForSbtPlugin: Def.Initialize[String] = Def.setting { val orig = Keys.scalaVersion.value - val is013 = (Keys.sbtVersion in Keys.pluginCrossBuild).value.startsWith("0.13") + val is013 = (Keys.pluginCrossBuild / Keys.sbtVersion).value.startsWith("0.13") if (is013) "2.10.7" else orig } // From sbt-sensible https://gitlab.com/fommil/sbt-sensible/issues/5, legal requirement val getLicense: Def.Initialize[Task[Seq[File]]] = Def.task { - val orig = (Keys.resources in Compile).value + val orig = (Compile / Keys.resources).value val base = Keys.baseDirectory.value - val root = (Keys.baseDirectory in ThisBuild).value + val root = (ThisBuild / Keys.baseDirectory).value def fileWithFallback(name: String): File = if ((base / name).exists) base / name @@ -672,7 +672,7 @@ object BuildImplementation { System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows") if (isWindows) Def.task(println("Skipping export community build in Windows.")) else { - val baseDir = Keys.baseDirectory.in(ThisBuild).value + val baseDir = (ThisBuild / Keys.baseDirectory).value val pluginMainDir = baseDir / "integrations" / "sbt-bloop" / "src" / "main" // Only sbt sources are added, add new plugin sources when other build tools are supported @@ -725,10 +725,10 @@ object BuildImplementation { cachedGenerate(allPluginSourceFiles) Def.task { // Publish the projects before we invoke buildpress - Keys.publishLocal.in(circeConfig210).value - Keys.publishLocal.in(circeConfig212).value - Keys.publishLocal.in(sbtBloop013).value - Keys.publishLocal.in(sbtBloop10).value + (circeConfig210 / Keys.publishLocal).value + (circeConfig212 / Keys.publishLocal).value + (sbtBloop013 / Keys.publishLocal).value + (sbtBloop10 / Keys.publishLocal).value val file = Keys.resourceDirectory .in(Compile) @@ -806,7 +806,7 @@ object BuildImplementation { val productDirs = (new java.util.LinkedHashSet[Task[Seq[File]]]).asScala for ((dep, c) <- visited) { if ((dep != currentProject) || (conf.name != c && self.name != c)) { - val classpathKey = Keys.productDirectories in (dep, sbt.ConfigKey(c)) + val classpathKey = (dep / sbt.ConfigKey(c) / Keys.productDirectories) productDirs += classpathKey.get(data).getOrElse(sbt.std.TaskExtra.constant(Nil)) } } diff --git a/project/MavenPluginIntegration.scala b/project/MavenPluginIntegration.scala index 5a593a8dbe..16528f758b 100644 --- a/project/MavenPluginIntegration.scala +++ b/project/MavenPluginIntegration.scala @@ -56,12 +56,12 @@ object MavenPluginImplementation { MavenPluginKeys.mavenPlugin := false, MavenPluginKeys.mavenLogger := MavenPluginDefaults.mavenLogger.value, MavenPluginKeys.mavenProject := MavenPluginDefaults.mavenProject.value, - Keys.artifact in Keys.packageBin := { - val artifact = (Keys.artifact in Keys.packageBin).value + (Keys.packageBin / Keys.artifact) := { + val artifact = (Keys.packageBin / Keys.artifact).value if (!MavenPluginKeys.mavenPlugin.value) artifact else artifact.withType("maven-plugin") }, - Keys.resourceGenerators in Compile ++= { + (Compile / Keys.resourceGenerators) ++= { if (!MavenPluginKeys.mavenPlugin.value) Nil else List(MavenPluginDefaults.resourceGenerators.taskValue) } @@ -78,16 +78,16 @@ object MavenPluginImplementation { val build = new Build() val baseDir = Keys.baseDirectory.value.toPath() def shortenAndToString(f: File): String = baseDir.relativize(f.toPath()).toString() - build.setSourceDirectory(shortenAndToString(Keys.sourceDirectory.in(Compile).value)) - build.setTestSourceDirectory(shortenAndToString(Keys.sourceDirectory.in(Test).value)) - build.setOutputDirectory(shortenAndToString(Keys.classDirectory.in(Compile).value)) - build.setTestOutputDirectory(shortenAndToString(Keys.classDirectory.in(Test).value)) + build.setSourceDirectory(shortenAndToString((Compile / Keys.sourceDirectory).value)) + build.setTestSourceDirectory(shortenAndToString((Test / Keys.sourceDirectory).value)) + build.setOutputDirectory(shortenAndToString((Compile / Keys.classDirectory).value)) + build.setTestOutputDirectory(shortenAndToString((Test / Keys.classDirectory).value)) model.setBuild(build) new MavenProject(model) { def fs(f: File): String = f.getAbsolutePath() - this.setCompileSourceRoots(Keys.sourceDirectories.in(Compile).value.map(fs).asJava) - this.setTestCompileSourceRoots(Keys.sourceDirectories.in(Test).value.map(fs).asJava) + this.setCompileSourceRoots((Compile / Keys.sourceDirectories).value.map(fs).asJava) + this.setTestCompileSourceRoots((Test / Keys.sourceDirectories).value.map(fs).asJava) override def getBasedir: File = baseDir.toFile() } } @@ -118,9 +118,9 @@ object MavenPluginImplementation { val logger = MavenPluginKeys.mavenLogger.value val project = MavenPluginKeys.mavenProject.value - val classesDir = Keys.classDirectory.in(Compile).value + val classesDir = (Compile / Keys.classDirectory).value - val resolution = Keys.update.in(Runtime).value + val resolution = (Runtime / Keys.update).value val artifacts = getArtifacts(resolution) descriptor.setDependencies(getDescriptorDependencies(artifacts)) @@ -136,12 +136,12 @@ object MavenPluginImplementation { aggregateParametersFromDependentPlugins(artifacts, selector, bloopMojoDescriptor) val generator = new PluginDescriptorGenerator(new SystemStreamLog()) - val xmlDirectory = Keys.resourceManaged.in(Compile).value./("META-INF/maven") + val xmlDirectory = (Compile / Keys.resourceManaged).value /("META-INF/maven") val request = new DefaultPluginToolsRequest(project, descriptor) generator.execute(xmlDirectory, request) Seq(xmlDirectory./("plugin.xml")) } - task.dependsOn(Keys.compile in Compile) + task.dependsOn((Compile / Keys.compile)) } } From 8e01381309ff3d4fadfa8cf3c724d2515922e4d8 Mon Sep 17 00:00:00 2001 From: Kamil Podsiadlo Date: Fri, 25 Feb 2022 15:55:14 +0100 Subject: [PATCH 09/13] bump: benchmark commit --- benchmark-bridge | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark-bridge b/benchmark-bridge index 841e2f2c9a..e005cbe98f 160000 --- a/benchmark-bridge +++ b/benchmark-bridge @@ -1 +1 @@ -Subproject commit 841e2f2c9ac4cf1f4384a141efa073756b91bc6b +Subproject commit e005cbe98f7ce9a569b0d9c51bffb8d79e803142 From bf12bf1463fa4a536fc4e4b2c817ce9d15e27e7b Mon Sep 17 00:00:00 2001 From: Kamil Podsiadlo Date: Fri, 25 Feb 2022 16:07:02 +0100 Subject: [PATCH 10/13] chore: migrate rest syntax manually --- build.sbt | 15 ++++++--------- docs/build-tools/sbt.md | 2 +- .../cross-test-build-scala-native-0.4/build.sbt | 4 ++-- .../cross-test-build-scalajs-0.6/build.sbt | 4 ++-- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/build.sbt b/build.sbt index f941086161..c430a66b3a 100644 --- a/build.sbt +++ b/build.sbt @@ -381,16 +381,14 @@ lazy val bloopgun213: Project = project def shadeSettingsForModule(moduleId: String, module: Reference) = List( (Compile / packageBin) := { Def.taskDyn { - // todo - val baseJar = Keys.packageBin.in(module).in(Compile).value + val baseJar = (module / Compile / Keys.packageBin).value val unshadedJarDependencies = - internalDependencyAsJars.in(Compile).in(module).value.map(_.data) + (module / Compile / internalDependencyAsJars).value.map(_.data) shadingPackageBin(baseJar, unshadedJarDependencies) }.value }, toShadeJars := { - // todo - val dependencyJars = dependencyClasspath.in(Runtime).in(module).value.map(_.data) + val dependencyJars = (module / Runtime / dependencyClasspath).value.map(_.data) dependencyJars.flatMap { path => val ppath = path.toString val shouldShadeJar = !( @@ -557,9 +555,9 @@ def shadeSbtSettingsForModule( (Compile / packageBin) := { // todo Def.taskDyn { - val baseJar = Keys.packageBin.in(module).in(Compile).value + val baseJar = (module / Compile / Keys.packageBin).value val unshadedJarDependencies = - internalDependencyAsJars.in(Compile).in(module).value.map(_.data) + (module / Compile / internalDependencyAsJars).value.map(_.data) shadingPackageBin(baseJar, unshadedJarDependencies) }.value }, @@ -569,8 +567,7 @@ def shadeSbtSettingsForModule( val eclipseJarsUnsignedDir = (Keys.crossTarget.value / "eclipse-jars-unsigned").toPath java.nio.file.Files.createDirectories(eclipseJarsUnsignedDir) - // todo - val dependencyJars = dependencyClasspath.in(Runtime).in(module).value.map(_.data) + val dependencyJars = ( module / Runtime / dependencyClasspath).value.map(_.data) dependencyJars.flatMap { path => val ppath = path.toString val isEclipseJar = ppath.contains("eclipse") diff --git a/docs/build-tools/sbt.md b/docs/build-tools/sbt.md index 8834f62c45..cd6cea46ca 100644 --- a/docs/build-tools/sbt.md +++ b/docs/build-tools/sbt.md @@ -224,7 +224,7 @@ If you want bloop to export `mainClass` from your build definition, define eithe settings in your `build.sbt`: ```scala -bloopMainClass in (Compile, run) := Some("foo.App") +(Compile / run / bloopMainClass) := Some("foo.App") ``` The build plugin doesn't intentionally populate the main class directly from sbt's `mainClass` diff --git a/frontend/src/test/resources/cross-test-build-scala-native-0.4/build.sbt b/frontend/src/test/resources/cross-test-build-scala-native-0.4/build.sbt index 6566371fae..d6e44edf90 100644 --- a/frontend/src/test/resources/cross-test-build-scala-native-0.4/build.sbt +++ b/frontend/src/test/resources/cross-test-build-scala-native-0.4/build.sbt @@ -12,9 +12,9 @@ lazy val `test-project` = lazy val `test-project-native` = `test-project`.native.settings( // Should override default set above. Tested as part of ScalaNativeToolchainSpec. - bloopMainClass in (Compile, run) := Some("hello.DefaultApp") + (Compile / run / bloopMainClass) := Some("hello.DefaultApp") ) lazy val `test-project-jvm` = `test-project`.jvm.settings( - bloopMainClass in (Compile, run) := Some("hello.App") + (Compile / run / bloopMainClass) := Some("hello.App") ) diff --git a/frontend/src/test/resources/cross-test-build-scalajs-0.6/build.sbt b/frontend/src/test/resources/cross-test-build-scalajs-0.6/build.sbt index 04a9d2cde6..62496f06a3 100644 --- a/frontend/src/test/resources/cross-test-build-scalajs-0.6/build.sbt +++ b/frontend/src/test/resources/cross-test-build-scalajs-0.6/build.sbt @@ -40,10 +40,10 @@ lazy val `test-project` = lazy val `test-project-js` = `test-project`.js.settings( // Should override default set above. Tested as part of ScalaJsToolchainSpec. - bloopMainClass in (Compile, run) := Some("hello.DefaultApp") + (Compile / run / bloopMainClass) := Some("hello.DefaultApp") ) lazy val `test-project-jvm` = `test-project`.jvm.settings( - bloopMainClass in (Compile, run) := Some("hello.App"), + (Compile / run / bloopMainClass) := Some("hello.App"), unmanagedBase := baseDirectory.value / "custom_libraries" ) From 9f93e5e450d1a531ec1aaa4753ca6962fc9058f5 Mon Sep 17 00:00:00 2001 From: Kamil Podsiadlo Date: Fri, 25 Feb 2022 16:07:38 +0100 Subject: [PATCH 11/13] scalafmt --- build.sbt | 2 +- project/MavenPluginIntegration.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index c430a66b3a..84d0002819 100644 --- a/build.sbt +++ b/build.sbt @@ -567,7 +567,7 @@ def shadeSbtSettingsForModule( val eclipseJarsUnsignedDir = (Keys.crossTarget.value / "eclipse-jars-unsigned").toPath java.nio.file.Files.createDirectories(eclipseJarsUnsignedDir) - val dependencyJars = ( module / Runtime / dependencyClasspath).value.map(_.data) + val dependencyJars = (module / Runtime / dependencyClasspath).value.map(_.data) dependencyJars.flatMap { path => val ppath = path.toString val isEclipseJar = ppath.contains("eclipse") diff --git a/project/MavenPluginIntegration.scala b/project/MavenPluginIntegration.scala index 16528f758b..0d4f075c74 100644 --- a/project/MavenPluginIntegration.scala +++ b/project/MavenPluginIntegration.scala @@ -136,7 +136,7 @@ object MavenPluginImplementation { aggregateParametersFromDependentPlugins(artifacts, selector, bloopMojoDescriptor) val generator = new PluginDescriptorGenerator(new SystemStreamLog()) - val xmlDirectory = (Compile / Keys.resourceManaged).value /("META-INF/maven") + val xmlDirectory = (Compile / Keys.resourceManaged).value / ("META-INF/maven") val request = new DefaultPluginToolsRequest(project, descriptor) generator.execute(xmlDirectory, request) Seq(xmlDirectory./("plugin.xml")) From a31acbaf1272e9d8b2750c98172c2f82b91a70c1 Mon Sep 17 00:00:00 2001 From: Kamil Podsiadlo Date: Tue, 1 Mar 2022 08:55:08 +0100 Subject: [PATCH 12/13] fix: wrong gradle212 scala version --- build.sbt | 2 +- project/build.sbt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 84d0002819..5dc26f9d02 100644 --- a/build.sbt +++ b/build.sbt @@ -730,7 +730,7 @@ lazy val gradleBloop212 = project .dependsOn(jsonConfig212.jvm % "compile->compile;test->test", frontend % "test->test") .settings(BuildDefaults.gradlePluginBuildSettings, testSettings) .settings(BuildInfoPlugin.buildInfoScopedSettings(Test)) - .settings(scalaVersion := Dependencies.Scala211Version) + .settings(scalaVersion := Dependencies.Scala212Version) .settings( target := (file( "integrations" diff --git a/project/build.sbt b/project/build.sbt index dc15a3b3f4..5263e78ebb 100644 --- a/project/build.sbt +++ b/project/build.sbt @@ -50,7 +50,7 @@ val `bloop-build` = project .exclude("org.apache.maven", "maven-plugin-api") .exclude("org.apache.ant", "ant") }, - unmanagedSourceDirectories in Compile ++= { + (Compile / unmanagedSourceDirectories) ++= { val baseDir = baseDirectory.value.getParentFile List( baseDir / "sbt-shading" / "src" / "main" / "scala", From 190d7e98c10e45af0ba1ea1a9158a87d56f16817 Mon Sep 17 00:00:00 2001 From: Kamil Podsiadlo Date: Tue, 1 Mar 2022 09:29:17 +0100 Subject: [PATCH 13/13] misc: remove old todo [skip ci] --- build.sbt | 1 - 1 file changed, 1 deletion(-) diff --git a/build.sbt b/build.sbt index 5dc26f9d02..84ca842bf1 100644 --- a/build.sbt +++ b/build.sbt @@ -553,7 +553,6 @@ def shadeSbtSettingsForModule( ) = { List( (Compile / packageBin) := { - // todo Def.taskDyn { val baseJar = (module / Compile / Keys.packageBin).value val unshadedJarDependencies =