Skip to content

Commit e0e2be6

Browse files
committed
Add coverageScalacPluginVersion setting key
Make it easier to change version of scalac-scoverage-plugin dependency
1 parent 24b304f commit e0e2be6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/main/scala/scoverage/ScoverageKeys.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ object ScoverageKeys {
1717
lazy val coverageOutputDebug = settingKey[Boolean]("turn on the debug report")
1818
lazy val coverageCleanSubprojectFiles = settingKey[Boolean]("removes subproject data after an aggregation")
1919
lazy val coverageOutputTeamCity = settingKey[Boolean]("turn on teamcity reporting")
20+
lazy val coverageScalacPluginVersion = settingKey[String]("version of scalac-scoverage-plugin to use")
2021
}

src/main/scala/scoverage/ScoverageSbtPlugin.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ object ScoverageSbtPlugin extends AutoPlugin {
3030
coverageReport <<= coverageReport0,
3131
coverageAggregate <<= coverageAggregate0,
3232
ivyConfigurations := ivyConfigurations.value :+ ScoveragePluginConfig,
33+
coverageScalacPluginVersion := DefaultScoverageVersion,
3334
libraryDependencies ++= {
3435
if (coverageEnabled.value) Seq(
35-
OrgScoverage % (ScalacRuntimeArtifact + "_" + scalaBinaryVersion.value) % DefaultScoverageVersion,
36-
OrgScoverage % (ScalacPluginArtifact + "_" + scalaBinaryVersion.value) % DefaultScoverageVersion % "scoveragePlugin->default(compile)"
36+
OrgScoverage % (ScalacRuntimeArtifact + "_" + scalaBinaryVersion.value) % coverageScalacPluginVersion.value,
37+
OrgScoverage % (ScalacPluginArtifact + "_" + scalaBinaryVersion.value) % coverageScalacPluginVersion.value % "scoveragePlugin->default(compile)"
3738
) else Nil
3839
},
3940
scalacOptions in(Compile, compile) ++= scoverageScalacOptions.value,

0 commit comments

Comments
 (0)