Skip to content

Commit a27d894

Browse files
committed
Improve flags for compliation activating fatal warnings
1 parent 8fd23f6 commit a27d894

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

build.sbt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,18 @@ lazy val commonSettings = Seq(
2222
crossScalaVersions := crossScalaVer,
2323
autoAPIMappings := true,
2424

25-
scalacOptions in Compile ++= Seq(
26-
"-deprecation",
27-
"-feature",
28-
// Enable when documentation does not produce warnings
29-
//"-Xfatal-warnings",
25+
scalacOptions ++= Seq("-deprecation", "-feature",
3026
"-encoding", "UTF-8"
3127
),
28+
scalacOptions := {
29+
CrossVersion.partialVersion(scalaVersion.value) match {
30+
case Some((2, scalaMajor)) if scalaMajor >= 11 =>
31+
scalacOptions.value ++ Seq("-deprecation:false", "-Xfatal-warnings")
32+
case Some((2, 10)) =>
33+
scalacOptions.value
34+
}
35+
},
36+
javaOptions ++= Seq("-Dfile.encoding=UTF8"),
3237

3338
publishArtifact in Test := false,
3439
publishMavenStyle := true,

0 commit comments

Comments
 (0)