@@ -362,7 +362,6 @@ object Build {
362362 private lazy val dottydocClasspath = Def .task {
363363 val jars = (packageAll in `dotty-compiler`).value
364364 val dottyLib = jars(" dotty-library" )
365- val dottyInterfaces = jars(" dotty-interfaces" )
366365 val otherDeps = (dependencyClasspath in Compile ).value.map(_.data).mkString(File .pathSeparator)
367366 val externalDeps = externalCompilerClasspathTask.value
368367 dottyLib + File .pathSeparator + findArtifactPath(externalDeps, " scala-library" )
@@ -575,7 +574,8 @@ object Build {
575574 val dottyCompiler = jars(" dotty-compiler" )
576575 val dottyStaging = jars(" dotty-staging" )
577576 val dottyInterfaces = jars(" dotty-interfaces" )
578- run(insertClasspathInArgs(args1, List (dottyCompiler, dottyInterfaces, asm, dottyStaging).mkString(File .pathSeparator)))
577+ val tastyCore = jars(" tasty-core" )
578+ run(insertClasspathInArgs(args1, List (dottyCompiler, dottyInterfaces, asm, dottyStaging, tastyCore).mkString(File .pathSeparator)))
579579 } else run(args)
580580 },
581581
@@ -649,8 +649,9 @@ object Build {
649649 }
650650 val dottyInterfaces = jars(" dotty-interfaces" )
651651 val dottyStaging = jars(" dotty-staging" )
652+ val tastyCore = jars(" tasty-core" )
652653 val asm = findArtifactPath(externalDeps, " scala-asm" )
653- extraClasspath ++= Seq (dottyCompiler, dottyInterfaces, asm, dottyStaging)
654+ extraClasspath ++= Seq (dottyCompiler, dottyInterfaces, asm, dottyStaging, tastyCore )
654655 }
655656
656657 val fullArgs = main :: insertClasspathInArgs(args, extraClasspath.mkString(File .pathSeparator))
@@ -671,13 +672,13 @@ object Build {
671672 Map (
672673 " dotty-interfaces" -> packageBin.in(`dotty-interfaces`, Compile ).value,
673674 " dotty-compiler" -> packageBin.in(Compile ).value,
675+ " tasty-core" -> packageBin.in(`tasty-core`, Compile ).value,
674676
675677 // NOTE: Using dotty-library-bootstrapped here is intentional: when
676678 // running the compiler, we should always have the bootstrapped
677679 // library on the compiler classpath since the non-bootstrapped one
678680 // may not be binary-compatible.
679- " dotty-library" -> packageBin.in(`dotty-library-bootstrapped`, Compile ).value,
680- " tasty-core" -> packageBin.in(`tasty-core-bootstrapped`, Compile ).value,
681+ " dotty-library" -> packageBin.in(`dotty-library-bootstrapped`, Compile ).value
681682 ).mapValues(_.getAbsolutePath)
682683 }
683684 }.value,
@@ -700,6 +701,7 @@ object Build {
700701 packageAll.in(`dotty-compiler`).value ++ Seq (
701702 " dotty-compiler" -> packageBin.in(Compile ).value.getAbsolutePath,
702703 " dotty-staging" -> packageBin.in(LocalProject (" dotty-staging" ), Compile ).value.getAbsolutePath,
704+ " tasty-core" -> packageBin.in(LocalProject (" tasty-core-bootstrapped" ), Compile ).value.getAbsolutePath,
703705 )
704706 }
705707 )
@@ -729,11 +731,6 @@ object Build {
729731 case Bootstrapped => `dotty-library-bootstrapped`
730732 }
731733
732- def tastyCore (implicit mode : Mode ): Project = mode match {
733- case NonBootstrapped => `tasty-core`
734- case Bootstrapped => `tasty-core-bootstrapped`
735- }
736-
737734 /** The dotty standard library compiled with the Scala.js back-end, to produce
738735 * the corresponding .sjsir files.
739736 *
@@ -751,9 +748,21 @@ object Build {
751748 (unmanagedSourceDirectories in (`dotty-library-bootstrapped`, Compile )).value,
752749 )
753750
751+ lazy val tastyCoreSettings = Seq (
752+ scalacOptions := {
753+ val (language, other) = scalacOptions.value.partition(_.startsWith(" -language:" ))
754+ other :+ (language.headOption.map(_ + " ,Scala2Compat" ).getOrElse(" -language:Scala2Compat" ))
755+ }
756+ )
757+
754758 lazy val `tasty-core` = project.in(file(" tasty" )).asTastyCore(NonBootstrapped )
755759 lazy val `tasty-core-bootstrapped` : Project = project.in(file(" tasty" )).asTastyCore(Bootstrapped )
756760
761+ def tastyCore (implicit mode : Mode ): Project = mode match {
762+ case NonBootstrapped => `tasty-core`
763+ case Bootstrapped => `tasty-core-bootstrapped`
764+ }
765+
757766 lazy val `dotty-staging` = project.in(file(" staging" )).
758767 withCommonSettings(Bootstrapped ).
759768 // We want the compiler to be present in the compiler classpath when compiling this project but not
@@ -1298,7 +1307,8 @@ object Build {
12981307 settings(dottyLibrarySettings)
12991308
13001309 def asTastyCore (implicit mode : Mode ): Project = project.withCommonSettings.
1301- dependsOn(dottyLibrary)
1310+ dependsOn(dottyLibrary).
1311+ settings(tastyCoreSettings)
13021312
13031313 def asDottyDoc (implicit mode : Mode ): Project = project.withCommonSettings.
13041314 dependsOn(dottyCompiler, dottyCompiler % " test->test" ).
0 commit comments