@@ -136,7 +136,7 @@ object Build {
136
136
137
137
val fetchScalaJSSource = taskKey[File ](" Fetch the sources of Scala.js" )
138
138
139
- val aritfactsForScala3Documentation = taskKey[Seq [File ]](" All artifacts to document " )
139
+ val artifactsForScala3Documentation = taskKey[Seq [File ]](" Artifacts to be documented by Scala3doc " )
140
140
141
141
lazy val SourceDeps = config(" sourcedeps" )
142
142
@@ -1160,7 +1160,6 @@ object Build {
1160
1160
1161
1161
lazy val `scala3doc` = project.in(file(" scala3doc" )).asScala3doc
1162
1162
lazy val `scala3doc-test` = project.in(file(" scala3doc-test" )).asScala3docTest
1163
- lazy val `scala3doc-example-project` = project.in(file(" scala3doc-example-project" )).asDocExampleProject
1164
1163
1165
1164
// sbt plugin to use Dotty in your own build, see
1166
1165
// https://github.com/lampepfl/scala3-example-project for usage.
@@ -1449,78 +1448,59 @@ object Build {
1449
1448
settings(commonBenchmarkSettings).
1450
1449
enablePlugins(JmhPlugin )
1451
1450
1452
- def commonScala3DocSettings = commonBootstrappedSettings ++ Seq (
1453
- scalaVersion := dottyVersion,
1451
+ def commonScala3docSettings = Seq (
1454
1452
resolvers += Resolver .jcenterRepo,
1455
1453
resolvers += Resolver .bintrayRepo(" kotlin" , " kotlin-dev" ),
1456
1454
resolvers += Resolver .bintrayRepo(" virtuslab" , " dokka" ),
1457
1455
)
1458
1456
1459
- def asScala3doc : Project =
1460
- project.
1461
- settings(commonScala3DocSettings ).
1457
+ def asScala3doc : Project =
1458
+ project.settings(commonBootstrappedSettings).
1459
+ settings(commonScala3docSettings ).
1462
1460
dependsOn(`scala3-compiler-bootstrapped`).
1463
1461
dependsOn(`scala3-tasty-inspector`).
1464
- settings(aritfactsForScala3Documentation := Seq (
1465
- // All projects below will be put co generated documentaiton for Scala 3
1466
- classDirectory.in(`scala3-interfaces`).in(Compile ).value,
1467
- classDirectory.in(`tasty-core`).in(Compile ).value,
1468
- classDirectory.in(`scala3-library`).in(Compile ).value,
1469
- // TODO this one fails to load using TASTY
1470
- // classDirectory.in(`stdlib-bootstrapped`).in(Compile).value,
1462
+ settings(artifactsForScala3Documentation := Seq (
1463
+ // All projects below will be used to generated documentation for Scala 3
1464
+ classDirectory.in(`scala3-interfaces`).in(Compile ).value,
1465
+ classDirectory.in(`tasty-core`).in(Compile ).value,
1466
+ classDirectory.in(`scala3-library`).in(Compile ).value,
1467
+ // TODO this one fails to load using TASTY
1468
+ // classDirectory.in(`stdlib-bootstrapped`).in(Compile).value,
1471
1469
))
1472
1470
1473
- def asScala3docTest : Project =
1474
- project.
1475
- settings(commonScala3DocSettings).
1476
- dependsOn(`scala3doc`)
1477
-
1478
- def asDocExampleProject : Project = project.
1479
- settings(commonBootstrappedSettings0).
1480
- dependsOn(`scala3-compiler-bootstrapped`).
1481
- settings(
1482
- Compile / scalaSource := baseDirectory.value / " src/main/scala" ,
1483
- Test / scalaSource := baseDirectory.value / " src/test/scala" ,
1484
- Compile / resourceDirectory := baseDirectory.value / " src/main/resources" ,
1485
- Test / resourceDirectory := baseDirectory.value / " src/test/resources" ,
1486
-
1487
- name := " scala3doc-example-project" ,
1488
- description := " Example SBT project that is documented using Scala3doc" ,
1489
- version := " 0.1.0-SNAPSHOT" ,
1490
- scalaVersion := dottyVersion,
1491
-
1492
- useScala3doc := true ,
1493
- scala3docOptions ++= Seq (" --name" , " example-project" ),
1494
- Compile / doc / target := file(" out/doc/example-project" ),
1495
-
1496
- // we cannot set
1497
- doc/ scalaInstance := {
1498
- val externalNonBootstrappedDeps = externalDependencyClasspath.in(`scala3doc`, Compile ).value
1499
- val scalaLibrary = findArtifact(externalNonBootstrappedDeps, " scala-library" )
1500
-
1501
- // IMPORTANT: We need to use actual jars to form the ScalaInstance and not
1502
- // just directories containing classfiles because sbt maintains a cache of
1503
- // compiler instances. This cache is invalidated based on timestamps
1504
- // however this is only implemented on jars, directories are never
1505
- // invalidated.
1506
- val tastyCore = packageBin.in(`tasty-core`, Compile ).value
1507
- val dottyLibrary = packageBin.in(`scala3-library-bootstrapped`, Compile ).value
1508
- val dottyInterfaces = packageBin.in(`scala3-interfaces`, Compile ).value
1509
- val dottyCompiler = packageBin.in(`scala3-compiler-bootstrapped`, Compile ).value
1510
- val doctool = packageBin.in(`scala3doc`, Compile ).value
1511
-
1512
- val allJars = Seq (tastyCore, dottyLibrary, dottyInterfaces, dottyCompiler, doctool) ++ externalNonBootstrappedDeps.map(_.data)
1513
-
1514
- makeScalaInstance(
1515
- state.value,
1516
- scalaVersion.value,
1517
- scalaLibrary,
1518
- dottyLibrary,
1519
- dottyCompiler,
1520
- allJars
1521
- )
1522
- },
1523
- )
1471
+ def asScala3docTest : Project =
1472
+ project.settings(commonBootstrappedSettings0).
1473
+ settings(commonScala3docSettings).
1474
+ dependsOn(`scala3doc`).
1475
+ settings(
1476
+ Compile / doc/ target := baseDirectory.value / " ../out/doc" / name.value,
1477
+ doc/ scalaInstance := {
1478
+ val externalNonBootstrappedDeps = externalDependencyClasspath.in(`scala3doc`, Compile ).value
1479
+ val scalaLibrary = findArtifact(externalNonBootstrappedDeps, " scala-library" )
1480
+
1481
+ // IMPORTANT: We need to use actual jars to form the ScalaInstance and not
1482
+ // just directories containing classfiles because sbt maintains a cache of
1483
+ // compiler instances. This cache is invalidated based on timestamps
1484
+ // however this is only implemented on jars, directories are never
1485
+ // invalidated.
1486
+ val tastyCore = packageBin.in(`tasty-core`, Compile ).value
1487
+ val dottyLibrary = packageBin.in(`scala3-library-bootstrapped`, Compile ).value
1488
+ val dottyInterfaces = packageBin.in(`scala3-interfaces`, Compile ).value
1489
+ val dottyCompiler = packageBin.in(`scala3-compiler-bootstrapped`, Compile ).value
1490
+ val doctool = packageBin.in(`scala3doc`, Compile ).value
1491
+
1492
+ val allJars = Seq (tastyCore, dottyLibrary, dottyInterfaces, dottyCompiler, doctool) ++ externalNonBootstrappedDeps.map(_.data)
1493
+
1494
+ makeScalaInstance(
1495
+ state.value,
1496
+ scalaVersion.value,
1497
+ scalaLibrary,
1498
+ dottyLibrary,
1499
+ dottyCompiler,
1500
+ allJars
1501
+ )
1502
+ },
1503
+ )
1524
1504
1525
1505
def asDist (implicit mode : Mode ): Project = project.
1526
1506
enablePlugins(PackPlugin ).
0 commit comments