Skip to content

Commit ebe114e

Browse files
committed
Change scala3doc parameter names
Clean up Build.scala and scala3doc.yaml
1 parent 425879a commit ebe114e

File tree

4 files changed

+18
-23
lines changed

4 files changed

+18
-23
lines changed

.github/workflows/scala3doc.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
container: lampepfl/dotty:2020-04-24
12-
13-
steps:
1412

13+
steps:
14+
- name: Git Checkout
1515
- uses: actions/checkout@v2
16-
- run: git fetch --prune --unshallow --tags
1716

1817
- name: Cache Coursier
1918
uses: actions/cache@v1

project/Build.scala

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,7 @@ object Build {
277277
)
278278

279279
// Settings used when compiling dotty with a non-bootstrapped dotty
280-
lazy val commonBootstrappedSettings = commonBootstrappedSettings0 ++ Seq(
281-
disableDocSetting,
282-
)
283-
lazy val commonBootstrappedSettings0 = commonDottySettings ++ Seq(
280+
lazy val commonBootstrappedSettings = commonDottySettings ++ Seq(
284281
unmanagedSourceDirectories in Compile += baseDirectory.value / "src-bootstrapped",
285282

286283
version := dottyVersion,
@@ -339,6 +336,8 @@ object Build {
339336

340337
// sbt-dotty defines `scalaInstance in doc` so we need to override it manually
341338
scalaInstance in doc := scalaInstance.value,
339+
340+
disableDocSetting,
342341
)
343342

344343
lazy val commonBenchmarkSettings = Seq(
@@ -1166,7 +1165,7 @@ object Build {
11661165

11671166
val testcasesOutputDir = taskKey[String]("Root directory where tests classses are generated")
11681167
val testcasesSourceRoot = taskKey[String]("Root directory where tests sources are generated")
1169-
val generateSelfDocumentation = inputKey[Unit]("Generate example documentation")
1168+
val generateSelfDocumentation = taskKey[Unit]("Generate example documentation")
11701169
val generateScala3Documentation = taskKey[Unit]("Generate documentation for dotty lib")
11711170
val generateTestcasesDocumentation = taskKey[Unit]("Generate documentation for testcases, usefull for debugging tests")
11721171
lazy val `scala3doc` = project.in(file("scala3doc")).asScala3doc
@@ -1462,19 +1461,18 @@ object Build {
14621461
def asScala3doc: Project = {
14631462
def generateDocumentation(targets: String, name: String, outDir: String, params: String = "") = Def.taskDyn {
14641463
val sourceMapping = "=https://github.com/lampepfl/dotty/tree/master#L"
1465-
run.in(Compile).toTask(s""" -o output/$outDir -t $targets -n "$name" -s $sourceMapping $params""")
1464+
run.in(Compile).toTask(s""" -d output/$outDir -t $targets -n "$name" -s $sourceMapping $params""")
14661465
}
14671466

14681467
project.settings(commonBootstrappedSettings).
14691468
dependsOn(`scala3-compiler-bootstrapped`).
14701469
dependsOn(`scala3-tasty-inspector`).
14711470
settings(
1471+
// Needed to download dokka and its dependencies
14721472
resolvers += Resolver.jcenterRepo,
1473-
resolvers += Resolver.bintrayRepo("kotlin", "kotlin-dev"),
1473+
// Needed to download dokka-site
14741474
resolvers += Resolver.bintrayRepo("virtuslab", "dokka"),
14751475
libraryDependencies ++= Seq(
1476-
"org.scala-lang" %% "scala3-tasty-inspector" % scalaVersion.value,
1477-
14781476
"com.virtuslab.dokka" % "dokka-site" % "0.1.9",
14791477
"com.vladsch.flexmark" % "flexmark-all" % "0.42.12",
14801478
"nl.big-o" % "liqp" % "0.6.7",
@@ -1483,17 +1481,15 @@ object Build {
14831481
"org.jetbrains.dokka" % "dokka-test-api" % "1.4.10.2" % "test",
14841482
"com.novocode" % "junit-interface" % "0.11" % "test",
14851483
),
1486-
test.in(Test) := test.in(Test).dependsOn(compile.in(Compile).in(`scala3doc-testcases`)).value,
1484+
Test / test := (Test / test).dependsOn(compile.in(Compile).in(`scala3doc-testcases`)).value,
14871485
testcasesOutputDir.in(Test) := classDirectory.in(Compile).in(`scala3doc-testcases`).value.getAbsolutePath.toString,
14881486
testcasesSourceRoot.in(Test) := (baseDirectory.in(`scala3doc-testcases`).value / "src").getAbsolutePath.toString,
1489-
fork.in(run) := true,
14901487
Compile / mainClass := Some("dotty.dokka.Main"),
14911488
// There is a bug in dokka that prevents parallel tests withing the same jvm
14921489
fork.in(test) := true,
1493-
Test / parallelExecution := false,
1494-
generateSelfDocumentation := Def.inputTaskDyn {
1495-
generateDocumentation(classDirectory.in(Compile).value.getAbsolutePath, "scala3doc", "self", "-d documentation")
1496-
}.evaluated,
1490+
generateSelfDocumentation := Def.taskDyn {
1491+
generateDocumentation(classDirectory.in(Compile).value.getAbsolutePath, "scala3doc", "self", "-p documentation")
1492+
}.value,
14971493
generateScala3Documentation := Def.taskDyn {
14981494
val dottyJars = Seq(
14991495
// All projects below will be used to generated documentation for Scala 3
@@ -1505,8 +1501,8 @@ object Build {
15051501
)
15061502
val roots = dottyJars.map(_.toString).mkString(java.io.File.pathSeparator)
15071503

1508-
if (dottyJars.isEmpty) Def.task { streams.value.log.error("Dotty lib wasn't found") }
1509-
else generateDocumentation(roots, "Scala 3", "stdLib", "-d dotty-docs/docs")
1504+
if (dottyJars.isEmpty) Def.task { streams.value.log.error("Dotty lib wasn't found") }
1505+
else generateDocumentation(roots, "Scala 3", "stdLib", "-p dotty-docs/docs")
15101506
}.value,
15111507
generateTestcasesDocumentation := Def.taskDyn {
15121508
generateDocumentation(Build.testcasesOutputDir.in(Test).value, "Scala3doc testcases", "testcases")

scala3doc/src/dotty/dokka/Main.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class RawArgs:
2121
@COption(name="--tastyRoots", required = true, aliases = Array("-t"), usage="Roots where tools should look for tasty files")
2222
protected var tastyRoots: String = null
2323

24-
@COption(name="--output",required = true, aliases = Array("-o"), usage="Output to generate documentation to")
24+
@COption(name="--dest",required = true, aliases = Array("-d"), usage="Output to generate documentation to")
2525
protected var output: String = "output"
2626

2727
@COption(name="--classpath", aliases = Array("--cp", "-c"), usage="Classpath to load dependencies from")
@@ -30,7 +30,7 @@ class RawArgs:
3030
@COption(name="--name", required = true, aliases = Array("-n"), usage="Name of module in generated documentation")
3131
protected var name: String = "main"
3232

33-
@COption(name="--docs", aliases = Array("-d"), usage="Root of project docs")
33+
@COption(name="--docs", aliases = Array("-p"), usage="Root of project docs")
3434
private var docsRoot: String = null
3535

3636
@COption(name="--sources", handler = classOf[StringArrayOptionHandler], aliases = Array("-s"), usage = "Links to source files provided in convention: local_directory=remote_directory#line_suffix")

scala3doc/src/dotty/tools/dottydoc/Main.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ object Main extends Driver {
5757
// we extract some settings from Dotty options since that's how SBT passes them
5858
"--name", ctx.settings.projectName.value,
5959
"--projectTitle", ctx.settings.projectName.value,
60-
"--output", ctx.settings.outputDir.value.toString,
60+
"--dest", ctx.settings.outputDir.value.toString,
6161
)
6262

6363
val allArgs = requiredArgs ++ dokkaStrArgs

0 commit comments

Comments
 (0)