Skip to content

Commit 7286e6e

Browse files
committed
"sbt compile" uses non-boostrapped scaladoc
"sbt compile" is supposed to only compile non-bootstrapped projects (so we can rely on it working even if bootstrapping is broken while working on the compiler for example), but scaladoc is a bootstrapped project and it was part of the aggregate of the default project. Fixed by replacing it with `scaladoc-nonBootstrapped`. To compile all bootstrapped projects use `scala3-bootstrapped/compile` instead. Also make sure the dist project uses the correct scaladoc depending on whether it's bootstrapped or not.
1 parent d8a788e commit 7286e6e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

project/Build.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,11 @@ object Build {
11651165
sources.in(Test) := Nil
11661166
)
11671167

1168+
def scalaDoc(implicit mode: Mode): Project = mode match {
1169+
case NonBootstrapped => `scaladoc-nonBootstrapped`
1170+
case Bootstrapped => scaladoc
1171+
}
1172+
11681173
lazy val `scaladoc-testcases` = project.in(file("scaladoc-testcases")).asScaladocTestcases
11691174

11701175
lazy val `scaladoc-js` = project.in(file("scaladoc-js")).asScaladocJs
@@ -1415,7 +1420,7 @@ object Build {
14151420

14161421
// FIXME: we do not aggregate `bin` because its tests delete jars, thus breaking other tests
14171422
def asDottyRoot(implicit mode: Mode): Project = project.withCommonSettings.
1418-
aggregate(`scala3-interfaces`, dottyLibrary, dottyCompiler, tastyCore, scaladoc, `scala3-sbt-bridge`).
1423+
aggregate(`scala3-interfaces`, dottyLibrary, dottyCompiler, tastyCore, `scaladoc-nonBootstrapped`, `scala3-sbt-bridge`).
14191424
bootstrappedAggregate(`scala3-language-server`, `scala3-staging`, `scala3-tasty-inspector`,
14201425
`scala3-library-bootstrappedJS`, scaladoc).
14211426
dependsOn(tastyCore).
@@ -1637,7 +1642,7 @@ object Build {
16371642
def asDist(implicit mode: Mode): Project = project.
16381643
enablePlugins(PackPlugin).
16391644
withCommonSettings.
1640-
dependsOn(`scala3-interfaces`, dottyCompiler, dottyLibrary, tastyCore, `scala3-staging`, `scala3-tasty-inspector`, scaladoc).
1645+
dependsOn(`scala3-interfaces`, dottyCompiler, dottyLibrary, tastyCore, `scala3-staging`, `scala3-tasty-inspector`, scalaDoc).
16411646
settings(commonDistSettings).
16421647
bootstrappedSettings(
16431648
target := baseDirectory.value / "target" // override setting in commonBootstrappedSettings

0 commit comments

Comments
 (0)