Skip to content

Commit e8207ed

Browse files
committed
Merge pull request #9 from maiflai/master
Gradle 2.0 gives "DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true"
2 parents a2bb162 + 81be312 commit e8207ed

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-bin.zip
6+
distributionUrl=http\://services.gradle.org/distributions/gradle-2.0-bin.zip

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,21 @@ class OverallCheckTask extends DefaultTask {
1111
File cobertura
1212
double minimumLineRate = 0.75
1313

14+
protected XmlParser parser;
15+
16+
OverallCheckTask() {
17+
parser = new XmlParser()
18+
parser.setFeature('http://apache.org/xml/features/disallow-doctype-decl', false)
19+
parser.setFeature('http://apache.org/xml/features/nonvalidating/load-external-dtd', false)
20+
}
21+
1422
@TaskAction
1523
void requireLineCoverage() {
1624
def extension = ScoveragePlugin.extensionIn(project)
1725

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

20-
def xml = new XmlParser().parse(cobertura)
28+
def xml = parser.parse(cobertura)
2129
def overallLineRate = xml.attribute('line-rate').toDouble()
2230
def difference = (minimumLineRate - overallLineRate)
2331

0 commit comments

Comments
 (0)