Skip to content

Commit 38700ca

Browse files
committed
incorrect location for report file
1 parent 2689ff4 commit 38700ca

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/main/groovy/org/scoverage/OverallCheckTask.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class OverallCheckTask extends DefaultTask {
1515
void requireLineCoverage() {
1616
def extension = ScoveragePlugin.extensionIn(project)
1717

18-
if (cobertura == null) cobertura = new File(extension.dataDir, 'cobertura.xml')
18+
if (cobertura == null) cobertura = new File(extension.reportDir, 'cobertura.xml')
1919

2020
def xml = new XmlParser().parse(cobertura)
2121
def overallLineRate = xml.attribute('line-rate').toDouble()

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ class ScoverageExtension {
2121
/** a directory to write final output to */
2222
File reportDir
2323
/** sources to highlight */
24-
SourceSet sourceSet
25-
24+
File sources
2625

2726
ScoverageExtension(Project project) {
2827

@@ -36,7 +35,7 @@ class ScoverageExtension {
3635
description = 'Scoverage dependencies'
3736
}
3837

39-
sourceSet = project.sourceSets.create(ScoveragePlugin.CONFIGURATION_NAME) {
38+
project.sourceSets.create(ScoveragePlugin.CONFIGURATION_NAME) {
4039
def mainSourceSet = project.sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME)
4140

4241
java.source(mainSourceSet.java)
@@ -50,17 +49,16 @@ class ScoverageExtension {
5049
dependsOn(project.tasks[ScoveragePlugin.COMPILE_NAME])
5150
}
5251

53-
project.tasks.create(ScoveragePlugin.CHECK_NAME, OverallCheckTask.class) {
52+
project.tasks.create(ScoveragePlugin.REPORT_NAME, JavaExec.class) {
5453
dependsOn(project.tasks[ScoveragePlugin.TEST_NAME])
5554
}
5655

57-
project.tasks.create(ScoveragePlugin.REPORT_NAME, JavaExec.class) {
58-
dependsOn(project.tasks[ScoveragePlugin.TEST_NAME])
56+
project.tasks.create(ScoveragePlugin.CHECK_NAME, OverallCheckTask.class) {
57+
dependsOn(project.tasks[ScoveragePlugin.REPORT_NAME])
5958
}
6059

6160
dataDir = new File(project.buildDir, 'scoverage')
6261
reportDir = new File(project.buildDir, 'reports' + File.separatorChar + 'scoverage')
63-
6462
}
6563

6664
private Action<Project> configureRuntimeOptions = new Action<Project>() {
@@ -69,6 +67,7 @@ class ScoverageExtension {
6967
void execute(Project t) {
7068

7169
def extension = ScoveragePlugin.extensionIn(t)
70+
extension.sources = t.sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME).scala.srcDirs.iterator().next() as File
7271
extension.dataDir.mkdirs()
7372
extension.reportDir.mkdirs()
7473

@@ -102,7 +101,7 @@ class ScoverageExtension {
102101
project.configurations[ScoveragePlugin.CONFIGURATION_NAME]
103102
main = 'org.scoverage.ScoverageReport'
104103
args = [
105-
extension.sourceSet.allSource.iterator().next().absolutePath,
104+
extension.sources,
106105
extension.dataDir.absolutePath,
107106
extension.reportDir.absolutePath
108107
]

0 commit comments

Comments
 (0)