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