@@ -252,6 +252,13 @@ object Build {
252252 autoScalaLibrary := false
253253 )
254254
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+
255262 // Settings used when compiling dotty with the reference compiler
256263 lazy val commonNonBootstrappedSettings = commonDottySettings ++ Seq (
257264 unmanagedSourceDirectories in Compile += baseDirectory.value / " src-non-bootstrapped" ,
@@ -749,14 +756,15 @@ object Build {
749756 )
750757
751758 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:" ))
754761 other :+ (language.headOption.map(_ + " ,Scala2Compat" ).getOrElse(" -language:Scala2Compat" ))
755762 }
756763 )
757764
758765 lazy val `tasty-core` = project.in(file(" tasty" )).asTastyCore(NonBootstrapped )
759766 lazy val `tasty-core-bootstrapped` : Project = project.in(file(" tasty" )).asTastyCore(Bootstrapped )
767+ lazy val `tasty-core-scala2` : Project = project.in(file(" tasty" )).asTastyCoreScala2
760768
761769 def tastyCore (implicit mode : Mode ): Project = mode match {
762770 case NonBootstrapped => `tasty-core`
@@ -1310,6 +1318,8 @@ object Build {
13101318 dependsOn(dottyLibrary).
13111319 settings(tastyCoreSettings)
13121320
1321+ def asTastyCoreScala2 : Project = project.settings(commonScala2Settings)
1322+
13131323 def asDottyDoc (implicit mode : Mode ): Project = project.withCommonSettings.
13141324 dependsOn(dottyCompiler, dottyCompiler % " test->test" ).
13151325 settings(dottyDocSettings)
0 commit comments