Skip to content

Commit f2e3d44

Browse files
committed
Exclude doc-scoped scalacOptions for dotty
1 parent c4b81a9 commit f2e3d44

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

build.sbt

+18-13
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,24 @@ lazy val parserCombinators = crossProject(JVMPlatform, JSPlatform, NativePlatfor
1111
apiMappings += (scalaInstance.value.libraryJar ->
1212
url(s"https://www.scala-lang.org/api/${scalaVersion.value}/")),
1313

14-
scalacOptions in (Compile, doc) ++= Seq(
15-
"-diagrams",
16-
"-doc-source-url",
17-
s"https://github.com/scala/scala-parser-combinators/tree/v${version.value}€{FILE_PATH}.scala",
18-
"-sourcepath",
19-
(baseDirectory in LocalRootProject).value.absolutePath,
20-
"-doc-title",
21-
"Scala Parser Combinators",
22-
"-doc-version",
23-
version.value,
24-
if (isDotty.value) "-language:Scala2"
25-
else ""
26-
),
14+
scalacOptions in (Compile, doc) ++= {
15+
CrossVersion.partialVersion(scalaVersion.value) match {
16+
case Some((0, _)) =>
17+
Seq("-language:Scala2")
18+
case _ =>
19+
Seq(
20+
"-diagrams",
21+
"-doc-source-url",
22+
s"https://github.com/scala/scala-parser-combinators/tree/v${version.value}€{FILE_PATH}.scala",
23+
"-sourcepath",
24+
(baseDirectory in LocalRootProject).value.absolutePath,
25+
"-doc-title",
26+
"Scala Parser Combinators",
27+
"-doc-version",
28+
version.value
29+
)
30+
}
31+
},
2732
unmanagedSourceDirectories in Compile ++= {
2833
(unmanagedSourceDirectories in Compile).value.map { dir =>
2934
CrossVersion.partialVersion(scalaVersion.value) match {

0 commit comments

Comments
 (0)