Skip to content

Commit

Permalink
Disable unidoc -Xfatal-warning for Scala 2.11 (#1493)
Browse files Browse the repository at this point in the history
  • Loading branch information
ucbjrl authored Apr 2, 2020
1 parent 68be96c commit 477132b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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("."))
Expand Down

0 comments on commit 477132b

Please sign in to comment.