@@ -1319,6 +1319,7 @@ object Build {
1319
1319
val generateSelfDocumentation = taskKey[Unit ](" Generate example documentation" )
1320
1320
// Note: the two tasks below should be one, but a bug in Tasty prevents that
1321
1321
val generateScalaDocumentation = inputKey[Unit ](" Generate documentation for dotty lib" )
1322
+ val generateStableScala3Documentation = inputKey[Unit ](" Generate documentation for stable dotty lib" )
1322
1323
val generateTestcasesDocumentation = taskKey[Unit ](" Generate documentation for testcases, usefull for debugging tests" )
1323
1324
1324
1325
val generateReferenceDocumentation = inputKey[Unit ](" Generate language reference documentation for Scala 3" )
@@ -1462,6 +1463,12 @@ object Build {
1462
1463
writeAdditionalFiles.dependsOn(generateDocumentation(config))
1463
1464
}.evaluated,
1464
1465
1466
+ generateStableScala3Documentation := Def .inputTaskDyn {
1467
+ val extraArgs = spaceDelimited(" <version>" ).parsed
1468
+ val config = stableScala3(extraArgs.head)
1469
+ generateDocumentation(config)
1470
+ }.evaluated,
1471
+
1465
1472
generateTestcasesDocumentation := Def .taskDyn {
1466
1473
generateDocumentation(Testcases )
1467
1474
}.value,
@@ -1857,22 +1864,22 @@ object ScaladocConfigs {
1857
1864
case None => s " ${sourcesPrefix}github://lampepfl/dotty/ $v$outputPrefix"
1858
1865
}
1859
1866
1860
- lazy val DefaultGenerationConfig = Def .task {
1861
- def distLocation = (dist / pack).value
1862
- def projectVersion = version.value
1867
+ def defaultSourceLinks (version : String = dottyNonBootstrappedVersion, refVersion : String = dottyVersion) = Def .task {
1863
1868
def stdLibVersion = stdlibVersion(NonBootstrapped )
1864
- def scalaLib = findArtifactPath(externalCompilerClasspathTask.value, " scala-library" )
1865
- def dottyLib = (`scala3-library` / Compile / classDirectory).value
1866
1869
def srcManaged (v : String , s : String ) = s " out/bootstrap/stdlib-bootstrapped/scala- $v/src_managed/main/ $s-library-src "
1867
-
1868
- def defaultSourceLinks : SourceLinks = SourceLinks (
1870
+ SourceLinks (
1869
1871
List (
1870
- scalaSrcLink(stdLibVersion, srcManaged(dottyNonBootstrappedVersion , " scala" ) + " =" ),
1871
- dottySrcLink(referenceVersion , srcManaged(dottyNonBootstrappedVersion , " dotty" ) + " =" , " #library/src" ),
1872
- dottySrcLink(referenceVersion ),
1872
+ scalaSrcLink(stdLibVersion, srcManaged(version , " scala" ) + " =" ),
1873
+ dottySrcLink(refVersion , srcManaged(version , " dotty" ) + " =" , " #library/src" ),
1874
+ dottySrcLink(refVersion ),
1873
1875
" docs=github://lampepfl/dotty/main#docs"
1874
1876
)
1875
1877
)
1878
+ }
1879
+
1880
+ lazy val DefaultGenerationConfig = Def .task {
1881
+ def distLocation = (dist / pack).value
1882
+ def projectVersion = version.value
1876
1883
def socialLinks = SocialLinks (List (
1877
1884
" github::https://github.com/lampepfl/dotty" ,
1878
1885
" discord::https://discord.com/invite/scala" ,
@@ -1890,7 +1897,7 @@ object ScaladocConfigs {
1890
1897
List (),
1891
1898
ProjectVersion (projectVersion),
1892
1899
GenerateInkuire (true ),
1893
- defaultSourceLinks,
1900
+ defaultSourceLinks().value ,
1894
1901
skipByRegex,
1895
1902
skipById,
1896
1903
projectLogo,
@@ -1981,4 +1988,31 @@ object ScaladocConfigs {
1981
1988
.add(ApiSubdirectory (true ))
1982
1989
.withTargets(roots)
1983
1990
}
1991
+
1992
+ def stableScala3 (version : String ) = Def .task {
1993
+ Scala3 .value
1994
+ .add(defaultSourceLinks(version + " -bin-SNAPSHOT-nonbootstrapped" , version).value)
1995
+ .add(ProjectVersion (version))
1996
+ .add(SnippetCompiler (
1997
+ List (
1998
+ s " out/bootstrap/stdlib-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/src_managed/main/dotty-library-src/scala/quoted=compile " ,
1999
+ s " out/bootstrap/stdlib-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/src_managed/main/dotty-library-src/scala/compiletime=compile "
2000
+ )
2001
+ ))
2002
+ .add(CommentSyntax (List (
2003
+ s " out/bootstrap/stdlib-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/src_managed/main/dotty-library-src=markdown " ,
2004
+ s " out/bootstrap/stdlib-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/src_managed/main/scala-library-src=wiki " ,
2005
+ " wiki"
2006
+ )))
2007
+ .add(DocRootContent (s " out/bootstrap/stdlib-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/src_managed/main/scala-library-src/rootdoc.txt " ))
2008
+ .withTargets(
2009
+ Seq (
2010
+ s " out/bootstrap/stdlib-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/classes " ,
2011
+ s " tmp/interfaces/target/classes " ,
2012
+ s " out/bootstrap/tasty-core-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/classes "
2013
+ )
2014
+ )
2015
+ .remove[SiteRoot ]
2016
+ .remove[ApiSubdirectory ]
2017
+ }
1984
2018
}
0 commit comments