@@ -1496,20 +1496,23 @@ object Build {
1496
1496
}
1497
1497
1498
1498
def asScaladoc : Project = {
1499
- def generateDocumentation (targets : String , name : String , outDir : String , ref : String , params : String = " " ) = Def .taskDyn {
1499
+ def generateDocumentation (targets : Seq [String ], name : String , outDir : String , ref : String , params : Seq [String ] = Nil ) =
1500
+ Def .taskDyn {
1501
+ val distLocation = pack.in(dist).value
1500
1502
val projectVersion = version.value
1501
1503
IO .createDirectory(file(outDir))
1502
1504
val scala3version = stdlibVersion(Bootstrapped )
1503
1505
// TODO add versions etc.
1504
1506
val srcManaged = s " out/bootstrap/stdlib-bootstrapped/scala- $baseVersion/src_managed/main/scala-library-src "
1505
- val sourceLinks = s " -source-links: $srcManaged=github://scala/scala/v $scala3version#src/library -source-links:github://lampepfl/dotty "
1506
- val revision = s " -revision $ref -project-version $projectVersion"
1507
- val cmd = s """ -d $outDir -project " $name" $sourceLinks $revision $params $targets"""
1508
- run.in(Compile ).toTask(cmd)
1509
- }
1507
+ val sourceLinks = s " -source-links: $srcManaged=github://scala/scala/v $scala3version#src/library-source-links:github://lampepfl/dotty "
1508
+ val revision = Seq (" -revision" , ref, " -project-version" , projectVersion)
1509
+ val cmd = Seq (" -d" , outDir, " -project" , name, sourceLinks) ++ revision ++ params ++ targets
1510
+ import _root_ .scala .sys .process ._
1511
+ Def .task((s " $distLocation/bin/scaladoc " +: cmd).! )
1512
+ }
1510
1513
1511
1514
def joinProducts (products : Seq [java.io.File ]): String =
1512
- products.iterator.map(_.getAbsolutePath.toString ).mkString(" " )
1515
+ products.iterator.map(_.getAbsolutePath).map(p => s " ' $p ' " ).mkString(" " )
1513
1516
1514
1517
val flexmarkVersion = " 0.42.12"
1515
1518
@@ -1520,12 +1523,16 @@ object Build {
1520
1523
baseDirectory.in(run) := baseDirectory.in(ThisBuild ).value,
1521
1524
generateSelfDocumentation := Def .taskDyn {
1522
1525
generateDocumentation(
1523
- classDirectory.in(Compile ).value.getAbsolutePath,
1526
+ classDirectory.in(Compile ).value.getAbsolutePath :: Nil ,
1524
1527
" scaladoc" , " scaladoc/output/self" , VersionUtil .gitHash,
1525
- " -siteroot scaladoc/documentation -project-logo scaladoc/documentation/logo.svg " +
1526
- " -external-mappings:" +
1527
- " .*scala.*::scaladoc3::http://dotty.epfl.ch/api/," +
1528
- " .*java.*::javadoc::https://docs.oracle.com/javase/8/docs/api/"
1528
+ Seq (
1529
+ " -siteroot" , " scaladoc/documentation" ,
1530
+ " -project-logo" , " scaladoc/documentation/logo.svg" ,
1531
+ " -external-mappings:" +
1532
+ " .*scala.*::scaladoc3::http://dotty.epfl.ch/api/," +
1533
+ " .*java.*::javadoc::https://docs.oracle.com/javase/8/docs/api/"
1534
+ )
1535
+
1529
1536
)
1530
1537
}.value,
1531
1538
generateScalaDocumentation := Def .inputTaskDyn {
@@ -1539,7 +1546,7 @@ object Build {
1539
1546
(`tasty-core-bootstrapped`/ Compile / products).value,
1540
1547
).flatten
1541
1548
1542
- val roots = joinProducts( dottyJars)
1549
+ val roots = dottyJars.map(_.getAbsolutePath )
1543
1550
1544
1551
val managedSources =
1545
1552
(`stdlib-bootstrapped`/ Compile / sourceManaged).value / " scala-library-src"
@@ -1555,27 +1562,36 @@ object Build {
1555
1562
IO .write(dest / " CNAME" , " dotty.epfl.ch" )
1556
1563
}.dependsOn(generateDocumentation(
1557
1564
roots, " Scala 3" , dest.getAbsolutePath, " master" ,
1558
- // contains special definitions which are "transplanted" elsewhere
1559
- // and which therefore confuse Scaladoc when accessed from this pkg
1560
- " -skip-by-id:scala.runtime.stdLibPatches " +
1561
- // MatchCase is a special type that represents match type cases,
1562
- // Reflect doesn't expect to see it as a standalone definition
1563
- // and therefore it's easier just not to document it
1564
- " -skip-by-id:scala.runtime.MatchCase " +
1565
- " -skip-by-regex:.+\\ .internal($|\\ ..+) " +
1566
- " -skip-by-regex:.+\\ .impl($|\\ ..+) " +
1567
- " -comment-syntax wiki -siteroot docs -project-logo docs/logo.svg " +
1568
- " -external-mappings:.*java.*::javadoc::https://docs.oracle.com/javase/8/docs/api/ " +
1569
- " -social-links:github::https://github.com/lampepfl/dotty," +
1570
- " gitter::https://gitter.im/scala/scala," +
1571
- " twitter::https://twitter.com/scala_lang " +
1572
- s " -source-links: $stdLibRoot=github://scala/scala/v ${stdlibVersion(Bootstrapped )}#src/library " +
1573
- s " -doc-root-content $docRootFile"
1574
- ))
1565
+ Seq (
1566
+ // contains special definitions which are "transplanted" elsewhere
1567
+ // and which therefore confuse Scaladoc when accessed from this pkg
1568
+ " -skip-by-id:scala.runtime.stdLibPatches" ,
1569
+ // MatchCase is a special type that represents match type cases,
1570
+ // Reflect doesn't expect to see it as a standalone definition
1571
+ // and therefore it's easier just not to document it
1572
+ " -skip-by-id:scala.runtime.MatchCase" ,
1573
+ " -skip-by-regex:.+\\ .internal($|\\ ..+)" ,
1574
+ " -skip-by-regex:.+\\ .impl($|\\ ..+)" ,
1575
+ " -comment-syntax" , " wiki" ,
1576
+ " -siteroot" , " docs" ,
1577
+ " -project-logo" , " docs/logo.svg" ,
1578
+ " -external-mappings:.*java.*::javadoc::https://docs.oracle.com/javase/8/docs/api/" ,
1579
+ " -social-links:" +
1580
+ " github::https://github.com/lampepfl/dotty," +
1581
+ " gitter::https://gitter.im/scala/scala," +
1582
+ " twitter::https://twitter.com/scala_lang" ,
1583
+ s " -source-links: $stdLibRoot=github://scala/scala/v ${stdlibVersion(Bootstrapped )}#src/library " ,
1584
+ " -doc-root-content" , docRootFile.toString
1585
+ )
1586
+ ))
1575
1587
}.evaluated,
1576
1588
1577
1589
generateTestcasesDocumentation := Def .taskDyn {
1578
- generateDocumentation(Build .testcasesOutputDir.in(Test ).value, " scaladoc testcases" , " scaladoc/output/testcases" , " master" )
1590
+ generateDocumentation(
1591
+ Build .testcasesOutputDir.in(Test ).value :: Nil ,
1592
+ " scaladoc testcases" ,
1593
+ " scaladoc/output/testcases" ,
1594
+ " master" )
1579
1595
}.value,
1580
1596
1581
1597
buildInfoKeys in Test := Seq [BuildInfoKey ](
0 commit comments