Skip to content

Commit

Permalink
Add flags according to Scala version
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydmeta committed Dec 16, 2016
1 parent cb43483 commit d2a2d30
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -246,25 +246,30 @@ lazy val ideSettings = Seq(
lazy val compilerSettings = Seq(
// the name-hashing algorithm for the incremental compiler.
incOptions := incOptions.value.withNameHashing(nameHashing = true),
scalacOptions ++= Seq(
"-Xlog-free-terms",
"-encoding",
"UTF-8", // yes, this is 2 args
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Xfatal-warnings",
"-deprecation:false",
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code", // N.B. doesn't work well with the ??? hole
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
"-Xfuture",
"-Ywarn-unused-import" // 2.11 only
)
scalacOptions ++= {
val base = Seq(
"-Xlog-free-terms",
"-encoding",
"UTF-8", // yes, this is 2 args
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Xfatal-warnings",
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code", // N.B. doesn't work well with the ??? hole
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
"-Xfuture"
)
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 12)) => base ++ Seq("-deprecation:false")
case Some((2, 11)) => base ++ Seq("-deprecation:false", "-Ywarn-unused-import")
case _ => base
}
}
)

lazy val scoverageSettings = Seq(
Expand Down

0 comments on commit d2a2d30

Please sign in to comment.