Skip to content

Commit 5cd2fe5

Browse files
committed
state that the test task owns the measurement files
1 parent 0ce1fb8 commit 5cd2fe5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class ScoverageExtension {
4444

4545
ScoverageExtension(Project project) {
4646

47-
project.plugins.apply(JavaPlugin.class);
48-
project.plugins.apply(ScalaPlugin.class);
47+
project.plugins.apply(JavaPlugin.class)
48+
project.plugins.apply(ScalaPlugin.class)
4949
project.afterEvaluate(configureRuntimeOptions)
5050

5151
project.configurations.create(ScoveragePlugin.CONFIGURATION_NAME) {
@@ -82,18 +82,18 @@ class ScoverageExtension {
8282
from mainSourceSet.output
8383
}
8484
project.artifacts {
85-
scoverage project.tasks.jarScoverage
85+
scoverage scoverageJar
8686
}
8787

8888
project.tasks.create(ScoveragePlugin.TEST_NAME, Test.class) {
8989
conventionMapping.map("testClassesDir", new Callable<Object>() {
90-
public Object call() throws Exception {
91-
return testSourceSet.output.classesDir;
90+
Object call() throws Exception {
91+
return testSourceSet.output.classesDir
9292
}
9393
})
9494
conventionMapping.map("classpath", new Callable<Object>() {
95-
public Object call() throws Exception {
96-
return testSourceSet.runtimeClasspath;
95+
Object call() throws Exception {
96+
return testSourceSet.runtimeClasspath
9797
}
9898
})
9999
}
@@ -126,7 +126,7 @@ class ScoverageExtension {
126126
File pluginFile
127127
try {
128128
pluginFile = configuration.filter { it.name.contains('plugin') }.iterator().next()
129-
} catch(NoSuchElementException e) {
129+
} catch(NoSuchElementException ignored) {
130130
throw new GradleException("Could not find a plugin jar in configuration '${ScoveragePlugin.CONFIGURATION_NAME}'")
131131
}
132132

@@ -153,7 +153,7 @@ class ScoverageExtension {
153153
// the compile task creates a store of measured statements
154154
outputs.file(new File(extension.dataDir, 'scoverage.coverage.xml'))
155155
}
156-
t.tasks[ScoveragePlugin.TEST_NAME].outputs.dir(extension.dataDir)
156+
t.tasks[ScoveragePlugin.TEST_NAME].outputs.files("${extension.dataDir}/scoverage.measurements.*")
157157
t.tasks[ScoveragePlugin.REPORT_NAME].configure {
158158
inputs.dir(extension.dataDir)
159159
outputs.dir(extension.reportDir)

0 commit comments

Comments
 (0)