@@ -926,59 +926,6 @@ object Build {
926
926
javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value
927
927
)
928
928
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
-
982
929
/** Scala 2 library compiled by dotty using the latest published sources of the library.
983
930
*
984
931
* This version of the library is not (yet) TASTy/binary compatible with the Scala 2 compiled library.
@@ -987,15 +934,7 @@ object Build {
987
934
withCommonSettings(Bootstrapped ).
988
935
dependsOn(dottyCompiler(Bootstrapped ) % " provided; compile->runtime; test->test" ).
989
936
settings(commonBootstrappedSettings).
990
- settings(stdlibBootstrappedCommonSettings).
991
937
settings(
992
- Compile / scalacOptions ++= {
993
- Seq (" -sourcepath" , ((Compile / sourceManaged).value / " scala-library-src" ).toString)
994
- },
995
- )
996
-
997
- lazy val stdlibBootstrappedCommonSettings =
998
- Seq (
999
938
moduleName := " scala-library" ,
1000
939
javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value,
1001
940
Compile / scalacOptions ++= {
@@ -2019,11 +1958,11 @@ object ScaladocConfigs {
2019
1958
2020
1959
def defaultSourceLinks (version : String = dottyNonBootstrappedVersion, refVersion : String = dottyVersion) = Def .task {
2021
1960
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 "
2023
1962
SourceLinks (
2024
1963
List (
2025
1964
scalaSrcLink(stdLibVersion, srcManaged(version, " scala" ) + " =" ),
2026
- dottySrcLink(refVersion, srcManaged(version, " dotty " ) + " =" , " #library/src" ),
1965
+ dottySrcLink(refVersion, " library/src =" , " #library/src" ),
2027
1966
dottySrcLink(refVersion),
2028
1967
" docs=github://lampepfl/dotty/main#docs"
2029
1968
)
@@ -2107,21 +2046,22 @@ object ScaladocConfigs {
2107
2046
2108
2047
lazy val Scala3 = Def .task {
2109
2048
val dottyJars : Seq [java.io.File ] = Seq (
2110
- (`stdlib-bootstrapped-legacy`/ Compile / products).value,
2049
+ (`stdlib-bootstrapped`/ Compile / products).value,
2050
+ (`scala3-library-bootstrapped`/ Compile / products).value,
2111
2051
(`scala3-interfaces`/ Compile / products).value,
2112
2052
(`tasty-core-bootstrapped`/ Compile / products).value,
2113
2053
).flatten
2114
2054
2115
2055
val roots = dottyJars.map(_.getAbsolutePath)
2116
2056
2117
2057
val managedSources =
2118
- (`stdlib-bootstrapped-legacy `/ Compile / sourceManaged).value / " scala-library-src"
2058
+ (`stdlib-bootstrapped`/ Compile / sourceManaged).value / " scala-library-src"
2119
2059
val projectRoot = (ThisBuild / baseDirectory).value.toPath
2120
2060
val stdLibRoot = projectRoot.relativize(managedSources.toPath.normalize())
2121
2061
val docRootFile = stdLibRoot.resolve(" rootdoc.txt" )
2122
2062
2123
2063
val dottyManagesSources =
2124
- (`stdlib-bootstrapped-legacy `/ Compile / sourceManaged ).value / " dotty-library-src "
2064
+ (`scala3-library-bootstrapped `/ Compile / sourceDirectory ).value
2125
2065
2126
2066
val tastyCoreSources = projectRoot.relativize((`tasty-core-bootstrapped`/ Compile / scalaSource).value.toPath().normalize())
2127
2067
@@ -2149,24 +2089,27 @@ object ScaladocConfigs {
2149
2089
}
2150
2090
2151
2091
def stableScala3 (version : String ) = Def .task {
2092
+ val scalaLibrarySrc = s " out/bootstrap/stdlib-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/src_managed "
2093
+ val dottyLibrarySrc = " library/src"
2152
2094
Scala3 .value
2153
2095
.add(defaultSourceLinks(version + " -bin-SNAPSHOT-nonbootstrapped" , version).value)
2154
2096
.add(ProjectVersion (version))
2155
2097
.add(SnippetCompiler (
2156
2098
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"
2099
+ s " $dottyLibrarySrc /scala/quoted=compile " ,
2100
+ s " $dottyLibrarySrc /scala/compiletime=compile "
2159
2101
)
2160
2102
))
2161
2103
.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" ,
2104
+ s " $dottyLibrarySrc =markdown " ,
2105
+ s " $scalaLibrarySrc =wiki " ,
2164
2106
" wiki"
2165
2107
)))
2166
- .add(DocRootContent (s " out/bootstrap/stdlib-bootstrapped-legacy/scala- $version -bin-SNAPSHOT-nonbootstrapped/src_managed/main/scala-library-src /rootdoc.txt" ))
2108
+ .add(DocRootContent (s " $scalaLibrarySrc /rootdoc.txt " ))
2167
2109
.withTargets(
2168
2110
Seq (
2169
- s " out/bootstrap/stdlib-bootstrapped-legacy/scala- $version-bin-SNAPSHOT-nonbootstrapped/classes " ,
2111
+ s " out/bootstrap/stdlib-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/classes " ,
2112
+ s " out/bootstrap/scala3-library-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/classes " ,
2170
2113
s " tmp/interfaces/target/classes " ,
2171
2114
s " out/bootstrap/tasty-core-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/classes "
2172
2115
)
0 commit comments