Skip to content

Commit 2547453

Browse files
Add specification-level module
1 parent ca02f6e commit 2547453

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

build.sc

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,19 @@ implicit def millModuleBasePath: define.BasePath =
3939

4040
object cli extends Cli
4141

42-
object `cli-options` extends CliOptions
43-
object `build-macros` extends BuildMacros
44-
object config extends Cross[Config](Scala.all: _*)
45-
object options extends Options
46-
object scalaparse extends ScalaParse
47-
object directives extends Directives
48-
object core extends Core
49-
object `build-module` extends Build
50-
object runner extends Cross[Runner](Scala.runnerScalaVersions: _*)
51-
object `test-runner` extends Cross[TestRunner](Scala.runnerScalaVersions: _*)
52-
object `bloop-rifle` extends Cross[BloopRifle](Scala.all: _*)
53-
object `tasty-lib` extends Cross[TastyLib](Scala.all: _*)
42+
object `specification-level` extends SpecificationLevel
43+
object `cli-options` extends CliOptions
44+
object `build-macros` extends BuildMacros
45+
object config extends Cross[Config](Scala.all: _*)
46+
object options extends Options
47+
object scalaparse extends ScalaParse
48+
object directives extends Directives
49+
object core extends Core
50+
object `build-module` extends Build
51+
object runner extends Cross[Runner](Scala.runnerScalaVersions: _*)
52+
object `test-runner` extends Cross[TestRunner](Scala.runnerScalaVersions: _*)
53+
object `bloop-rifle` extends Cross[BloopRifle](Scala.all: _*)
54+
object `tasty-lib` extends Cross[TastyLib](Scala.all: _*)
5455
// Runtime classes used within native image on Scala 3 replacing runtime from Scala
5556
object `scala3-runtime` extends Scala3Runtime
5657
// Logic to process classes that is shared between build and the scala-cli itself
@@ -416,7 +417,7 @@ trait Directives extends ScalaCliSbtModule with ScalaCliPublishModule with HasTe
416417
options,
417418
core,
418419
`build-macros`,
419-
`cli-options`
420+
`specification-level`
420421
)
421422
def scalacOptions = T {
422423
super.scalacOptions() ++ asyncScalacOptions(scalaVersion())
@@ -639,6 +640,18 @@ trait Build extends ScalaCliSbtModule with ScalaCliPublishModule with HasTests
639640
}
640641
}
641642

643+
trait SpecificationLevel extends SbtModule with ScalaCliPublishModule {
644+
def scalacOptions = T {
645+
val sv = scalaVersion()
646+
val isScala213 = sv.startsWith("2.13.")
647+
val extraOptions =
648+
if (isScala213) Seq("-Xsource:3")
649+
else Nil
650+
super.scalacOptions() ++ extraOptions
651+
}
652+
def scalaVersion = Scala.defaultInternal
653+
}
654+
642655
trait CliOptions extends SbtModule with ScalaCliPublishModule {
643656
def scalacOptions = T {
644657
val sv = scalaVersion()
@@ -648,6 +661,9 @@ trait CliOptions extends SbtModule with ScalaCliPublishModule {
648661
else Nil
649662
super.scalacOptions() ++ extraOptions
650663
}
664+
def moduleDeps = Seq(
665+
`specification-level`
666+
)
651667
def ivyDeps = super.ivyDeps() ++ Agg(
652668
Deps.caseApp,
653669
Deps.jsoniterCore213,
@@ -751,6 +767,7 @@ trait Cli extends SbtModule with ProtoBuildModule with CliLaunchers
751767
}
752768
def moduleDeps = Seq(
753769
`build-module`,
770+
`cli-options`,
754771
config(Scala.scala3),
755772
`scala3-graal`(Scala.scala3)
756773
)

modules/cli-options/src/main/scala/scala/cli/commands/SpecificationLevel.scala renamed to modules/specification-level/src/main/scala/scala/cli/commands/SpecificationLevel.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package scala.cli.commands
22

3-
import caseapp.annotation.Tag
4-
import os.copy
5-
63
sealed trait SpecificationLevel extends Product with Serializable {
74
def md = toString() + " have"
85
}

0 commit comments

Comments
 (0)