@@ -362,7 +362,6 @@ object Build {
362
362
private lazy val dottydocClasspath = Def .task {
363
363
val jars = (packageAll in `dotty-compiler`).value
364
364
val dottyLib = jars(" dotty-library" )
365
- val dottyInterfaces = jars(" dotty-interfaces" )
366
365
val otherDeps = (dependencyClasspath in Compile ).value.map(_.data).mkString(File .pathSeparator)
367
366
val externalDeps = externalCompilerClasspathTask.value
368
367
dottyLib + File .pathSeparator + findArtifactPath(externalDeps, " scala-library" )
@@ -575,7 +574,8 @@ object Build {
575
574
val dottyCompiler = jars(" dotty-compiler" )
576
575
val dottyStaging = jars(" dotty-staging" )
577
576
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)))
579
579
} else run(args)
580
580
},
581
581
@@ -649,8 +649,9 @@ object Build {
649
649
}
650
650
val dottyInterfaces = jars(" dotty-interfaces" )
651
651
val dottyStaging = jars(" dotty-staging" )
652
+ val tastyCore = jars(" tasty-core" )
652
653
val asm = findArtifactPath(externalDeps, " scala-asm" )
653
- extraClasspath ++= Seq (dottyCompiler, dottyInterfaces, asm, dottyStaging)
654
+ extraClasspath ++= Seq (dottyCompiler, dottyInterfaces, asm, dottyStaging, tastyCore )
654
655
}
655
656
656
657
val fullArgs = main :: insertClasspathInArgs(args, extraClasspath.mkString(File .pathSeparator))
@@ -671,13 +672,13 @@ object Build {
671
672
Map (
672
673
" dotty-interfaces" -> packageBin.in(`dotty-interfaces`, Compile ).value,
673
674
" dotty-compiler" -> packageBin.in(Compile ).value,
675
+ " tasty-core" -> packageBin.in(`tasty-core`, Compile ).value,
674
676
675
677
// NOTE: Using dotty-library-bootstrapped here is intentional: when
676
678
// running the compiler, we should always have the bootstrapped
677
679
// library on the compiler classpath since the non-bootstrapped one
678
680
// 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
681
682
).mapValues(_.getAbsolutePath)
682
683
}
683
684
}.value,
@@ -700,6 +701,7 @@ object Build {
700
701
packageAll.in(`dotty-compiler`).value ++ Seq (
701
702
" dotty-compiler" -> packageBin.in(Compile ).value.getAbsolutePath,
702
703
" dotty-staging" -> packageBin.in(LocalProject (" dotty-staging" ), Compile ).value.getAbsolutePath,
704
+ " tasty-core" -> packageBin.in(LocalProject (" tasty-core-bootstrapped" ), Compile ).value.getAbsolutePath,
703
705
)
704
706
}
705
707
)
@@ -729,11 +731,6 @@ object Build {
729
731
case Bootstrapped => `dotty-library-bootstrapped`
730
732
}
731
733
732
- def tastyCore (implicit mode : Mode ): Project = mode match {
733
- case NonBootstrapped => `tasty-core`
734
- case Bootstrapped => `tasty-core-bootstrapped`
735
- }
736
-
737
734
/** The dotty standard library compiled with the Scala.js back-end, to produce
738
735
* the corresponding .sjsir files.
739
736
*
@@ -751,9 +748,21 @@ object Build {
751
748
(unmanagedSourceDirectories in (`dotty-library-bootstrapped`, Compile )).value,
752
749
)
753
750
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
+
754
758
lazy val `tasty-core` = project.in(file(" tasty" )).asTastyCore(NonBootstrapped )
755
759
lazy val `tasty-core-bootstrapped` : Project = project.in(file(" tasty" )).asTastyCore(Bootstrapped )
756
760
761
+ def tastyCore (implicit mode : Mode ): Project = mode match {
762
+ case NonBootstrapped => `tasty-core`
763
+ case Bootstrapped => `tasty-core-bootstrapped`
764
+ }
765
+
757
766
lazy val `dotty-staging` = project.in(file(" staging" )).
758
767
withCommonSettings(Bootstrapped ).
759
768
// We want the compiler to be present in the compiler classpath when compiling this project but not
@@ -1298,7 +1307,8 @@ object Build {
1298
1307
settings(dottyLibrarySettings)
1299
1308
1300
1309
def asTastyCore (implicit mode : Mode ): Project = project.withCommonSettings.
1301
- dependsOn(dottyLibrary)
1310
+ dependsOn(dottyLibrary).
1311
+ settings(tastyCoreSettings)
1302
1312
1303
1313
def asDottyDoc (implicit mode : Mode ): Project = project.withCommonSettings.
1304
1314
dependsOn(dottyCompiler, dottyCompiler % " test->test" ).
0 commit comments