Skip to content

Commit 5562ed7

Browse files
committed
only append scalac options if there are excluded packages
1 parent f73c57e commit 5562ed7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/groovy/org/scoverage/ScoverageExtension.groovy

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class ScoverageExtension {
2424
File sources
2525
/** range positioning for highlighting */
2626
boolean highlighting = true
27-
/** regex of excluded packages, separated by semicolons */
28-
String excludedPackages = ""
27+
/** regex for each excluded package */
28+
List<String> excludedPackages = []
2929

3030
ScoverageExtension(Project project) {
3131

@@ -87,7 +87,9 @@ class ScoverageExtension {
8787
plugin.addAll(parameters)
8888
}
8989
plugin.add("-P:scoverage:dataDir:${extension.dataDir.absolutePath}".toString())
90-
plugin.add("-P:scoverage:excludedPackages:${extension.excludedPackages}".toString())
90+
if (extension.excludedPackages) {
91+
plugin.add("-P:scoverage:excludedPackages:${extension.excludedPackages.join(';')}".toString())
92+
}
9193
if (extension.highlighting) {
9294
plugin.add('-Yrangepos')
9395
}

0 commit comments

Comments
 (0)