@@ -2636,16 +2636,29 @@ object Build {
2636
2636
2637
2637
generateStableScala3Documentation := Def .inputTaskDyn {
2638
2638
val extraArgs = spaceDelimited(" <version>" ).parsed
2639
- val version = extraArgs.head
2639
+ val version = baseVersion
2640
+ // In the early days of scaladoc there was a practice to precompile artifacts of Scala 3 and generate docs using different version of scaladoc
2641
+ // It's no longer needed after its stablisation.
2642
+ // Allow to use explcit version check to detect using incorrect revision during release process
2643
+ extraArgs.headOption.foreach { explicitVersion =>
2644
+ assert(
2645
+ explicitVersion == version,
2646
+ s " Version of the build ( $version) does not match the explicit verion ( $explicitVersion) "
2647
+ )
2648
+ }
2640
2649
2641
2650
val docs = IO .createTemporaryDirectory
2642
2651
IO .copyDirectory(file(" docs" ), docs)
2643
2652
IO .delete(docs / " _blog" )
2644
2653
IO .move(docs / " sidebar.reference.yml" , docs / " sidebar.yml" )
2645
2654
2646
- val config = stableScala3(extraArgs.head)
2647
- .map {
2648
- _.add(SiteRoot (docs.getAbsolutePath))
2655
+ val config = Def .task {
2656
+ Scala3 .value
2657
+ .add(ProjectVersion (version))
2658
+ .add(Revision (version))
2659
+ .add(OutputDir (s " scaladoc/output/ ${version}" ))
2660
+ .add(SiteRoot (docs.getAbsolutePath))
2661
+ .remove[ApiSubdirectory ]
2649
2662
}
2650
2663
generateDocumentation(config)
2651
2664
}.evaluated,
@@ -3371,35 +3384,4 @@ object ScaladocConfigs {
3371
3384
.withTargets(roots)
3372
3385
}
3373
3386
3374
- def stableScala3 (version : String ) = Def .task {
3375
- val scalaLibrarySrc = s " out/bootstrap/scala2-library-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/src_managed "
3376
- val dottyLibrarySrc = " library/src"
3377
- Scala3 .value
3378
- .add(defaultSourceLinks(version + " -bin-SNAPSHOT-nonbootstrapped" , version).value)
3379
- .add(ProjectVersion (version))
3380
- .add(SnippetCompiler (
3381
- List (
3382
- s " $dottyLibrarySrc/scala/quoted=compile " ,
3383
- s " $dottyLibrarySrc/scala/compiletime=compile " ,
3384
- s " $dottyLibrarySrc/scala/util=compile " ,
3385
- s " $dottyLibrarySrc/scala/util/control=compile "
3386
- )
3387
- ))
3388
- .add(CommentSyntax (List (
3389
- s " $dottyLibrarySrc=markdown " ,
3390
- s " $scalaLibrarySrc=wiki " ,
3391
- " wiki"
3392
- )))
3393
- .add(DocRootContent (s " $scalaLibrarySrc/rootdoc.txt " ))
3394
- .withTargets(
3395
- Seq (
3396
- s " out/bootstrap/scala2-library-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/classes " ,
3397
- s " out/bootstrap/scala3-library-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/classes " ,
3398
- s " tmp/interfaces/target/classes " ,
3399
- s " out/bootstrap/tasty-core-bootstrapped/scala- $version-bin-SNAPSHOT-nonbootstrapped/classes "
3400
- )
3401
- )
3402
- .remove[SiteRoot ]
3403
- .remove[ApiSubdirectory ]
3404
- }
3405
3387
}
0 commit comments