From 34cdaa0c5bfe6eb4aa1fcdd8f741c7efb3f15622 Mon Sep 17 00:00:00 2001 From: Enes Aldemir Date: Thu, 15 Aug 2019 15:28:31 +0300 Subject: [PATCH] Integrate scoverage --- build.sbt | 1 + project/ScoverageSettings.scala | 16 ++++++++++++++++ project/plugins.sbt | 1 + 3 files changed, 18 insertions(+) create mode 100644 project/ScoverageSettings.scala diff --git a/build.sbt b/build.sbt index 8c96204..bbe8974 100644 --- a/build.sbt +++ b/build.sbt @@ -23,6 +23,7 @@ lazy val root = project.in(file(".")) .settings(BuildSettings.buildSettings) .settings(BuildSettings.publishSettings) .settings(MimaSettings.mimaSettings) + .settings(ScoverageSettings.settings) .settings(Seq( shellPrompt := { _ => name.value + " > " } )) diff --git a/project/ScoverageSettings.scala b/project/ScoverageSettings.scala new file mode 100644 index 0000000..689bbc8 --- /dev/null +++ b/project/ScoverageSettings.scala @@ -0,0 +1,16 @@ +import scoverage.ScoverageKeys._ +import sbt.Keys._ +import sbt._ + +object ScoverageSettings { + + val settings = Seq( + coverageEnabled := true, + coverageMinimum := 80, + coverageFailOnMinimum := true, + coverageHighlighting := false, + (test in Test) := { + (coverageReport dependsOn (test in Test)).value + } + ) +} diff --git a/project/plugins.sbt b/project/plugins.sbt index 5f167a6..5888fe2 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,2 +1,3 @@ addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.3") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.5.0") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.0") \ No newline at end of file