Skip to content

Commit 28389d2

Browse files
committed
Fix documentation generation for scala-library-bootstrapped
Filter out -sourcepath from doc scalacOptions as it causes conflicts with symbols loaded from tasty during documentation generation.
1 parent 0778811 commit 28389d2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

project/Build.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@ object Build {
13121312
lazy val `scala-library-bootstrapped` = project.in(file("library"))
13131313
.enablePlugins(ScalaLibraryPlugin)
13141314
.settings(publishSettings)
1315-
.settings(disableDocSetting) // TODO now produces empty JAR to satisfy Sonatype, see https://github.com/scala/scala3/issues/24434
1315+
//.settings(disableDocSetting) // TODO now produces empty JAR to satisfy Sonatype, see https://github.com/scala/scala3/issues/24434
13161316
.settings(
13171317
name := "scala-library-bootstrapped",
13181318
moduleName := "scala-library",
@@ -1336,6 +1336,11 @@ object Build {
13361336
// Needed so that the library sources are visible when `dotty.tools.dotc.core.Definitions#init` is called
13371337
"-sourcepath", (Compile / sourceDirectories).value.map(_.getCanonicalPath).distinct.mkString(File.pathSeparator),
13381338
),
1339+
// For doc generation, filter out -sourcepath as it causes conflicts with symbols loaded from tasty
1340+
Compile / doc / scalacOptions ~= { opts =>
1341+
val idx = opts.indexOf("-sourcepath")
1342+
if (idx >= 0) opts.patch(idx, Nil, 2) else opts
1343+
},
13391344
// Packaging configuration of the stdlib
13401345
Compile / packageBin / publishArtifact := true,
13411346
Compile / packageDoc / publishArtifact := true,

0 commit comments

Comments
 (0)