@@ -922,23 +922,19 @@ object Build {
922
922
javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value
923
923
)
924
924
925
- /** Scala library compiled by dotty using the latest published sources of the library */
925
+ /** Scala 2 library compiled by dotty using the latest published sources of the library.
926
+ *
927
+ * This version of the library is not (yet) TASTy/binary compatible with the Scala 2 compiled library.
928
+ */
926
929
lazy val `stdlib-bootstrapped` = project.in(file(" stdlib-bootstrapped" )).
927
930
withCommonSettings(Bootstrapped ).
928
931
dependsOn(dottyCompiler(Bootstrapped ) % " provided; compile->runtime; test->test" ).
929
932
settings(commonBootstrappedSettings).
930
933
settings(
931
934
moduleName := " scala-library" ,
932
935
javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value,
933
- Compile / scalacOptions += " -Yerased-terms" ,
934
- Compile / scalacOptions ++= {
935
- Seq (
936
- " -sourcepath" ,
937
- Seq (
938
- (Compile / sourceManaged).value / " scala-library-src" ,
939
- (Compile / sourceManaged).value / " dotty-library-src" ,
940
- ).mkString(File .pathSeparator),
941
- )
936
+ Compile / scalacOptions ++= {
937
+ Seq (" -sourcepath" , ((Compile / sourceManaged).value / " scala-library-src" ).toString)
942
938
},
943
939
Compile / doc / scalacOptions += " -Ydocument-synthetic-types" ,
944
940
scalacOptions -= " -Xfatal-warnings" ,
@@ -970,36 +966,6 @@ object Build {
970
966
((trgDir ** " *.scala" ) +++ (trgDir ** " *.java" )).get.toSet
971
967
} (Set (scalaLibrarySourcesJar)).toSeq
972
968
}.taskValue,
973
- (Compile / sourceGenerators) += Def .task {
974
- val s = streams.value
975
- val cacheDir = s.cacheDirectory
976
- val trgDir = (Compile / sourceManaged).value / " dotty-library-src"
977
-
978
- // NOTE `sourceDirectory` is used for actual copying,
979
- // but `sources` are used as cache keys
980
- val dottyLibSourceDirs = (`scala3-library-bootstrapped`/ Compile / unmanagedSourceDirectories).value
981
- def dottyLibSources = dottyLibSourceDirs.foldLeft(PathFinder .empty) { (pf, dir) =>
982
- if (! dir.exists) pf else pf +++ (dir ** " *.scala" ) +++ (dir ** " *.java" )
983
- }
984
-
985
- val cachedFun = FileFunction .cached(
986
- cacheDir / s " copyDottyLibrarySrc " ,
987
- FilesInfo .lastModified,
988
- FilesInfo .exists,
989
- ) { _ =>
990
- if (trgDir.exists) IO .delete(trgDir)
991
- dottyLibSourceDirs.foreach { dir =>
992
- if (dir.exists) {
993
- s.log.info(s " Copying scala3-library sources from $dir to $trgDir... " )
994
- IO .copyDirectory(dir, trgDir)
995
- }
996
- }
997
-
998
- ((trgDir ** " *.scala" ) +++ (trgDir ** " *.java" )).get.toSet
999
- }
1000
-
1001
- cachedFun(dottyLibSources.get.toSet).toSeq
1002
- }.taskValue,
1003
969
(Compile / sources) ~= (_.filterNot(file =>
1004
970
// sources from https://github.com/scala/scala/tree/2.13.x/src/library-aux
1005
971
file.getPath.endsWith(" scala-library-src/scala/Any.scala" ) ||
@@ -1011,7 +977,7 @@ object Build {
1011
977
(Test / managedClasspath) ~= {
1012
978
_.filterNot(file => file.data.getName == s " scala-library- ${stdlibVersion(Bootstrapped )}.jar " )
1013
979
},
1014
- )
980
+ )
1015
981
1016
982
/** Test the tasty generated by `stdlib-bootstrapped`
1017
983
*
0 commit comments