@@ -33,7 +33,9 @@ import _root_.scala.util.Properties
33
33
implicit def millModuleBasePath : define.BasePath =
34
34
define.BasePath (super .millModuleBasePath.value / " modules" )
35
35
36
- object cli extends Cli
36
+ object cli extends Cli
37
+ // remove once migrate to Scala 3
38
+ object cli3 extends Cli { override def myScalaVersion = Scala .scala3 }
37
39
object `cli-options` extends CliOptions
38
40
object `build-macros` extends Cross [BuildMacros ](Scala .defaultInternal, Scala .scala3)
39
41
object options extends Cross [Options ](Scala .defaultInternal, Scala .scala3)
@@ -196,9 +198,10 @@ class BuildMacros(val crossScalaVersion: String) extends ScalaCliCrossSbtModule
196
198
def asyncScalacOptions (scalaVersion : String ) =
197
199
if (scalaVersion.startsWith(" 3" )) Nil else Seq (" -Xasync" )
198
200
199
- trait BuildLikeModule
200
- extends ScalaCliCrossSbtModule with ScalaCliPublishModule with HasTests
201
- with ScalaCliScalafixModule {
201
+ trait ProtoBuildModule extends ScalaCliPublishModule with HasTests
202
+ with ScalaCliScalafixModule
203
+
204
+ trait BuildLikeModule extends ScalaCliCrossSbtModule with ProtoBuildModule {
202
205
203
206
def scalacOptions = T {
204
207
super .scalacOptions() ++ Seq (" -Ywarn-unused" , " -deprecation" )
@@ -484,28 +487,32 @@ trait CliOptions extends SbtModule with ScalaCliPublishModule with settings.Scal
484
487
def scalaVersion = Scala .defaultInternal
485
488
}
486
489
487
- trait Cli extends SbtModule with CliLaunchers with ScalaCliPublishModule with FormatNativeImageConf
488
- with HasTests with HasMacroAnnotations with ScalaCliScalafixModule {
489
- def scalaVersion = Scala .defaultInternal
490
+ trait Cli extends SbtModule with ProtoBuildModule with CliLaunchers
491
+ with HasMacroAnnotations with FormatNativeImageConf {
492
+
493
+ def millSourcePath = super .millSourcePath / os.up / " cli"
494
+
495
+ def myScalaVersion = Scala .defaultInternal
496
+
497
+ def scalaVersion = T (myScalaVersion)
498
+
490
499
def scalacOptions = T {
491
- super .scalacOptions() ++ Seq (" -Xasync " , " - Ywarn-unused" , " -deprecation " )
500
+ super .scalacOptions() ++ asyncScalacOptions(scalaVersion()) ++ Seq (" -Ywarn-unused" )
492
501
}
493
502
def javacOptions = T {
494
503
super .javacOptions() ++ Seq (" --release" , " 16" )
495
504
}
496
505
def moduleDeps = Seq (
497
- build(Scala .defaultInternal ),
498
- `test-runner`( Scala .defaultInternal) ,
499
- `cli-options`
506
+ build(myScalaVersion ),
507
+ `cli-options` ,
508
+ `test-runner`(myScalaVersion)
500
509
)
501
510
502
511
def repositories = super .repositories ++ customRepositories
503
512
504
513
def ivyDeps = super .ivyDeps() ++ Agg (
505
- Deps .caseApp,
506
514
Deps .coursierLauncher,
507
515
Deps .coursierPublish,
508
- Deps .dataClass,
509
516
Deps .jimfs, // scalaJsEnvNodeJs pulls jimfs:1.1, whose class path seems borked (bin compat issue with the guava version it depends on)
510
517
Deps .jniUtils,
511
518
Deps .jsoniterCore,
@@ -522,7 +529,7 @@ trait Cli extends SbtModule with CliLaunchers with ScalaCliPublishModule with Fo
522
529
523
530
object test extends Tests with ScalaCliScalafixModule {
524
531
def moduleDeps = super .moduleDeps ++ Seq (
525
- build(Scala .defaultInternal ).test
532
+ build(myScalaVersion ).test
526
533
)
527
534
}
528
535
}
0 commit comments