@@ -3199,7 +3199,7 @@ object Build {
31993199 }.value,
32003200
32013201 generateScalaDocumentation := Def .inputTaskDyn {
3202- val majorVersion = (LocalProject ( " scala3 -library-bootstrapped" ) / scalaBinaryVersion).value
3202+ val majorVersion = (`scala -library-bootstrapped` / scalaBinaryVersion).value
32033203
32043204 val extraArgs = spaceDelimited(" [<output-dir>] [--justAPI]" ).parsed
32053205 val outputDirOverride = extraArgs.headOption.fold(identity[GenerationConfig ](_))(newDir => {
@@ -3816,25 +3816,12 @@ object ScaladocConfigs {
38163816
38173817 def dottyExternalMapping = " .*scala/.*::scaladoc3::https://dotty.epfl.ch/api/"
38183818 def javaExternalMapping = " .*java/.*::javadoc::https://docs.oracle.com/javase/8/docs/api/"
3819- def scalaSrcLink (v : String , s : String ) = s " ${s}github://scala/scala/v $v#src/library "
3820- def dottySrcLink (v : String , sourcesPrefix : String = " " , outputPrefix : String = " " ) =
3821- sys.env.get(" GITHUB_SHA" ) match {
3822- case Some (sha) =>
3823- s " ${sourcesPrefix}github:// ${sys.env(" GITHUB_REPOSITORY" )}/ $sha$outputPrefix"
3824- case None => s " ${sourcesPrefix}github://scala/scala3/ $v$outputPrefix"
3819+ def defaultSourceLinks (version : String ) = {
3820+ def dottySrcLink (v : String ) = sys.env.get(" GITHUB_SHA" ) match {
3821+ case Some (sha) => s " github://scala/scala3/ $sha"
3822+ case None => s " github://scala/scala3/ $v"
38253823 }
3826-
3827- def defaultSourceLinks (version : String = dottyNonBootstrappedVersion, refVersion : String = dottyVersion) = Def .task {
3828- def stdLibVersion = stdlibVersion(NonBootstrapped )
3829- def srcManaged (v : String , s : String ) = s " out/bootstrap/scala2-library-bootstrapped/scala- $v/src_managed/main/ $s-library-src "
3830- SourceLinks (
3831- List (
3832- scalaSrcLink(stdLibVersion, srcManaged(version, " scala" ) + " =" ),
3833- dottySrcLink(refVersion, " library/src=" , " #library/src" ),
3834- dottySrcLink(refVersion),
3835- " docs=github://scala/scala3/main#docs"
3836- )
3837- )
3824+ SourceLinks (List (dottySrcLink(version), " docs=github://scala/scala3/main#docs" ))
38383825 }
38393826
38403827 lazy val DefaultGenerationSettings = Def .task {
@@ -3849,17 +3836,14 @@ object ScaladocConfigs {
38493836 def skipById = SkipById (List (
38503837 " scala.runtime.stdLibPatches" ,
38513838 " scala.runtime.MatchCase" ,
3852- " dotty.tools.tasty" ,
3853- " dotty.tools.tasty.util" ,
3854- " dotty.tools.tasty.besteffort"
38553839 ))
38563840 def projectFooter = ProjectFooter (s " Copyright (c) 2002- $currentYear, LAMP/EPFL " )
38573841 def defaultTemplate = DefaultTemplate (" static-site-main" )
38583842 GenerationConfig (
38593843 List (),
38603844 ProjectVersion (projectVersion),
38613845 GenerateInkuire (true ),
3862- defaultSourceLinks().value ,
3846+ defaultSourceLinks(version = dottyVersion) ,
38633847 skipByRegex,
38643848 skipById,
38653849 projectLogo,
@@ -3881,13 +3865,8 @@ object ScaladocConfigs {
38813865 )
38823866 }
38833867
3884- lazy val DefaultGenerationConfig = Def .task {
3885- def distLocation = (dist / Universal / stage).value
3886- DefaultGenerationSettings .value
3887- }
3888-
38893868 lazy val Scaladoc = Def .task {
3890- DefaultGenerationConfig .value
3869+ DefaultGenerationSettings .value
38913870 .add(UseJavacp (true ))
38923871 .add(ProjectName (" scaladoc" ))
38933872 .add(OutputDir (" scaladoc/output/self" ))
@@ -3898,7 +3877,7 @@ object ScaladocConfigs {
38983877
38993878 lazy val Testcases = Def .task {
39003879 val tastyRoots = (Test / Build .testcasesOutputDir).value
3901- DefaultGenerationConfig .value
3880+ DefaultGenerationSettings .value
39023881 .add(UseJavacp (true ))
39033882 .add(OutputDir (" scaladoc/output/testcases" ))
39043883 .add(ProjectName (" scaladoc testcases" ))
@@ -3914,56 +3893,35 @@ object ScaladocConfigs {
39143893 }
39153894
39163895 lazy val Scala3 = Def .task {
3917- val dottyJars : Seq [java.io.File ] = Seq (
3918- (`scala2-library-bootstrapped`/ Compile / products).value,
3919- (`scala3-library-bootstrapped`/ Compile / products).value,
3920- (`scala3-interfaces`/ Compile / products).value,
3921- (`tasty-core-bootstrapped`/ Compile / products).value,
3922- ).flatten
3923-
3924- val roots = dottyJars.map(_.getAbsolutePath)
3925-
3926- val managedSources =
3927- (`scala2-library-bootstrapped`/ Compile / sourceManaged).value / " scala-library-src"
3928- val projectRoot = (ThisBuild / baseDirectory).value.toPath
3929- val stdLibRoot = projectRoot.relativize(managedSources.toPath.normalize())
3930- val docRootFile = stdLibRoot.resolve(" rootdoc.txt" )
3931-
3932- val dottyManagesSources = (`scala3-library-bootstrapped`/ Compile / baseDirectory).value
3933-
3934- val tastyCoreSources = projectRoot.relativize((`tasty-core-bootstrapped`/ Compile / scalaSource).value.toPath().normalize())
3935-
3936- val dottyLibRoot = projectRoot.relativize(dottyManagesSources.toPath.normalize())
3937- DefaultGenerationConfig .value
3896+ DefaultGenerationSettings .value
39383897 .add(ProjectName (" Scala 3" ))
39393898 .add(OutputDir (file(" scaladoc/output/scala3" ).getAbsoluteFile.getAbsolutePath))
39403899 .add(Revision (" main" ))
39413900 .add(ExternalMappings (List (javaExternalMapping)))
3942- .add(DocRootContent (docRootFile .toString))
3901+ .add(DocRootContent (((`scala-library-bootstrapped` / baseDirectory).value / " src " / " rootdoc.txt " ) .toString))
39433902 .add(CommentSyntax (List (
3944- s " ${dottyLibRoot}=markdown " ,
3945- s " ${stdLibRoot}=wiki " ,
3946- s " ${tastyCoreSources}=markdown " ,
3903+ // s"${dottyLibRoot}=markdown",
3904+ // s"${stdLibRoot}=wiki",
39473905 " wiki"
39483906 )))
39493907 .add(VersionsDictionaryUrl (" https://scala-lang.org/api/versions.json" ))
39503908 .add(DocumentSyntheticTypes (true ))
3951- .add(SnippetCompiler (List (
3952- s " $dottyLibRoot/src/scala=compile " ,
3953- s " $dottyLibRoot/src/scala/compiletime=compile " ,
3954- s " $dottyLibRoot/src/scala/util=compile " ,
3955- s " $dottyLibRoot/src/scala/util/control=compile "
3956- )))
3909+ // .add(SnippetCompiler(List(
3910+ // s"$dottyLibRoot/src/scala=compile",
3911+ // s"$dottyLibRoot/src/scala/compiletime=compile",
3912+ // s"$dottyLibRoot/src/scala/util=compile",
3913+ // s"$dottyLibRoot/src/scala/util/control=compile"
3914+ // )))
39573915 .add(SiteRoot (" docs" ))
39583916 .add(ApiSubdirectory (true ))
3959- .withTargets(roots )
3917+ .withTargets((`scala-library-bootstrapped` / Compile / products).value.map(_.getAbsolutePath) )
39603918 }
39613919
39623920 def stableScala3 (version : String ) = Def .task {
39633921 val scalaLibrarySrc = s " out/bootstrap/scala2-library-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/src_managed "
39643922 val dottyLibrarySrc = " library/src"
39653923 Scala3 .value
3966- .add(defaultSourceLinks(version + " -bin-SNAPSHOT-nonbootstrapped " , version).value )
3924+ .add(defaultSourceLinks(version = version))
39673925 .add(ProjectVersion (version))
39683926 .add(SnippetCompiler (
39693927 List (
0 commit comments