@@ -213,6 +213,13 @@ object Build {
213
213
}
214
214
)
215
215
216
+ lazy val disableDocSetting =
217
+ // Disable scaladoc generation, it's way too slow and we'll replace it
218
+ // by dottydoc anyway. We still publish an empty -javadoc.jar to make
219
+ // sonatype happy.
220
+ sources in (Compile , doc) := Seq ()
221
+
222
+
216
223
lazy val commonSettings = publishSettings ++ Seq (
217
224
scalaSource in Compile := baseDirectory.value / " src" ,
218
225
scalaSource in Test := baseDirectory.value / " test" ,
@@ -221,11 +228,6 @@ object Build {
221
228
resourceDirectory in Compile := baseDirectory.value / " resources" ,
222
229
resourceDirectory in Test := baseDirectory.value / " test-resources" ,
223
230
224
- // Disable scaladoc generation, it's way too slow and we'll replace it
225
- // by dottydoc anyway. We still publish an empty -javadoc.jar to make
226
- // sonatype happy.
227
- sources in (Compile , doc) := Seq (),
228
-
229
231
// Prevent sbt from rewriting our dependencies
230
232
scalaModuleInfo ~= (_.map(_.withOverrideScalaVersion(false ))),
231
233
@@ -244,7 +246,8 @@ object Build {
244
246
crossPaths := false ,
245
247
// Do not depend on the Scala library
246
248
autoScalaLibrary := false ,
247
- excludeFromIDE := true
249
+ excludeFromIDE := true ,
250
+ disableDocSetting
248
251
)
249
252
250
253
// Settings used when compiling dotty (both non-bootstrapped and bootstrapped)
@@ -258,6 +261,8 @@ object Build {
258
261
moduleName ~= { _.stripSuffix(" -scala2" ) },
259
262
version := dottyVersion,
260
263
target := baseDirectory.value / " .." / " out" / " scala-2" / name.value,
264
+
265
+ disableDocSetting
261
266
)
262
267
263
268
// Settings used when compiling dotty with the reference compiler
@@ -267,13 +272,12 @@ object Build {
267
272
version := dottyNonBootstrappedVersion,
268
273
scalaVersion := referenceVersion,
269
274
excludeFromIDE := true ,
275
+
276
+ disableDocSetting
270
277
)
271
278
272
279
// Settings used when compiling dotty with a non-bootstrapped dotty
273
- lazy val commonBootstrappedSettings = commonBootstrappedSettings0 ++ Seq (
274
- disableDocSetting,
275
- )
276
- lazy val commonBootstrappedSettings0 = commonDottySettings ++ Seq (
280
+ lazy val commonBootstrappedSettings = commonDottySettings ++ Seq (
277
281
unmanagedSourceDirectories in Compile += baseDirectory.value / " src-bootstrapped" ,
278
282
279
283
version := dottyVersion,
@@ -331,6 +335,8 @@ object Build {
331
335
},
332
336
// sbt-dotty defines `scalaInstance in doc` so we need to override it manually
333
337
scalaInstance in doc := scalaInstance.value,
338
+
339
+ disableDocSetting,
334
340
)
335
341
336
342
lazy val commonBenchmarkSettings = Seq (
@@ -1158,7 +1164,7 @@ object Build {
1158
1164
1159
1165
val testcasesOutputDir = taskKey[String ](" Root directory where tests classses are generated" )
1160
1166
val testcasesSourceRoot = taskKey[String ](" Root directory where tests sources are generated" )
1161
- val generateSelfDocumentation = inputKey [Unit ](" Generate example documentation" )
1167
+ val generateSelfDocumentation = taskKey [Unit ](" Generate example documentation" )
1162
1168
val generateScala3Documentation = taskKey[Unit ](" Generate documentation for dotty lib" )
1163
1169
val generateTestcasesDocumentation = taskKey[Unit ](" Generate documentation for testcases, usefull for debugging tests" )
1164
1170
lazy val `scala3doc` = project.in(file(" scala3doc" )).asScala3doc
@@ -1203,6 +1209,7 @@ object Build {
1203
1209
publishLocal in `scala3-staging`,
1204
1210
publishLocal in `scala3-tasty-inspector`,
1205
1211
publishLocal in `scala3-doc-bootstrapped`,
1212
+ publishLocal in `scala3doc`,
1206
1213
publishLocal in `scala3-bootstrapped` // Needed because sbt currently hardcodes the dotty artifact
1207
1214
).evaluated
1208
1215
)
@@ -1404,7 +1411,7 @@ object Build {
1404
1411
def asDottyRoot (implicit mode : Mode ): Project = project.withCommonSettings.
1405
1412
aggregate(`scala3-interfaces`, dottyLibrary, dottyCompiler, tastyCore, dottyDoc, `scala3-sbt-bridge`).
1406
1413
bootstrappedAggregate(`scala3-language-server`, `scala3-staging`, `scala3-tasty-inspector`,
1407
- `scala3-library-bootstrappedJS`).
1414
+ `scala3-library-bootstrappedJS`, scala3doc ).
1408
1415
dependsOn(tastyCore).
1409
1416
dependsOn(dottyCompiler).
1410
1417
dependsOn(dottyLibrary).
@@ -1454,19 +1461,18 @@ object Build {
1454
1461
def asScala3doc : Project = {
1455
1462
def generateDocumentation (targets : String , name : String , outDir : String , params : String = " " ) = Def .taskDyn {
1456
1463
val sourceMapping = " =https://github.com/lampepfl/dotty/tree/master#L"
1457
- 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""" )
1458
1465
}
1459
1466
1460
1467
project.settings(commonBootstrappedSettings).
1461
1468
dependsOn(`scala3-compiler-bootstrapped`).
1462
1469
dependsOn(`scala3-tasty-inspector`).
1463
1470
settings(
1471
+ // Needed to download dokka and its dependencies
1464
1472
resolvers += Resolver .jcenterRepo,
1465
- resolvers += Resolver .bintrayRepo( " kotlin " , " kotlin-dev " ),
1473
+ // Needed to download dokka-site
1466
1474
resolvers += Resolver .bintrayRepo(" virtuslab" , " dokka" ),
1467
1475
libraryDependencies ++= Seq (
1468
- " org.scala-lang" %% " scala3-tasty-inspector" % scalaVersion.value,
1469
-
1470
1476
" com.virtuslab.dokka" % " dokka-site" % " 0.1.9" ,
1471
1477
" com.vladsch.flexmark" % " flexmark-all" % " 0.42.12" ,
1472
1478
" nl.big-o" % " liqp" % " 0.6.7" ,
@@ -1475,17 +1481,15 @@ object Build {
1475
1481
" org.jetbrains.dokka" % " dokka-test-api" % " 1.4.10.2" % " test" ,
1476
1482
" com.novocode" % " junit-interface" % " 0.11" % " test" ,
1477
1483
),
1478
- 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,
1479
1485
testcasesOutputDir.in(Test ) := classDirectory.in(Compile ).in(`scala3doc-testcases`).value.getAbsolutePath.toString,
1480
1486
testcasesSourceRoot.in(Test ) := (baseDirectory.in(`scala3doc-testcases`).value / " src" ).getAbsolutePath.toString,
1481
- fork.in(run) := true ,
1482
1487
Compile / mainClass := Some (" dotty.dokka.Main" ),
1483
1488
// There is a bug in dokka that prevents parallel tests withing the same jvm
1484
1489
fork.in(test) := true ,
1485
- Test / parallelExecution := false ,
1486
- generateSelfDocumentation := Def .inputTaskDyn {
1487
- generateDocumentation(classDirectory.in(Compile ).value.getAbsolutePath, " scala3doc" , " self" , " -d documentation" )
1488
- }.evaluated,
1490
+ generateSelfDocumentation := Def .taskDyn {
1491
+ generateDocumentation(classDirectory.in(Compile ).value.getAbsolutePath, " scala3doc" , " self" , " -p documentation" )
1492
+ }.value,
1489
1493
generateScala3Documentation := Def .taskDyn {
1490
1494
val dottyJars = Seq (
1491
1495
// All projects below will be used to generated documentation for Scala 3
@@ -1497,8 +1501,8 @@ object Build {
1497
1501
)
1498
1502
val roots = dottyJars.map(_.toString).mkString(java.io.File .pathSeparator)
1499
1503
1500
- if (dottyJars.isEmpty) Def .task { streams.value.log.error(" Dotty lib wasn't found" ) }
1501
- 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" )
1502
1506
}.value,
1503
1507
generateTestcasesDocumentation := Def .taskDyn {
1504
1508
generateDocumentation(Build .testcasesOutputDir.in(Test ).value, " Scala3doc testcases" , " testcases" )
0 commit comments