Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'DOCTYPE is disallowed' in build script (gradle 2.1) #30

Open
wants to merge 3 commits into
base: branch_9_5_x
Choose a base branch
from
Open
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
14 changes: 12 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,17 @@ modules_oamp_all.split(',').each{ moduleName ->
gwtModule = moduleProperties['module.gwt']
gwtSourceSetName = moduleName.replace(".", "_")+'_gwt'
println "found GWT module $gwtModule"
def moduleXml = (new XmlParser()).parse(srcGwtDir.toString()+"/" +gwtModule.replaceAll('\\.','/')+'.gwt.xml')
println "gradle version: " + project.getGradle().getGradleVersion()
println "groovy version: " + GroovySystem.getVersion()
def xmlParser
try { // If groovy constructor available (groovy 2_1_9+, 2_2_0_RC2+), disable feature "load-external-dtd"
xmlParser = new XmlParser(false,false,true)
xmlParser.getXMLReader().setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false)
} catch (e) { // Old groovy parser. No need to disable feature
assert e instanceof groovy.lang.GroovyRuntimeException // Could not find matching constructor for: groovy.util.XmlParser(java.lang.Boolean, java.lang.Boolean, java.lang.Boolean)
xmlParser = new XmlParser()
}
def moduleXml = xmlParser.parse(srcGwtDir.toString()+"/" +gwtModule.replaceAll('\\.','/')+'.gwt.xml')
gwtRename = moduleXml['@rename-to']
if (gwtRename==null){
gwtRename=gwtModule
Expand Down Expand Up @@ -313,4 +323,4 @@ install {
}
}
}
}
}