Skip to content
This repository was archived by the owner on Mar 23, 2022. It is now read-only.

Commit

Permalink
Improve scalac options
Browse files Browse the repository at this point in the history
  • Loading branch information
miguno committed Sep 10, 2014
1 parent 2e3e01d commit 32880b3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
26 changes: 21 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,26 @@ javacOptions in Compile ++= Seq(

scalacOptions ++= Seq(
"-target:jvm-1.7",
"-unchecked",
"-deprecation",
"-feature",
"-Ywarn-value-discard")
"-encoding", "UTF-8"
)

scalacOptions in Compile ++= Seq(
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
"-Xlint", // Enable recommended additional warnings.
"-Ywarn-adapted-args", // Warn if an argument list is modified to match the receiver.
"-Ywarn-dead-code",
"-Ywarn-value-discard" // Warn when non-Unit expression results are unused.
)

scalacOptions in Test ~= { (options: Seq[String]) =>
options.filterNot(_ == "-Ywarn-value-discard").filterNot(_ == "-Ywarn-dead-code" /* to fix warnings due to Mockito */)
}

scalacOptions in ScoverageTest ~= { (options: Seq[String]) =>
options.filterNot(_ == "-Ywarn-value-discard").filterNot(_ == "-Ywarn-dead-code" /* to fix warnings due to Mockito */)
}

publishArtifact in Test := false

Expand All @@ -101,6 +117,6 @@ testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-u", "target/te
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-o")

// See https://github.com/scoverage/scalac-scoverage-plugin
ScoverageSbtPlugin.instrumentSettings
instrumentSettings

mainClass in (Compile,run) := Some("com.miguno.kafkastorm.storm.KafkaStormDemo")
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.7.4")

// See https://github.com/scoverage/scalac-scoverage-plugin
// and https://github.com/scoverage/sbt-scoverage
addSbtPlugin("org.scoverage" %% "sbt-scoverage" % "0.98.2")
addSbtPlugin("org.scoverage" %% "sbt-scoverage" % "0.99.7.1")

0 comments on commit 32880b3

Please sign in to comment.