@@ -271,7 +271,7 @@ object Build {
271
271
Keys .scalaSource, Keys .javaSource
272
272
),
273
273
274
- // This is used to download nightly builds of the Scala 2 library in `stdlib -bootstrapped`
274
+ // This is used to download nightly builds of the Scala 2 library in `scala2-library -bootstrapped`
275
275
resolvers += " scala-integration" at " https://scala-ci.typesafe.com/artifactory/scala-integration/" ,
276
276
)
277
277
@@ -723,22 +723,31 @@ object Build {
723
723
val externalDeps = externalCompilerClasspathTask.value
724
724
val jars = packageAll.value
725
725
val scalaLib = findArtifactPath(externalDeps, " scala-library" )
726
+ val scalaLibTastyOpt = jars.get(" scala2-library-tasty" )
726
727
val dottyLib = jars(" scala3-library" )
727
728
val dottyCompiler = jars(" scala3-compiler" )
728
729
val args0 : List [String ] = spaceDelimited(" <arg>" ).parsed.toList
729
730
val decompile = args0.contains(" -decompile" )
730
731
val printTasty = args0.contains(" -print-tasty" )
732
+ val useScala2LibraryTasty = args0.contains(" -Yscala2-library-tasty" )
731
733
val debugFromTasty = args0.contains(" -Ythrough-tasty" )
732
734
val args = args0.filter(arg => arg != " -repl" && arg != " -decompile" &&
733
- arg != " -with-compiler" && arg != " -Ythrough-tasty" && arg != " -print-tasty" )
734
-
735
+ arg != " -with-compiler" && arg != " -Ythrough-tasty" && arg != " -print-tasty"
736
+ && arg != " -Yscala2-library-tasty " )
735
737
val main =
736
738
if (decompile) " dotty.tools.dotc.decompiler.Main"
737
739
else if (printTasty) " dotty.tools.dotc.core.tasty.TastyPrinter"
738
740
else if (debugFromTasty) " dotty.tools.dotc.fromtasty.Debug"
739
741
else " dotty.tools.dotc.Main"
740
742
741
- var extraClasspath = Seq (scalaLib, dottyLib)
743
+ var extraClasspath =
744
+ scalaLibTastyOpt match {
745
+ case Some (scalaLibTasty) if useScala2LibraryTasty =>
746
+ Seq (scalaLibTasty, scalaLib, dottyLib)
747
+ case _ =>
748
+ if (useScala2LibraryTasty) log.error(" -Yscala2-library-tasty can only be used with a bootstrapped compiler" )
749
+ Seq (scalaLib, dottyLib)
750
+ }
742
751
743
752
if (decompile && ! args.contains(" -classpath" ))
744
753
extraClasspath ++= Seq (" ." )
@@ -848,6 +857,7 @@ object Build {
848
857
" scala3-staging" -> (LocalProject (" scala3-staging" ) / Compile / packageBin).value.getAbsolutePath,
849
858
" scala3-tasty-inspector" -> (LocalProject (" scala3-tasty-inspector" ) / Compile / packageBin).value.getAbsolutePath,
850
859
" tasty-core" -> (LocalProject (" tasty-core-bootstrapped" ) / Compile / packageBin).value.getAbsolutePath,
860
+ " scala2-library-tasty" -> (LocalProject (" scala2-library-tasty" ) / Compile / packageBin).value.getAbsolutePath,
851
861
)
852
862
},
853
863
@@ -972,7 +982,7 @@ object Build {
972
982
*
973
983
* This version of the library is not (yet) TASTy/binary compatible with the Scala 2 compiled library.
974
984
*/
975
- lazy val `stdlib- bootstrapped` = project.in(file(" stdlib -bootstrapped" )).
985
+ lazy val `scala2-library- bootstrapped` = project.in(file(" scala2-library -bootstrapped" )).
976
986
withCommonSettings(Bootstrapped ).
977
987
dependsOn(dottyCompiler(Bootstrapped ) % " provided; compile->runtime; test->test" ).
978
988
settings(commonBootstrappedSettings).
@@ -1061,7 +1071,7 @@ object Build {
1061
1071
| - final val MinorVersion = $minorVersion
1062
1072
| - final val ExperimentalVersion = 0
1063
1073
| * Clean everiting to generate a compiler with those new TASTy vesrions
1064
- | * Run stdlib -bootstrapped/tastyMiMaReportIssues
1074
+ | * Run scala2-library -bootstrapped/tastyMiMaReportIssues
1065
1075
| """ .stripMargin)
1066
1076
1067
1077
}).value,
@@ -1105,56 +1115,56 @@ object Build {
1105
1115
println(
1106
1116
s """ Usage:
1107
1117
|> $projectName/run list
1108
- | -- lists all files that are not overriden in stdlib -bootstrapped/src
1118
+ | -- lists all files that are not overriden in scala2-library -bootstrapped/src
1109
1119
|
1110
1120
|> $projectName/run clone <sources>*
1111
- | -- clones the specified sources from the stdlib -bootstrapped/src
1121
+ | -- clones the specified sources from the scala2-library -bootstrapped/src
1112
1122
| -- example: $projectName/run clone scala/Option.scala
1113
1123
|
1114
1124
|> $projectName/run overwrite <sources>*
1115
- | -- (danger) overwrites the specified sources from the stdlib -bootstrapped/src
1125
+ | -- (danger) overwrites the specified sources from the scala2-library -bootstrapped/src
1116
1126
| """ .stripMargin)
1117
1127
}
1118
1128
}
1119
1129
)
1120
1130
1121
- /** Packages the TASTy files of `stdlib -bootstrapped` in a jar */
1122
- lazy val `stdlib-bootstrapped -tasty` = project.in(file(" stdlib-bootstrapped -tasty" )).
1131
+ /** Packages the TASTy files of `scala2-library -bootstrapped` in a jar */
1132
+ lazy val `scala2-library -tasty` = project.in(file(" scala2-library -tasty" )).
1123
1133
withCommonSettings(Bootstrapped ).
1124
1134
settings(
1125
1135
exportJars := true ,
1126
1136
Compile / packageBin / mappings := {
1127
- (`stdlib -bootstrapped` / Compile / packageBin / mappings).value
1137
+ (`scala2-library -bootstrapped` / Compile / packageBin / mappings).value
1128
1138
.filter(_._2.endsWith(" .tasty" ))
1129
1139
},
1130
1140
)
1131
1141
1132
- /** Test the tasty generated by `stdlib -bootstrapped`
1142
+ /** Test the tasty generated by `scala2-library -bootstrapped`
1133
1143
*
1134
- * The sources in src are compiled using TASTy from stdlib-bootstrapped -tasty but then run
1144
+ * The sources in src are compiled using TASTy from scala2-library -tasty but then run
1135
1145
* with the scala-library compiled be Scala 2.
1136
1146
*
1137
1147
* The tests are run with the bootstrapped compiler and the tasty inpector on the classpath.
1138
- * The classpath has the default `scala-library` and not `stdlib -bootstrapped`.
1148
+ * The classpath has the default `scala-library` and not `scala2-library -bootstrapped`.
1139
1149
*
1140
- * The jar of `stdlib -bootstrapped` is provided for to the tests.
1150
+ * The jar of `scala2-library -bootstrapped` is provided for to the tests.
1141
1151
* - inspector: test that we can load the contents of the jar using the tasty inspector
1142
1152
* - from-tasty: test that we can recompile the contents of the jar using `dotc -from-tasty`
1143
1153
*/
1144
- lazy val `stdlib-bootstrapped -tasty-tests` = project.in(file(" stdlib-bootstrapped -tasty-tests" )).
1154
+ lazy val `scala2-library -tasty-tests` = project.in(file(" scala2-library -tasty-tests" )).
1145
1155
withCommonSettings(Bootstrapped ).
1146
1156
dependsOn(dottyCompiler(Bootstrapped ) % " compile->compile" ).
1147
1157
dependsOn(`scala3-tasty-inspector` % " test->test" ).
1148
- dependsOn(`stdlib-bootstrapped -tasty`).
1158
+ dependsOn(`scala2-library -tasty`).
1149
1159
settings(commonBootstrappedSettings).
1150
1160
settings(
1151
1161
javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value,
1152
- Test / javaOptions += " -Ddotty.scala.library=" + (`stdlib -bootstrapped` / Compile / packageBin).value.getAbsolutePath,
1162
+ Test / javaOptions += " -Ddotty.scala.library=" + (`scala2-library -bootstrapped` / Compile / packageBin).value.getAbsolutePath,
1153
1163
Compile / compile / fullClasspath ~= {
1154
1164
_.filterNot(file => file.data.getName == s " scala-library- $stdlibBootstrappedVersion.jar " )
1155
1165
},
1156
1166
Compile / compile / dependencyClasspath := {
1157
- // make sure that the scala2-library (tasty of `stdlib-bootstrapped -tasty`) is listed before the scala-library (classfiles)
1167
+ // make sure that the scala2-library (tasty of `scala2-library -tasty`) is listed before the scala-library (classfiles)
1158
1168
val (bootstrappedLib, otherLibs) =
1159
1169
(Compile / compile / dependencyClasspath).value
1160
1170
.partition(_.data.getName == s " scala2-library- ${dottyVersion}.jar " )
@@ -2106,7 +2116,7 @@ object ScaladocConfigs {
2106
2116
2107
2117
def defaultSourceLinks (version : String = dottyNonBootstrappedVersion, refVersion : String = dottyVersion) = Def .task {
2108
2118
def stdLibVersion = stdlibVersion(NonBootstrapped )
2109
- def srcManaged (v : String , s : String ) = s " out/bootstrap/stdlib -bootstrapped/scala- $v/src_managed/main/ $s-library-src "
2119
+ def srcManaged (v : String , s : String ) = s " out/bootstrap/scala2-library -bootstrapped/scala- $v/src_managed/main/ $s-library-src "
2110
2120
SourceLinks (
2111
2121
List (
2112
2122
scalaSrcLink(stdLibVersion, srcManaged(version, " scala" ) + " =" ),
@@ -2194,7 +2204,7 @@ object ScaladocConfigs {
2194
2204
2195
2205
lazy val Scala3 = Def .task {
2196
2206
val dottyJars : Seq [java.io.File ] = Seq (
2197
- (`stdlib -bootstrapped`/ Compile / products).value,
2207
+ (`scala2-library -bootstrapped`/ Compile / products).value,
2198
2208
(`scala3-library-bootstrapped`/ Compile / products).value,
2199
2209
(`scala3-interfaces`/ Compile / products).value,
2200
2210
(`tasty-core-bootstrapped`/ Compile / products).value,
@@ -2203,7 +2213,7 @@ object ScaladocConfigs {
2203
2213
val roots = dottyJars.map(_.getAbsolutePath)
2204
2214
2205
2215
val managedSources =
2206
- (`stdlib -bootstrapped`/ Compile / sourceManaged).value / " scala-library-src"
2216
+ (`scala2-library -bootstrapped`/ Compile / sourceManaged).value / " scala-library-src"
2207
2217
val projectRoot = (ThisBuild / baseDirectory).value.toPath
2208
2218
val stdLibRoot = projectRoot.relativize(managedSources.toPath.normalize())
2209
2219
val docRootFile = stdLibRoot.resolve(" rootdoc.txt" )
@@ -2236,7 +2246,7 @@ object ScaladocConfigs {
2236
2246
}
2237
2247
2238
2248
def stableScala3 (version : String ) = Def .task {
2239
- val scalaLibrarySrc = s " out/bootstrap/stdlib -bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/src_managed "
2249
+ val scalaLibrarySrc = s " out/bootstrap/scala2-library -bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/src_managed "
2240
2250
val dottyLibrarySrc = " library/src"
2241
2251
Scala3 .value
2242
2252
.add(defaultSourceLinks(version + " -bin-SNAPSHOT-nonbootstrapped" , version).value)
@@ -2255,7 +2265,7 @@ object ScaladocConfigs {
2255
2265
.add(DocRootContent (s " $scalaLibrarySrc/rootdoc.txt " ))
2256
2266
.withTargets(
2257
2267
Seq (
2258
- s " out/bootstrap/stdlib -bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/classes " ,
2268
+ s " out/bootstrap/scala2-library -bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/classes " ,
2259
2269
s " out/bootstrap/scala3-library-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/classes " ,
2260
2270
s " tmp/interfaces/target/classes " ,
2261
2271
s " out/bootstrap/tasty-core-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/classes "
0 commit comments