Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-bin.zip
distributionUrl=http\://services.gradle.org/distributions/gradle-2.0-bin.zip
10 changes: 9 additions & 1 deletion src/main/groovy/org/scoverage/OverallCheckTask.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,21 @@ class OverallCheckTask extends DefaultTask {
File cobertura
double minimumLineRate = 0.75

protected XmlParser parser;

OverallCheckTask() {
parser = new XmlParser()
parser.setFeature('http://apache.org/xml/features/disallow-doctype-decl', false)
parser.setFeature('http://apache.org/xml/features/nonvalidating/load-external-dtd', false)
}

@TaskAction
void requireLineCoverage() {
def extension = ScoveragePlugin.extensionIn(project)

if (cobertura == null) cobertura = new File(extension.reportDir, 'cobertura.xml')

def xml = new XmlParser().parse(cobertura)
def xml = parser.parse(cobertura)
def overallLineRate = xml.attribute('line-rate').toDouble()
def difference = (minimumLineRate - overallLineRate)

Expand Down