diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f840583ca9..8a883fbcae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -202,7 +202,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/benchmark-bridge b/benchmark-bridge index 8489b0de9f..e005cbe98f 160000 --- a/benchmark-bridge +++ b/benchmark-bridge @@ -1 +1 @@ -Subproject commit 8489b0de9ff82d7bbe2450da07b938fabb6605b1 +Subproject commit e005cbe98f7ce9a569b0d9c51bffb8d79e803142 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/build.sbt b/build.sbt index 2a331b40fe..84ca842bf1 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,18 +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, - libraryDependencies += Dependencies.graphviz % Test, - 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, @@ -306,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", @@ -323,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, @@ -380,16 +379,16 @@ lazy val bloopgun213: Project = project .settings(bloopgunSettings) def shadeSettingsForModule(moduleId: String, module: Reference) = List( - packageBin in Compile := { + (Compile / packageBin) := { 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 }, toShadeJars := { - 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 = !( @@ -426,10 +425,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) ) @@ -459,8 +458,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 ) @@ -489,10 +488,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", @@ -524,8 +523,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 ) @@ -537,7 +536,7 @@ lazy val benchmarks = project .enablePlugins(BuildInfoPlugin, JmhPlugin) .settings(benchmarksSettings(frontend)) .settings( - skip in publish := true + (publish / skip) := true ) val integrations = file("integrations") @@ -553,11 +552,11 @@ def shadeSbtSettingsForModule( module: Reference ) = { List( - packageBin in Compile := { + (Compile / packageBin) := { 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 }, @@ -567,7 +566,7 @@ def shadeSbtSettingsForModule( val eclipseJarsUnsignedDir = (Keys.crossTarget.value / "eclipse-jars-unsigned").toPath java.nio.file.Files.createDirectories(eclipseJarsUnsignedDir) - 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") @@ -643,10 +642,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 ) } @@ -660,7 +659,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", @@ -681,7 +680,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 @@ -707,7 +706,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( @@ -719,7 +718,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 @@ -730,7 +729,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.Scala212Version) .settings( target := (file( "integrations" @@ -738,7 +737,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")) @@ -770,12 +769,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") } ) @@ -818,8 +817,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. */ @@ -903,10 +902,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/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/compiler-plugin-allowlist/project/build.properties b/frontend/src/test/resources/compiler-plugin-allowlist/project/build.properties index 0b2e09c5ac..c8fcab543a 100644 --- a/frontend/src/test/resources/compiler-plugin-allowlist/project/build.properties +++ b/frontend/src/test/resources/compiler-plugin-allowlist/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.6.2 diff --git a/frontend/src/test/resources/compiler-plugin-allowlist/project/project/build.properties b/frontend/src/test/resources/compiler-plugin-allowlist/project/project/build.properties index 0b2e09c5ac..c8fcab543a 100644 --- a/frontend/src/test/resources/compiler-plugin-allowlist/project/project/build.properties +++ b/frontend/src/test/resources/compiler-plugin-allowlist/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/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-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/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" ) 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/frontend/src/test/scala/bloop/DagSpec.scala b/frontend/src/test/scala/bloop/DagSpec.scala index 70fd18d23d..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) - 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/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 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/Dependencies.scala b/project/Dependencies.scala index ebb3712af0..44a26381c7 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -85,8 +85,6 @@ object Dependencies { val pprint = "com.lihaoyi" %% "pprint" % "0.5.5" val scalacheck = "org.scalacheck" %% "scalacheck" % "1.13.4" val junit = "com.github.sbt" % "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 diff --git a/project/MavenPluginIntegration.scala b/project/MavenPluginIntegration.scala index 5a593a8dbe..0d4f075c74 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)) } } 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 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",