Skip to content

Commit 52c1bf2

Browse files
committed
Revert "Create legacy Scala 2/3 stdlib TASTy"
This reverts commit 2faf77b.
1 parent f3787eb commit 52c1bf2

File tree

2 files changed

+10
-72
lines changed

2 files changed

+10
-72
lines changed

build.sbt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ val `scala3-language-server` = Build.`scala3-language-server`
1414
val `scala3-bench` = Build.`scala3-bench`
1515
val `scala3-bench-bootstrapped` = Build.`scala3-bench-bootstrapped`
1616
val `scala3-bench-micro` = Build.`scala3-bench-micro`
17-
val `stdlib-bootstrapped-legacy` = Build.`stdlib-bootstrapped-legacy`
1817
val `stdlib-bootstrapped` = Build.`stdlib-bootstrapped`
1918
val `stdlib-bootstrapped-tasty-tests` = Build.`stdlib-bootstrapped-tasty-tests`
2019
val `tasty-core` = Build.`tasty-core`

project/Build.scala

Lines changed: 10 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -926,59 +926,6 @@ object Build {
926926
javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value
927927
)
928928

929-
/** Version of stdlib-bootstrapped that compiles both Scala 2 and Scala 3 libraries
930-
* This is only used as a temporary solution until the docs can be generated using
931-
* stdlib-bootstrapped and scala3-library-bootstrapped.
932-
*/
933-
lazy val `stdlib-bootstrapped-legacy` = project.in(file("stdlib-bootstrapped-legacy")).
934-
withCommonSettings(Bootstrapped).
935-
dependsOn(dottyCompiler(Bootstrapped) % "provided; compile->runtime; test->test").
936-
settings(commonBootstrappedSettings).
937-
settings(stdlibBootstrappedCommonSettings).
938-
settings(
939-
scalacOptions -= "-Yscala2-stdlib",
940-
Compile/scalacOptions ++= {
941-
Seq(
942-
"-sourcepath",
943-
Seq(
944-
(Compile/sourceManaged).value / "scala-library-src",
945-
(Compile/sourceManaged).value / "dotty-library-src",
946-
).mkString(File.pathSeparator),
947-
)
948-
},
949-
(Compile / sourceGenerators) += Def.task {
950-
val s = streams.value
951-
val cacheDir = s.cacheDirectory
952-
val trgDir = (Compile / sourceManaged).value / "dotty-library-src"
953-
954-
// NOTE `sourceDirectory` is used for actual copying,
955-
// but `sources` are used as cache keys
956-
val dottyLibSourceDirs = (`scala3-library-bootstrapped`/Compile/unmanagedSourceDirectories).value
957-
def dottyLibSources = dottyLibSourceDirs.foldLeft(PathFinder.empty) { (pf, dir) =>
958-
if (!dir.exists) pf else pf +++ (dir ** "*.scala") +++ (dir ** "*.java")
959-
}
960-
961-
val cachedFun = FileFunction.cached(
962-
cacheDir / s"copyDottyLibrarySrc",
963-
FilesInfo.lastModified,
964-
FilesInfo.exists,
965-
) { _ =>
966-
if (trgDir.exists) IO.delete(trgDir)
967-
dottyLibSourceDirs.foreach { dir =>
968-
if (dir.exists) {
969-
s.log.info(s"Copying scala3-library sources from $dir to $trgDir...")
970-
IO.copyDirectory(dir, trgDir)
971-
}
972-
}
973-
974-
((trgDir ** "*.scala") +++ (trgDir ** "*.java")).get.toSet
975-
}
976-
977-
cachedFun(dottyLibSources.get.toSet).toSeq
978-
}.taskValue,
979-
mimaCheckDirection := "none",
980-
)
981-
982929
/** Scala 2 library compiled by dotty using the latest published sources of the library.
983930
*
984931
* This version of the library is not (yet) TASTy/binary compatible with the Scala 2 compiled library.
@@ -987,15 +934,7 @@ object Build {
987934
withCommonSettings(Bootstrapped).
988935
dependsOn(dottyCompiler(Bootstrapped) % "provided; compile->runtime; test->test").
989936
settings(commonBootstrappedSettings).
990-
settings(stdlibBootstrappedCommonSettings).
991937
settings(
992-
Compile / scalacOptions ++= {
993-
Seq("-sourcepath", ((Compile/sourceManaged).value / "scala-library-src").toString)
994-
},
995-
)
996-
997-
lazy val stdlibBootstrappedCommonSettings =
998-
Seq(
999938
moduleName := "scala-library",
1000939
javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value,
1001940
Compile / scalacOptions ++= {
@@ -2019,7 +1958,7 @@ object ScaladocConfigs {
20191958

20201959
def defaultSourceLinks(version: String = dottyNonBootstrappedVersion, refVersion: String = dottyVersion) = Def.task {
20211960
def stdLibVersion = stdlibVersion(NonBootstrapped)
2022-
def srcManaged(v: String, s: String) = s"out/bootstrap/stdlib-bootstrapped-legacy/scala-$v/src_managed/main/$s-library-src"
1961+
def srcManaged(v: String, s: String) = s"out/bootstrap/stdlib-bootstrapped/scala-$v/src_managed/main/$s-library-src"
20231962
SourceLinks(
20241963
List(
20251964
scalaSrcLink(stdLibVersion, srcManaged(version, "scala") + "="),
@@ -2107,21 +2046,21 @@ object ScaladocConfigs {
21072046

21082047
lazy val Scala3 = Def.task {
21092048
val dottyJars: Seq[java.io.File] = Seq(
2110-
(`stdlib-bootstrapped-legacy`/Compile/products).value,
2049+
(`stdlib-bootstrapped`/Compile/products).value,
21112050
(`scala3-interfaces`/Compile/products).value,
21122051
(`tasty-core-bootstrapped`/Compile/products).value,
21132052
).flatten
21142053

21152054
val roots = dottyJars.map(_.getAbsolutePath)
21162055

21172056
val managedSources =
2118-
(`stdlib-bootstrapped-legacy`/Compile/sourceManaged).value / "scala-library-src"
2057+
(`stdlib-bootstrapped`/Compile/sourceManaged).value / "scala-library-src"
21192058
val projectRoot = (ThisBuild/baseDirectory).value.toPath
21202059
val stdLibRoot = projectRoot.relativize(managedSources.toPath.normalize())
21212060
val docRootFile = stdLibRoot.resolve("rootdoc.txt")
21222061

21232062
val dottyManagesSources =
2124-
(`stdlib-bootstrapped-legacy`/Compile/sourceManaged).value / "dotty-library-src"
2063+
(`stdlib-bootstrapped`/Compile/sourceManaged).value / "dotty-library-src"
21252064

21262065
val tastyCoreSources = projectRoot.relativize((`tasty-core-bootstrapped`/Compile/scalaSource).value.toPath().normalize())
21272066

@@ -2154,19 +2093,19 @@ object ScaladocConfigs {
21542093
.add(ProjectVersion(version))
21552094
.add(SnippetCompiler(
21562095
List(
2157-
s"out/bootstrap/stdlib-bootstrapped-legacy/scala-$version-bin-SNAPSHOT-nonbootstrapped/src_managed/main/dotty-library-src/scala/quoted=compile",
2158-
s"out/bootstrap/stdlib-bootstrapped-legacy/scala-$version-bin-SNAPSHOT-nonbootstrapped/src_managed/main/dotty-library-src/scala/compiletime=compile"
2096+
s"out/bootstrap/stdlib-bootstrapped/scala-$version-bin-SNAPSHOT-nonbootstrapped/src_managed/main/dotty-library-src/scala/quoted=compile",
2097+
s"out/bootstrap/stdlib-bootstrapped/scala-$version-bin-SNAPSHOT-nonbootstrapped/src_managed/main/dotty-library-src/scala/compiletime=compile"
21592098
)
21602099
))
21612100
.add(CommentSyntax(List(
2162-
s"out/bootstrap/stdlib-bootstrapped-legacy/scala-$version-bin-SNAPSHOT-nonbootstrapped/src_managed/main/dotty-library-src=markdown",
2163-
s"out/bootstrap/stdlib-bootstrapped-legacy/scala-$version-bin-SNAPSHOT-nonbootstrapped/src_managed/main/scala-library-src=wiki",
2101+
s"out/bootstrap/stdlib-bootstrapped/scala-$version-bin-SNAPSHOT-nonbootstrapped/src_managed/main/dotty-library-src=markdown",
2102+
s"out/bootstrap/stdlib-bootstrapped/scala-$version-bin-SNAPSHOT-nonbootstrapped/src_managed/main/scala-library-src=wiki",
21642103
"wiki"
21652104
)))
2166-
.add(DocRootContent(s"out/bootstrap/stdlib-bootstrapped-legacy/scala-$version-bin-SNAPSHOT-nonbootstrapped/src_managed/main/scala-library-src/rootdoc.txt"))
2105+
.add(DocRootContent(s"out/bootstrap/stdlib-bootstrapped/scala-$version-bin-SNAPSHOT-nonbootstrapped/src_managed/main/scala-library-src/rootdoc.txt"))
21672106
.withTargets(
21682107
Seq(
2169-
s"out/bootstrap/stdlib-bootstrapped-legacy/scala-$version-bin-SNAPSHOT-nonbootstrapped/classes",
2108+
s"out/bootstrap/stdlib-bootstrapped/scala-$version-bin-SNAPSHOT-nonbootstrapped/classes",
21702109
s"tmp/interfaces/target/classes",
21712110
s"out/bootstrap/tasty-core-bootstrapped/scala-$version-bin-SNAPSHOT-nonbootstrapped/classes"
21722111
)

0 commit comments

Comments
 (0)