From f61c55a8d241eb235d8916c09af3e57920ed2b64 Mon Sep 17 00:00:00 2001 From: xuwei-k <6b656e6a69@gmail.com> Date: Sat, 20 Sep 2025 15:49:25 +0900 Subject: [PATCH] avoid old sbt `in` syntax --- build.sbt | 4 ++-- .../src/test/scala/xsbt/ZincBenchmark.scala | 8 ++++---- .../sbt-test/source-dependencies/patMat-scope/build.sbt | 2 +- .../relative-source-error/changes/absolute.sbt | 2 +- .../relative-source-error/changes/relative.sbt | 2 +- .../src/sbt-test/source-dependencies/type-alias/build.sbt | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build.sbt b/build.sbt index 000e96d698..9b6319bd35 100644 --- a/build.sbt +++ b/build.sbt @@ -316,7 +316,7 @@ lazy val zincBenchmarks = (projectMatrix in internalPath / "zinc-benchmarks") sourceDirectory := (Test / sourceDirectory).value, classDirectory := (Test / classDirectory).value, dependencyClasspath := (Test / dependencyClasspath).value, - // rewire tasks, so that 'jmh:run' automatically invokes 'jmh:compile' (otherwise a clean 'jmh:run' would fail) + // rewire tasks, so that 'Jmh/run' automatically invokes 'Jmh/compile' (otherwise a clean 'Jmh/run' would fail) compile := compile.dependsOn(Test / compile).value, run := run.dependsOn(Test / compile).evaluated, ) @@ -643,7 +643,7 @@ addCommandAlias( s"${compilerBridge213.id}/packageBin", s"${compilerBridge212.id}/packageBin", s"${zincBenchmarks.jvm(scala3).id}/Test/run $dir $pattern", - s"${zincBenchmarks.jvm(scala3).id}/jmh:run -p _tempDir=$dir -prof gc -foe true $pattern", + s"${zincBenchmarks.jvm(scala3).id}/Jmh/run -p _tempDir=$dir -prof gc -foe true $pattern", s"""eval IO.delete(file("$dir"))""", ).mkString(";", ";", "") } diff --git a/internal/zinc-benchmarks/src/test/scala/xsbt/ZincBenchmark.scala b/internal/zinc-benchmarks/src/test/scala/xsbt/ZincBenchmark.scala index 99d864188d..5e694c527c 100644 --- a/internal/zinc-benchmarks/src/test/scala/xsbt/ZincBenchmark.scala +++ b/internal/zinc-benchmarks/src/test/scala/xsbt/ZincBenchmark.scala @@ -180,17 +180,17 @@ private[xsbt] object ZincBenchmark { |// This task is instrumented by the benchmarks in the Zinc compiler |lazy val `$taskName` = | taskKey[Unit]("Get source files and classpath of subprojects") - |`$taskName` in ThisBuild := `$taskName-impl`.value + |ThisBuild / `$taskName` := `$taskName-impl`.value |lazy val `$taskName-impl` = Def.taskDyn { | // Resolve project dynamically to avoid name clashes/overloading | val project = LocalProject("$sbtProject") | Def.task { | val file = new File("${outputFile.getAbsolutePath.replace("\\", "/")}") - | val rawSources = (sources in Compile in project).value + | val rawSources = (project / Compile / sources).value | val sourcesLine = rawSources.map(_.getCanonicalPath).mkString(" ") - | val rawClasspath = (dependencyClasspath in Compile in project).value + | val rawClasspath = (project / Compile / dependencyClasspath).value | val classpathLine = rawClasspath.map(_.data.getCanonicalPath).mkString(java.io.File.pathSeparator) - | val optionsLine = (scalacOptions in Compile in project).value.mkString(" ") + | val optionsLine = (project / Compile / scalacOptions).value.mkString(" ") | IO.writeLines(file, Seq(sourcesLine, classpathLine, optionsLine)) | } |} diff --git a/zinc/src/sbt-test/source-dependencies/patMat-scope/build.sbt b/zinc/src/sbt-test/source-dependencies/patMat-scope/build.sbt index a38cb26981..a33aa1bba9 100644 --- a/zinc/src/sbt-test/source-dependencies/patMat-scope/build.sbt +++ b/zinc/src/sbt-test/source-dependencies/patMat-scope/build.sbt @@ -1 +1 @@ -classDirectory in Compile := file("classes") \ No newline at end of file +Compile / classDirectory := file("classes") diff --git a/zinc/src/sbt-test/source-dependencies/relative-source-error/changes/absolute.sbt b/zinc/src/sbt-test/source-dependencies/relative-source-error/changes/absolute.sbt index a5f2d007a5..0f5c9435ad 100644 --- a/zinc/src/sbt-test/source-dependencies/relative-source-error/changes/absolute.sbt +++ b/zinc/src/sbt-test/source-dependencies/relative-source-error/changes/absolute.sbt @@ -1 +1 @@ -scalaSource in Compile := baseDirectory.value / "src" \ No newline at end of file +Compile / scalaSource := baseDirectory.value / "src" diff --git a/zinc/src/sbt-test/source-dependencies/relative-source-error/changes/relative.sbt b/zinc/src/sbt-test/source-dependencies/relative-source-error/changes/relative.sbt index 8e898fe028..26f506c02f 100644 --- a/zinc/src/sbt-test/source-dependencies/relative-source-error/changes/relative.sbt +++ b/zinc/src/sbt-test/source-dependencies/relative-source-error/changes/relative.sbt @@ -1 +1 @@ -scalaSource in Compile := file("src") \ No newline at end of file +Compile / scalaSource := file("src") diff --git a/zinc/src/sbt-test/source-dependencies/type-alias/build.sbt b/zinc/src/sbt-test/source-dependencies/type-alias/build.sbt index c5a1099aac..38f4a7902b 100644 --- a/zinc/src/sbt-test/source-dependencies/type-alias/build.sbt +++ b/zinc/src/sbt-test/source-dependencies/type-alias/build.sbt @@ -1,3 +1,3 @@ -logLevel in compile := Level.Debug +compile / logLevel := Level.Debug incOptions := incOptions.value.withNameHashing(true)