1-
21name := " compiler-benchmark"
32
43version := " 1.0-SNAPSHOT"
54
6- def scala212 = " 2.12.12 "
5+ def scala212 = " 2.12.15 "
76def dottyLatest = " 0.25.0"
8- scalaVersion in ThisBuild := scala212
7+ ThisBuild / scalaVersion := scala212
98val JmhConfig = config(" jmh" )
109
1110commands += Command .command(" testAll" ) { s =>
12- " test: compile" ::
11+ " Test/ compile" ::
1312 " compilation/test" ::
1413 " hot -psource=scalap -wi 1 -i 1 -f1" ::
1514 s " ++ $dottyLatest" ::
1615 " compilation/test" ::
1716 " hot -psource=re2s -wi 1 -i 1 -f1" ::
1817 s " ++ $scala212" ::
19- " micro/jmh: run -w1 -f1" ::
18+ " micro/Jmh/ run -w1 -f1" ::
2019 s
2120}
2221
23- resolvers in ThisBuild += " scala-integration" at " https://scala-ci.typesafe.com/artifactory/scala-integration/"
22+ ThisBuild / resolvers += " scala-integration" at " https://scala-ci.typesafe.com/artifactory/scala-integration/"
2423
2524// Convenient access to builds from PR validation
26- resolvers in ThisBuild ++= (
25+ ThisBuild / resolvers ++= (
2726 if (scalaVersion.value.endsWith(" -SNAPSHOT" ))
2827 List (
2928 " pr-scala snapshots" at " https://scala-ci.typesafe.com/artifactory/scala-pr-validation-snapshots/" ,
@@ -32,7 +31,7 @@ resolvers in ThisBuild ++= (
3231 Nil
3332)
3433
35- resolvers in ThisBuild += Resolver .mavenLocal
34+ ThisBuild / resolvers += Resolver .mavenLocal
3635
3736lazy val infrastructure = addJmh(project).settings(
3837 description := " Infrastrucuture to persist benchmark results annotated with metadata from Git" ,
@@ -61,19 +60,19 @@ lazy val compilation = addJmh(project).settings(
6160 crossScalaVersions := List (scala212, dottyLatest),
6261 unmanagedSourceDirectories.in(Compile ) +=
6362 sourceDirectory.in(Compile ).value / (if (isDotty.value) " dotc" else " scalac" ),
64- mainClass in ( Jmh , run) := Some (" scala.bench.ScalacBenchmarkRunner" ),
63+ Jmh / run / mainClass := Some (" scala.bench.ScalacBenchmarkRunner" ),
6564 libraryDependencies += " com.novocode" % " junit-interface" % " 0.11" % Test ,
66- testOptions in Test += Tests .Argument (TestFrameworks .JUnit ),
67- fork in ( Test , test) := true , // jmh scoped tasks run with fork := true.
65+ Test / testOptions += Tests .Argument (TestFrameworks .JUnit ),
66+ Test / test / fork := true , // jmh scoped tasks run with fork := true.
6867).settings(addJavaOptions).dependsOn(infrastructure)
6968
7069lazy val javaCompilation = addJmh(project).settings(
7170 description := " Black box benchmark of the java compiler" ,
7271 crossPaths := false ,
73- mainClass in ( Jmh , run) := Some (" scala.bench.ScalacBenchmarkRunner" ),
72+ Jmh / run / mainClass := Some (" scala.bench.ScalacBenchmarkRunner" ),
7473 libraryDependencies += " com.novocode" % " junit-interface" % " 0.11" % Test ,
75- testOptions in Test += Tests .Argument (TestFrameworks .JUnit ),
76- fork in ( Test , test) := true // jmh scoped tasks run with fork := true.
74+ Test / testOptions += Tests .Argument (TestFrameworks .JUnit ),
75+ Test / test/ fork := true // jmh scoped tasks run with fork := true.
7776).settings(addJavaOptions).dependsOn(infrastructure)
7877
7978lazy val micro = addJmh(project).settings(
@@ -116,7 +115,7 @@ def addJmh(project: Project): Project = {
116115 // output paths overlapping. This is because sbt-jmh declares the `jmh` config as extending `test`, but
117116 // configures `classDirectory in Jmh := classDirectory in Compile`.
118117 project.enablePlugins(JmhPlugin ).overrideConfigs(JmhConfig .extend(Compile )).settings(
119- version in Jmh := jmhV
118+ Jmh / version := jmhV
120119 )
121120}
122121
0 commit comments