@@ -105,10 +105,10 @@ 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 .scala3MainVersions)
111+ with CrossScalaDefaultToInternal
112112// Runtime classes used within native image on Scala 3 replacing runtime from Scala
113113object `scala3-runtime` extends Cross [Scala3Runtime ](Scala .scala3MainVersions)
114114 with CrossScalaDefaultToInternal
@@ -437,16 +437,16 @@ trait Core extends ScalaCliCrossSbtModule
437437 def constantsFile : T [PathRef ] = Task (persistent = true ) {
438438 val dir = Task .dest / " constants"
439439 val dest = dir / " Constants.scala"
440- val testRunnerMainClass = `test-runner`( Scala .runnerScala3)
440+ val testRunnerMainClass = `test-runner`
441441 .mainClass()
442442 .getOrElse(sys.error(" No main class defined for test-runner" ))
443- val runnerMainClass = build.runner( Scala .runnerScala3)
443+ val runnerMainClass = build.runner
444444 .mainClass()
445445 .getOrElse(sys.error(" No main class defined for runner" ))
446446 val detailedVersionValue =
447447 if (`local-repo`.developingOnStubModules) s """ Some(" ${vcsState()}") """
448448 else " None"
449- val testRunnerOrganization = `test-runner`( Scala .runnerScala3)
449+ val testRunnerOrganization = `test-runner`
450450 .pomSettings()
451451 .organization
452452 val code =
@@ -466,14 +466,15 @@ trait Core extends ScalaCliCrossSbtModule
466466 | def scalaNativeVersion = " ${Deps .Versions .scalaNative}"
467467 |
468468 | def testRunnerOrganization = " $testRunnerOrganization"
469- | def testRunnerModuleName = " ${`test-runner`( Scala .runnerScala3) .artifactName()}"
470- | def testRunnerVersion = " ${`test-runner`( Scala .runnerScala3) .publishVersion()}"
469+ | def testRunnerModuleName = " ${`test-runner`.artifactName()}"
470+ | def testRunnerVersion = " ${`test-runner`.publishVersion()}"
471471 | def testRunnerMainClass = " $testRunnerMainClass"
472472 |
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}"
473+ | def runnerOrganization = " ${build.runner.pomSettings().organization}"
474+ | def runnerModuleName = " ${build.runner.artifactName()}"
475+ | def runnerVersion = " ${build.runner.publishVersion()}"
476+ | def runnerScala30LegacyVersion = " ${Cli .runnerScala30LegacyVersion}"
477+ | def runnerScala2LegacyVersion = " ${Cli .runnerScala2LegacyVersion}"
477478 | def runnerMainClass = " $runnerMainClass"
478479 |
479480 | def semanticDbPluginOrganization = " ${Deps .semanticDbScalac.dep.module.organization
@@ -744,7 +745,7 @@ trait Build extends ScalaCliCrossSbtModule
744745 options(crossScalaVersion),
745746 directives(crossScalaVersion),
746747 `scala-cli-bsp`,
747- `test-runner`(crossScalaVersion) ,
748+ `test-runner`,
748749 `tasty-lib`(crossScalaVersion)
749750 )
750751 override def scalacOptions : T [Seq [String ]] = Task {
@@ -1095,7 +1096,8 @@ trait CliIntegration extends SbtModule with ScalaCliPublishModule with HasTests
10951096 | def ammoniteVersion = " ${Deps .ammonite.dep.versionConstraint.asString}"
10961097 | def defaultGraalVMJavaVersion = " ${deps.graalVmJavaVersion}"
10971098 | def defaultGraalVMVersion = " ${deps.graalVmVersion}"
1098- | def runnerLegacyVersion = " ${Cli .runnerLegacyVersion}"
1099+ | def runnerScala30LegacyVersion = " ${Cli .runnerScala30LegacyVersion}"
1100+ | def runnerScala2LegacyVersion = " ${Cli .runnerScala2LegacyVersion}"
10991101 | def scalaPyVersion = " ${Deps .scalaPy.dep.versionConstraint.asString}"
11001102 | def scalaPyMaxScalaNative = " ${Deps .Versions .maxScalaNativeForScalaPy}"
11011103 | def bloopVersion = " ${Deps .bloopRifle.dep.versionConstraint.asString}"
@@ -1275,19 +1277,19 @@ trait CliIntegrationDocker extends SbtModule with ScalaCliPublishModule with Has
12751277 )
12761278}
12771279
1278- trait Runner extends ScalaCliCrossSbtModule
1280+ trait Runner extends SbtModule
12791281 with ScalaCliPublishModule
1280- with ScalaCliScalafixLegacyModule {
1281- override def crossScalaVersion : String = crossValue
1282+ with ScalaCliScalafixModule {
1283+ override def scalaVersion : T [ String ] = Scala .scala3Lts
12821284 override def scalacOptions : T [Seq [String ]] = Task {
1283- super .scalacOptions() ++ Seq (" -release" , " 8" )
1285+ super .scalacOptions() ++ Seq (" -release" , " 8" , " -deprecation " )
12841286 }
12851287 override def mainClass : T [Option [String ]] = Some (" scala.cli.runner.Runner" )
12861288 override def sources : T [Seq [PathRef ]] = Task .Sources {
12871289 val scala3DirNames =
1288- if (crossScalaVersion .startsWith(" 3." )) {
1290+ if (scalaVersion() .startsWith(" 3." )) {
12891291 val name =
1290- if (crossScalaVersion .contains(" -RC" )) " scala-3-unstable"
1292+ if (scalaVersion() .contains(" -RC" )) " scala-3-unstable"
12911293 else " scala-3-stable"
12921294 Seq (name)
12931295 }
@@ -1298,12 +1300,12 @@ trait Runner extends ScalaCliCrossSbtModule
12981300 }
12991301}
13001302
1301- trait TestRunner extends ScalaCliCrossSbtModule
1303+ trait TestRunner extends SbtModule
13021304 with ScalaCliPublishModule
1303- with ScalaCliScalafixLegacyModule {
1304- override def crossScalaVersion : String = crossValue
1305+ with ScalaCliScalafixModule {
1306+ override def scalaVersion : T [ String ] = Scala .scala3Lts
13051307 override def scalacOptions : T [Seq [String ]] = Task {
1306- super .scalacOptions() ++ Seq (" -release" , " 8" )
1308+ super .scalacOptions() ++ Seq (" -release" , " 8" , " -deprecation " )
13071309 }
13081310 override def ivyDeps : T [Agg [Dep ]] = super .ivyDeps() ++ Agg (
13091311 Deps .asm,
@@ -1315,7 +1317,7 @@ trait TestRunner extends ScalaCliCrossSbtModule
13151317
13161318trait TastyLib extends ScalaCliCrossSbtModule
13171319 with ScalaCliPublishModule
1318- with ScalaCliScalafixLegacyModule {
1320+ with ScalaCliScalafixModule {
13191321 override def crossScalaVersion : String = crossValue
13201322 def constantsFile : T [PathRef ] = Task (persistent = true ) {
13211323 val dir = Task .dest / " constants"
@@ -1345,12 +1347,9 @@ object `local-repo` extends LocalRepo {
13451347 */
13461348 def developingOnStubModules = false
13471349
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()
1350+ override def stubsModules : Seq [PublishLocalNoFluff ] = Seq (runner, `test-runner`)
1351+
1352+ override def version : T [String ] = runner.publishVersion()
13541353}
13551354
13561355// Helper CI commands
0 commit comments