aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Lawson2020-04-02 09:27:18 -0700
committerGitHub2020-04-02 16:27:18 +0000
commit477132be8835568ec78b285a0741c6dc3cd93ede (patch)
tree21d5f49dc4dabb71d1c2be09ab346d0ca0e5c996
parent68be96c8d177b183158a6701b158e3688a76f894 (diff)
Disable unidoc -Xfatal-warning for Scala 2.11 (#1493)
-rw-r--r--build.sbt16
1 files changed, 14 insertions, 2 deletions
diff --git a/build.sbt b/build.sbt
index 88d22088..9d141c12 100644
--- a/build.sbt
+++ b/build.sbt
@@ -132,11 +132,23 @@ lazy val publishSettings = Seq(
}
)
+
+def scalacDocOptionsVersion(scalaVersion: String): Seq[String] = {
+ Seq() ++ {
+ // If we're building with Scala > 2.11, enable the compile option
+ // to flag warnings as errors. This must be disabled for 2.11 since
+ // references to the Java class library from Java 9 on generate warnings.
+ // https://github.com/scala/bug/issues/10675
+ CrossVersion.partialVersion(scalaVersion) match {
+ case Some((2, scalaMajor: Long)) if scalaMajor < 12 => Seq()
+ case _ => Seq("-Xfatal-warnings")
+ }
+ }
+}
lazy val docSettings = Seq(
doc in Compile := (doc in ScalaUnidoc).value,
autoAPIMappings := true,
scalacOptions in Compile in doc ++= Seq(
- "-Xfatal-warnings",
"-feature",
"-diagrams",
"-diagrams-max-classes", "25",
@@ -154,7 +166,7 @@ lazy val docSettings = Seq(
}
s"https://github.com/freechipsproject/firrtl/tree/$branch€{FILE_PATH}.scala"
}
- ) ++ scalacOptionsVersion(scalaVersion.value)
+ ) ++ scalacOptionsVersion(scalaVersion.value) ++ scalacDocOptionsVersion(scalaVersion.value)
)
lazy val firrtl = (project in file("."))