From 7f2485be49b08006f83e7897ca7c0df961442cab 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/BuildSettings.scala | 13 +++++++++++++ project/plugins.sbt | 1 + 3 files changed, 15 insertions(+) diff --git a/build.sbt b/build.sbt index 30f769f..bd4aeec 100644 --- a/build.sbt +++ b/build.sbt @@ -23,6 +23,7 @@ lazy val root = project.in(file(".")) .settings(BuildSettings.buildSettings) .settings(BuildSettings.publishSettings) .settings(BuildSettings.mimaSettings) + .settings(BuildSettings.scoverageSettings) .settings(Seq( shellPrompt := { _ => name.value + " > " } )) diff --git a/project/BuildSettings.scala b/project/BuildSettings.scala index f87726c..d7acf4c 100644 --- a/project/BuildSettings.scala +++ b/project/BuildSettings.scala @@ -23,6 +23,9 @@ import bintray.BintrayKeys._ import com.typesafe.tools.mima.plugin.MimaKeys._ import com.typesafe.tools.mima.plugin.MimaPlugin +// Scoverage plugin +import scoverage.ScoverageKeys._ + object BuildSettings { // Basic settings for our app @@ -78,4 +81,14 @@ object BuildSettings { (test in Test).value } ) + + val scoverageSettings = 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