@@ -3116,7 +3116,7 @@ object Build {
3116
3116
}.value,
3117
3117
3118
3118
generateScalaDocumentation := Def .inputTaskDyn {
3119
- val majorVersion = (LocalProject ( " scala3 -library-bootstrapped" ) / scalaBinaryVersion).value
3119
+ val majorVersion = (`scala -library-bootstrapped` / scalaBinaryVersion).value
3120
3120
3121
3121
val extraArgs = spaceDelimited(" [<output-dir>] [--justAPI]" ).parsed
3122
3122
val outputDirOverride = extraArgs.headOption.fold(identity[GenerationConfig ](_))(newDir => {
@@ -3733,25 +3733,12 @@ object ScaladocConfigs {
3733
3733
3734
3734
def dottyExternalMapping = " .*scala/.*::scaladoc3::https://dotty.epfl.ch/api/"
3735
3735
def javaExternalMapping = " .*java/.*::javadoc::https://docs.oracle.com/javase/8/docs/api/"
3736
- def scalaSrcLink (v : String , s : String ) = s " ${s}github://scala/scala/v $v#src/library "
3737
- def dottySrcLink (v : String , sourcesPrefix : String = " " , outputPrefix : String = " " ) =
3738
- sys.env.get(" GITHUB_SHA" ) match {
3739
- case Some (sha) =>
3740
- s " ${sourcesPrefix}github:// ${sys.env(" GITHUB_REPOSITORY" )}/ $sha$outputPrefix"
3741
- case None => s " ${sourcesPrefix}github://scala/scala3/ $v$outputPrefix"
3736
+ def defaultSourceLinks (version : String ) = {
3737
+ def dottySrcLink (v : String ) = sys.env.get(" GITHUB_SHA" ) match {
3738
+ case Some (sha) => s " github://scala/scala3/ $sha"
3739
+ case None => s " github://scala/scala3/ $v"
3742
3740
}
3743
-
3744
- def defaultSourceLinks (version : String = dottyNonBootstrappedVersion, refVersion : String = dottyVersion) = Def .task {
3745
- def stdLibVersion = stdlibVersion(NonBootstrapped )
3746
- def srcManaged (v : String , s : String ) = s " out/bootstrap/scala2-library-bootstrapped/scala- $v/src_managed/main/ $s-library-src "
3747
- SourceLinks (
3748
- List (
3749
- scalaSrcLink(stdLibVersion, srcManaged(version, " scala" ) + " =" ),
3750
- dottySrcLink(refVersion, " library/src=" , " #library/src" ),
3751
- dottySrcLink(refVersion),
3752
- " docs=github://scala/scala3/main#docs"
3753
- )
3754
- )
3741
+ SourceLinks (List (dottySrcLink(version), " docs=github://scala/scala3/main#docs" ))
3755
3742
}
3756
3743
3757
3744
lazy val DefaultGenerationSettings = Def .task {
@@ -3766,17 +3753,14 @@ object ScaladocConfigs {
3766
3753
def skipById = SkipById (List (
3767
3754
" scala.runtime.stdLibPatches" ,
3768
3755
" scala.runtime.MatchCase" ,
3769
- " dotty.tools.tasty" ,
3770
- " dotty.tools.tasty.util" ,
3771
- " dotty.tools.tasty.besteffort"
3772
3756
))
3773
3757
def projectFooter = ProjectFooter (s " Copyright (c) 2002- $currentYear, LAMP/EPFL " )
3774
3758
def defaultTemplate = DefaultTemplate (" static-site-main" )
3775
3759
GenerationConfig (
3776
3760
List (),
3777
3761
ProjectVersion (projectVersion),
3778
3762
GenerateInkuire (true ),
3779
- defaultSourceLinks().value ,
3763
+ defaultSourceLinks(version = dottyVersion) ,
3780
3764
skipByRegex,
3781
3765
skipById,
3782
3766
projectLogo,
@@ -3798,13 +3782,8 @@ object ScaladocConfigs {
3798
3782
)
3799
3783
}
3800
3784
3801
- lazy val DefaultGenerationConfig = Def .task {
3802
- def distLocation = (dist / Universal / stage).value
3803
- DefaultGenerationSettings .value
3804
- }
3805
-
3806
3785
lazy val Scaladoc = Def .task {
3807
- DefaultGenerationConfig .value
3786
+ DefaultGenerationSettings .value
3808
3787
.add(UseJavacp (true ))
3809
3788
.add(ProjectName (" scaladoc" ))
3810
3789
.add(OutputDir (" scaladoc/output/self" ))
@@ -3815,7 +3794,7 @@ object ScaladocConfigs {
3815
3794
3816
3795
lazy val Testcases = Def .task {
3817
3796
val tastyRoots = (Test / Build .testcasesOutputDir).value
3818
- DefaultGenerationConfig .value
3797
+ DefaultGenerationSettings .value
3819
3798
.add(UseJavacp (true ))
3820
3799
.add(OutputDir (" scaladoc/output/testcases" ))
3821
3800
.add(ProjectName (" scaladoc testcases" ))
@@ -3831,56 +3810,35 @@ object ScaladocConfigs {
3831
3810
}
3832
3811
3833
3812
lazy val Scala3 = Def .task {
3834
- val dottyJars : Seq [java.io.File ] = Seq (
3835
- (`scala2-library-bootstrapped`/ Compile / products).value,
3836
- (`scala3-library-bootstrapped`/ Compile / products).value,
3837
- (`scala3-interfaces`/ Compile / products).value,
3838
- (`tasty-core-bootstrapped`/ Compile / products).value,
3839
- ).flatten
3840
-
3841
- val roots = dottyJars.map(_.getAbsolutePath)
3842
-
3843
- val managedSources =
3844
- (`scala2-library-bootstrapped`/ Compile / sourceManaged).value / " scala-library-src"
3845
- val projectRoot = (ThisBuild / baseDirectory).value.toPath
3846
- val stdLibRoot = projectRoot.relativize(managedSources.toPath.normalize())
3847
- val docRootFile = stdLibRoot.resolve(" rootdoc.txt" )
3848
-
3849
- val dottyManagesSources = (`scala3-library-bootstrapped`/ Compile / baseDirectory).value
3850
-
3851
- val tastyCoreSources = projectRoot.relativize((`tasty-core-bootstrapped`/ Compile / scalaSource).value.toPath().normalize())
3852
-
3853
- val dottyLibRoot = projectRoot.relativize(dottyManagesSources.toPath.normalize())
3854
- DefaultGenerationConfig .value
3813
+ DefaultGenerationSettings .value
3855
3814
.add(ProjectName (" Scala 3" ))
3856
3815
.add(OutputDir (file(" scaladoc/output/scala3" ).getAbsoluteFile.getAbsolutePath))
3857
3816
.add(Revision (" main" ))
3858
3817
.add(ExternalMappings (List (javaExternalMapping)))
3859
- .add(DocRootContent (docRootFile .toString))
3818
+ .add(DocRootContent (((`scala-library-bootstrapped` / baseDirectory).value / " src " / " rootdoc.txt " ) .toString))
3860
3819
.add(CommentSyntax (List (
3861
- s " ${dottyLibRoot}=markdown " ,
3862
- s " ${stdLibRoot}=wiki " ,
3863
- s " ${tastyCoreSources}=markdown " ,
3820
+ // s"${dottyLibRoot}=markdown",
3821
+ // s"${stdLibRoot}=wiki",
3864
3822
" wiki"
3865
3823
)))
3866
3824
.add(VersionsDictionaryUrl (" https://scala-lang.org/api/versions.json" ))
3867
3825
.add(DocumentSyntheticTypes (true ))
3868
- .add(SnippetCompiler (List (
3869
- s " $dottyLibRoot/src/scala=compile " ,
3870
- s " $dottyLibRoot/src/scala/compiletime=compile " ,
3871
- s " $dottyLibRoot/src/scala/util=compile " ,
3872
- s " $dottyLibRoot/src/scala/util/control=compile "
3873
- )))
3826
+ // .add(SnippetCompiler(List(
3827
+ // s"$dottyLibRoot/src/scala=compile",
3828
+ // s"$dottyLibRoot/src/scala/compiletime=compile",
3829
+ // s"$dottyLibRoot/src/scala/util=compile",
3830
+ // s"$dottyLibRoot/src/scala/util/control=compile"
3831
+ // )))
3874
3832
.add(SiteRoot (" docs" ))
3875
3833
.add(ApiSubdirectory (true ))
3876
- .withTargets(roots )
3834
+ .withTargets((`scala-library-bootstrapped` / Compile / products).value.map(_.getAbsolutePath) )
3877
3835
}
3878
3836
3879
3837
def stableScala3 (version : String ) = Def .task {
3880
3838
val scalaLibrarySrc = s " out/bootstrap/scala2-library-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/src_managed "
3881
3839
val dottyLibrarySrc = " library/src"
3882
3840
Scala3 .value
3883
- .add(defaultSourceLinks(version + " -bin-SNAPSHOT-nonbootstrapped " , version).value )
3841
+ .add(defaultSourceLinks(version = version))
3884
3842
.add(ProjectVersion (version))
3885
3843
.add(SnippetCompiler (
3886
3844
List (
0 commit comments