Skip to content

Commit e9bea43

Browse files
committed
sbt-scripted test to verify if coverageScalacPluginVersion is taken into account
1 parent e0e2be6 commit e9bea43

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
lazy val root = (project in file(".")).settings(
2+
coverageEnabled := true,
3+
coverageScalacPluginVersion := "1.1.0"
4+
)
5+
TaskKey[Unit]("check") := {
6+
assert(
7+
libraryDependencies.value
8+
.filter(module =>
9+
module.organization == "org.scoverage" && module.revision == "1.1.0")
10+
.size == 2)
11+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// The Typesafe repository
2+
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
3+
4+
//scoverage needs this
5+
resolvers += Classpaths.sbtPluginReleases
6+
7+
{
8+
val pluginVersion = System.getProperty("plugin.version")
9+
if(pluginVersion == null)
10+
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
11+
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
12+
else addSbtPlugin("org.scoverage" %% "sbt-scoverage" % pluginVersion)
13+
}
14+
15+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# assert coverageScalacPluginVersion is taken into account when generating libraryDependencies
2+
> check

0 commit comments

Comments
 (0)