Skip to content

Commit cd6705c

Browse files
committed
Fix passing arguments for scaladoc/generateScala... tasks
1 parent fff8e5f commit cd6705c

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

project/Build.scala

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,26 @@ object Build {
284284
disableDocSetting
285285
)
286286

287+
lazy val scalacOptionsDocSettings = Seq(
288+
"-external-mappings:" +
289+
".*scala.*::scaladoc3::http://dotty.epfl.ch/api/," +
290+
".*java.*::javadoc::https://docs.oracle.com/javase/8/docs/api/",
291+
"-skip-by-regex:.+\\.internal($|\\..+)",
292+
"-skip-by-regex:.+\\.impl($|\\..+)",
293+
"-project-logo", "docs/logo.svg",
294+
"-social-links:" +
295+
"github::https://github.com/lampepfl/dotty," +
296+
"gitter::https://gitter.im/scala/scala," +
297+
"twitter::https://twitter.com/scala_lang",
298+
// contains special definitions which are "transplanted" elsewhere
299+
// and which therefore confuse Scaladoc when accessed from this pkg
300+
"-skip-by-id:scala.runtime.stdLibPatches",
301+
// MatchCase is a special type that represents match type cases,
302+
// Reflect doesn't expect to see it as a standalone definition
303+
// and therefore it's easier just not to document it
304+
"-skip-by-id:scala.runtime.MatchCase",
305+
)
306+
287307
// Settings used when compiling dotty with a non-bootstrapped dotty
288308
lazy val commonBootstrappedSettings = commonDottySettings ++ Seq(
289309
unmanagedSourceDirectories in Compile += baseDirectory.value / "src-bootstrapped",
@@ -342,25 +362,7 @@ object Build {
342362
appConfiguration.value
343363
)
344364
},
345-
Compile / doc / scalacOptions ++= Seq(
346-
"-external-mappings:" +
347-
".*scala.*::scaladoc3::http://dotty.epfl.ch/api/," +
348-
".*java.*::javadoc::https://docs.oracle.com/javase/8/docs/api/",
349-
"-skip-by-regex:.+\\.internal($|\\..+)",
350-
"-skip-by-regex:.+\\.impl($|\\..+)",
351-
"-project-logo", "docs/logo.svg",
352-
"-social-links:" +
353-
"github::https://github.com/lampepfl/dotty," +
354-
"gitter::https://gitter.im/scala/scala," +
355-
"twitter::https://twitter.com/scala_lang",
356-
// contains special definitions which are "transplanted" elsewhere
357-
// and which therefore confuse Scaladoc when accessed from this pkg
358-
"-skip-by-id:scala.runtime.stdLibPatches",
359-
// MatchCase is a special type that represents match type cases,
360-
// Reflect doesn't expect to see it as a standalone definition
361-
// and therefore it's easier just not to document it
362-
"-skip-by-id:scala.runtime.MatchCase",
363-
),
365+
Compile / doc / scalacOptions ++= scalacOptionsDocSettings,
364366
// sbt-dotty defines `scalaInstance in doc` so we need to override it manually
365367
scalaInstance in doc := scalaInstance.value
366368
)
@@ -1609,7 +1611,7 @@ object Build {
16091611
val srcManaged = s"out/bootstrap/stdlib-bootstrapped/scala-$baseVersion/src_managed/main/scala-library-src"
16101612
val sourceLinks = s"-source-links:$srcManaged=github://scala/scala/v$scala3version#src/library"
16111613
val revision = Seq("-revision", ref, "-project-version", projectVersion)
1612-
val cmd = Seq("-d", outDir, "-project", name, sourceLinks) ++ revision ++ params ++ targets
1614+
val cmd = Seq("-d", outDir, "-project", name, sourceLinks) ++ scalacOptionsDocSettings ++ revision ++ params ++ targets
16131615
import _root_.scala.sys.process._
16141616
Def.task((s"$distLocation/bin/scaladoc" +: cmd).!)
16151617
}
@@ -1660,9 +1662,7 @@ object Build {
16601662
Seq(
16611663
"-comment-syntax", "wiki",
16621664
"-siteroot", "docs",
1663-
s"-source-links:" +
1664-
s"$stdLibRoot=github://scala/scala/v${stdlibVersion(Bootstrapped)}#src/library," +
1665-
s"docs=github://lampepfl/dotty/master#docs",
1665+
s"-source-links:docs=github://lampepfl/dotty/master#docs",
16661666
"-doc-root-content", docRootFile.toString
16671667
)
16681668
))

0 commit comments

Comments
 (0)