Skip to content

Commit ed088a0

Browse files
BarkingBadromanowski
authored andcommitted
Fix passing arguments for scaladoc/generateScala... tasks
1 parent cb485e6 commit ed088a0

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

project/Build.scala

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,26 @@ object Build {
291291
disableDocSetting
292292
)
293293

294+
lazy val scalacOptionsDocSettings = Seq(
295+
"-external-mappings:" +
296+
".*scala.*::scaladoc3::http://dotty.epfl.ch/api/," +
297+
".*java.*::javadoc::https://docs.oracle.com/javase/8/docs/api/",
298+
"-skip-by-regex:.+\\.internal($|\\..+)",
299+
"-skip-by-regex:.+\\.impl($|\\..+)",
300+
"-project-logo", "docs/logo.svg",
301+
"-social-links:" +
302+
"github::https://github.com/lampepfl/dotty," +
303+
"gitter::https://gitter.im/scala/scala," +
304+
"twitter::https://twitter.com/scala_lang",
305+
// contains special definitions which are "transplanted" elsewhere
306+
// and which therefore confuse Scaladoc when accessed from this pkg
307+
"-skip-by-id:scala.runtime.stdLibPatches",
308+
// MatchCase is a special type that represents match type cases,
309+
// Reflect doesn't expect to see it as a standalone definition
310+
// and therefore it's easier just not to document it
311+
"-skip-by-id:scala.runtime.MatchCase",
312+
)
313+
294314
// Settings used when compiling dotty with a non-bootstrapped dotty
295315
lazy val commonBootstrappedSettings = commonDottySettings ++ NoBloopExport.settings ++ Seq(
296316
bspEnabled := false,
@@ -350,25 +370,7 @@ object Build {
350370
appConfiguration.value
351371
)
352372
},
353-
Compile / doc / scalacOptions ++= Seq(
354-
"-external-mappings:" +
355-
".*scala.*::scaladoc3::http://dotty.epfl.ch/api/," +
356-
".*java.*::javadoc::https://docs.oracle.com/javase/8/docs/api/",
357-
"-skip-by-regex:.+\\.internal($|\\..+)",
358-
"-skip-by-regex:.+\\.impl($|\\..+)",
359-
"-project-logo", "docs/logo.svg",
360-
"-social-links:" +
361-
"github::https://github.com/lampepfl/dotty," +
362-
"gitter::https://gitter.im/scala/scala," +
363-
"twitter::https://twitter.com/scala_lang",
364-
// contains special definitions which are "transplanted" elsewhere
365-
// and which therefore confuse Scaladoc when accessed from this pkg
366-
"-skip-by-id:scala.runtime.stdLibPatches",
367-
// MatchCase is a special type that represents match type cases,
368-
// Reflect doesn't expect to see it as a standalone definition
369-
// and therefore it's easier just not to document it
370-
"-skip-by-id:scala.runtime.MatchCase",
371-
),
373+
Compile / doc / scalacOptions ++= scalacOptionsDocSettings,
372374
// sbt-dotty defines `scalaInstance in doc` so we need to override it manually
373375
doc / scalaInstance := scalaInstance.value,
374376
)
@@ -1616,7 +1618,7 @@ object Build {
16161618
val srcManaged = s"out/bootstrap/stdlib-bootstrapped/scala-$baseVersion/src_managed/main/scala-library-src"
16171619
val sourceLinks = s"-source-links:$srcManaged=github://scala/scala/v${stdlibVersion(Bootstrapped)}}#src/library"
16181620
val revision = Seq("-revision", ref, "-project-version", projectVersion)
1619-
val cmd = Seq("-d", outDir, "-project", name, sourceLinks) ++ revision ++ params ++ targets
1621+
val cmd = Seq("-d", outDir, "-project", name, sourceLinks) ++ scalacOptionsDocSettings ++ revision ++ params ++ targets
16201622
import _root_.scala.sys.process._
16211623
Def.task((s"$distLocation/bin/scaladoc" +: cmd).!)
16221624
}

0 commit comments

Comments
 (0)