@@ -1496,20 +1496,23 @@ object Build {
14961496 }
14971497
14981498 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
15001502 val projectVersion = version.value
15011503 IO .createDirectory(file(outDir))
15021504 val scala3version = stdlibVersion(Bootstrapped )
15031505 // TODO add versions etc.
15041506 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+ }
15101513
15111514 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(" " )
15131516
15141517 val flexmarkVersion = " 0.42.12"
15151518
@@ -1520,12 +1523,16 @@ object Build {
15201523 baseDirectory.in(run) := baseDirectory.in(ThisBuild ).value,
15211524 generateSelfDocumentation := Def .taskDyn {
15221525 generateDocumentation(
1523- classDirectory.in(Compile ).value.getAbsolutePath,
1526+ classDirectory.in(Compile ).value.getAbsolutePath :: Nil ,
15241527 " 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+
15291536 )
15301537 }.value,
15311538 generateScalaDocumentation := Def .inputTaskDyn {
@@ -1539,7 +1546,7 @@ object Build {
15391546 (`tasty-core-bootstrapped`/ Compile / products).value,
15401547 ).flatten
15411548
1542- val roots = joinProducts( dottyJars)
1549+ val roots = dottyJars.map(_.getAbsolutePath )
15431550
15441551 val managedSources =
15451552 (`stdlib-bootstrapped`/ Compile / sourceManaged).value / " scala-library-src"
@@ -1555,27 +1562,36 @@ object Build {
15551562 IO .write(dest / " CNAME" , " dotty.epfl.ch" )
15561563 }.dependsOn(generateDocumentation(
15571564 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+ ))
15751587 }.evaluated,
15761588
15771589 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" )
15791595 }.value,
15801596
15811597 buildInfoKeys in Test := Seq [BuildInfoKey ](
0 commit comments