@@ -105,10 +105,9 @@ object directives extends Cross[Directives](Scala.scala3MainVersions)
105105object core extends Cross [Core ](Scala .scala3MainVersions) with CrossScalaDefaultToInternal
106106object `build-module` extends Cross [Build ](Scala .scala3MainVersions)
107107 with CrossScalaDefaultToInternal
108- object runner extends Cross [Runner ](Scala .runnerScalaVersions) with CrossScalaDefaultToRunner
109- object `test-runner` extends Cross [TestRunner ](Scala .testRunnerScalaVersions)
110- with CrossScalaDefaultToRunner
111- object `tasty-lib` extends Cross [TastyLib ](Scala .all) with CrossScalaDefaultToInternal
108+ object runner extends Runner
109+ object `test-runner` extends TestRunner
110+ object `tasty-lib` extends Cross [TastyLib ](Scala .all) with CrossScalaDefaultToInternal
112111// Runtime classes used within native image on Scala 3 replacing runtime from Scala
113112object `scala3-runtime` extends Cross [Scala3Runtime ](Scala .scala3MainVersions)
114113 with CrossScalaDefaultToInternal
@@ -437,16 +436,16 @@ trait Core extends ScalaCliCrossSbtModule
437436 def constantsFile : T [PathRef ] = Task (persistent = true ) {
438437 val dir = Task .dest / " constants"
439438 val dest = dir / " Constants.scala"
440- val testRunnerMainClass = `test-runner`( Scala .runnerScala3)
439+ val testRunnerMainClass = `test-runner`
441440 .mainClass()
442441 .getOrElse(sys.error(" No main class defined for test-runner" ))
443- val runnerMainClass = build.runner( Scala .runnerScala3)
442+ val runnerMainClass = build.runner
444443 .mainClass()
445444 .getOrElse(sys.error(" No main class defined for runner" ))
446445 val detailedVersionValue =
447446 if (`local-repo`.developingOnStubModules) s """ Some(" ${vcsState()}") """
448447 else " None"
449- val testRunnerOrganization = `test-runner`( Scala .runnerScala3)
448+ val testRunnerOrganization = `test-runner`
450449 .pomSettings()
451450 .organization
452451 val code =
@@ -466,14 +465,15 @@ trait Core extends ScalaCliCrossSbtModule
466465 | def scalaNativeVersion = " ${Deps .Versions .scalaNative}"
467466 |
468467 | def testRunnerOrganization = " $testRunnerOrganization"
469- | def testRunnerModuleName = " ${`test-runner`( Scala .runnerScala3) .artifactName()}"
470- | def testRunnerVersion = " ${`test-runner`( Scala .runnerScala3) .publishVersion()}"
468+ | def testRunnerModuleName = " ${`test-runner`.artifactName()}"
469+ | def testRunnerVersion = " ${`test-runner`.publishVersion()}"
471470 | def testRunnerMainClass = " $testRunnerMainClass"
472471 |
473- | def runnerOrganization = " ${build.runner(Scala .runnerScala3).pomSettings().organization}"
474- | def runnerModuleName = " ${build.runner(Scala .runnerScala3).artifactName()}"
475- | def runnerVersion = " ${build.runner(Scala .runnerScala3).publishVersion()}"
476- | def runnerLegacyVersion = " ${Cli .runnerLegacyVersion}"
472+ | def runnerOrganization = " ${build.runner.pomSettings().organization}"
473+ | def runnerModuleName = " ${build.runner.artifactName()}"
474+ | def runnerVersion = " ${build.runner.publishVersion()}"
475+ | def runnerScala30LegacyVersion = " ${Cli .runnerScala30LegacyVersion}"
476+ | def runnerScala2LegacyVersion = " ${Cli .runnerScala2LegacyVersion}"
477477 | def runnerMainClass = " $runnerMainClass"
478478 |
479479 | def semanticDbPluginOrganization = " ${Deps .semanticDbScalac.dep.module.organization
@@ -744,7 +744,7 @@ trait Build extends ScalaCliCrossSbtModule
744744 options(crossScalaVersion),
745745 directives(crossScalaVersion),
746746 `scala-cli-bsp`,
747- `test-runner`(crossScalaVersion) ,
747+ `test-runner`,
748748 `tasty-lib`(crossScalaVersion)
749749 )
750750 override def scalacOptions : T [Seq [String ]] = Task {
@@ -1095,7 +1095,8 @@ trait CliIntegration extends SbtModule with ScalaCliPublishModule with HasTests
10951095 | def ammoniteVersion = " ${Deps .ammonite.dep.versionConstraint.asString}"
10961096 | def defaultGraalVMJavaVersion = " ${deps.graalVmJavaVersion}"
10971097 | def defaultGraalVMVersion = " ${deps.graalVmVersion}"
1098- | def runnerLegacyVersion = " ${Cli .runnerLegacyVersion}"
1098+ | def runnerScala30LegacyVersion = " ${Cli .runnerScala30LegacyVersion}"
1099+ | def runnerScala2LegacyVersion = " ${Cli .runnerScala2LegacyVersion}"
10991100 | def scalaPyVersion = " ${Deps .scalaPy.dep.versionConstraint.asString}"
11001101 | def scalaPyMaxScalaNative = " ${Deps .Versions .maxScalaNativeForScalaPy}"
11011102 | def bloopVersion = " ${Deps .bloopRifle.dep.versionConstraint.asString}"
@@ -1275,19 +1276,19 @@ trait CliIntegrationDocker extends SbtModule with ScalaCliPublishModule with Has
12751276 )
12761277}
12771278
1278- trait Runner extends ScalaCliCrossSbtModule
1279+ trait Runner extends SbtModule
12791280 with ScalaCliPublishModule
1280- with ScalaCliScalafixLegacyModule {
1281- override def crossScalaVersion : String = crossValue
1281+ with ScalaCliScalafixModule {
1282+ override def scalaVersion : T [ String ] = Scala .scala3Lts
12821283 override def scalacOptions : T [Seq [String ]] = Task {
1283- super .scalacOptions() ++ Seq (" -release" , " 8" )
1284+ super .scalacOptions() ++ Seq (" -release" , " 8" , " -deprecation " )
12841285 }
12851286 override def mainClass : T [Option [String ]] = Some (" scala.cli.runner.Runner" )
12861287 override def sources : T [Seq [PathRef ]] = Task .Sources {
12871288 val scala3DirNames =
1288- if (crossScalaVersion .startsWith(" 3." )) {
1289+ if (scalaVersion() .startsWith(" 3." )) {
12891290 val name =
1290- if (crossScalaVersion .contains(" -RC" )) " scala-3-unstable"
1291+ if (scalaVersion() .contains(" -RC" )) " scala-3-unstable"
12911292 else " scala-3-stable"
12921293 Seq (name)
12931294 }
@@ -1298,12 +1299,12 @@ trait Runner extends ScalaCliCrossSbtModule
12981299 }
12991300}
13001301
1301- trait TestRunner extends ScalaCliCrossSbtModule
1302+ trait TestRunner extends SbtModule
13021303 with ScalaCliPublishModule
1303- with ScalaCliScalafixLegacyModule {
1304- override def crossScalaVersion : String = crossValue
1304+ with ScalaCliScalafixModule {
1305+ override def scalaVersion : T [ String ] = Scala .scala3Lts
13051306 override def scalacOptions : T [Seq [String ]] = Task {
1306- super .scalacOptions() ++ Seq (" -release" , " 8" )
1307+ super .scalacOptions() ++ Seq (" -release" , " 8" , " -deprecation " )
13071308 }
13081309 override def ivyDeps : T [Agg [Dep ]] = super .ivyDeps() ++ Agg (
13091310 Deps .asm,
@@ -1345,12 +1346,9 @@ object `local-repo` extends LocalRepo {
13451346 */
13461347 def developingOnStubModules = false
13471348
1348- override def stubsModules : Seq [PublishLocalNoFluff ] =
1349- for {
1350- sv <- Scala .runnerScalaVersions
1351- proj <- Seq (runner, `test-runner`)
1352- } yield proj(sv)
1353- override def version : T [String ] = runner(Scala .runnerScala3).publishVersion()
1349+ override def stubsModules : Seq [PublishLocalNoFluff ] = Seq (runner, `test-runner`)
1350+
1351+ override def version : T [String ] = runner.publishVersion()
13541352}
13551353
13561354// Helper CI commands
0 commit comments