@@ -252,6 +252,13 @@ object Build {
252
252
autoScalaLibrary := false
253
253
)
254
254
255
+ lazy val commonScala2Settings = commonSettings ++ Seq (
256
+ scalaVersion := stdlibVersion(Bootstrapped ),
257
+ moduleName ~= { _.stripSuffix(" -scala2" ) },
258
+ version := dottyVersion,
259
+ target := baseDirectory.value / " .." / " out" / " scala-2" / name.value,
260
+ )
261
+
255
262
// Settings used when compiling dotty with the reference compiler
256
263
lazy val commonNonBootstrappedSettings = commonDottySettings ++ Seq (
257
264
unmanagedSourceDirectories in Compile += baseDirectory.value / " src-non-bootstrapped" ,
@@ -749,14 +756,15 @@ object Build {
749
756
)
750
757
751
758
lazy val tastyCoreSettings = Seq (
752
- scalacOptions : = {
753
- val (language, other) = scalacOptions.value .partition(_.startsWith(" -language:" ))
759
+ scalacOptions ~ = { old =>
760
+ val (language, other) = old .partition(_.startsWith(" -language:" ))
754
761
other :+ (language.headOption.map(_ + " ,Scala2Compat" ).getOrElse(" -language:Scala2Compat" ))
755
762
}
756
763
)
757
764
758
765
lazy val `tasty-core` = project.in(file(" tasty" )).asTastyCore(NonBootstrapped )
759
766
lazy val `tasty-core-bootstrapped` : Project = project.in(file(" tasty" )).asTastyCore(Bootstrapped )
767
+ lazy val `tasty-core-scala2` : Project = project.in(file(" tasty" )).asTastyCoreScala2
760
768
761
769
def tastyCore (implicit mode : Mode ): Project = mode match {
762
770
case NonBootstrapped => `tasty-core`
@@ -1310,6 +1318,8 @@ object Build {
1310
1318
dependsOn(dottyLibrary).
1311
1319
settings(tastyCoreSettings)
1312
1320
1321
+ def asTastyCoreScala2 : Project = project.settings(commonScala2Settings)
1322
+
1313
1323
def asDottyDoc (implicit mode : Mode ): Project = project.withCommonSettings.
1314
1324
dependsOn(dottyCompiler, dottyCompiler % " test->test" ).
1315
1325
settings(dottyDocSettings)
0 commit comments