We are trying out gradle 2.12 with our existing build and it appears to have an issue which doesn’t exist with the previous versions. I’ve been able to define a simple build.gradle file which reproduces the issue. This build file works perfectly fine with gradle 2.9 and 2.11 but with 2.12 the error message when processing the build.gradle is:
FAILURE: Build failed with an exception.
-
Where:
Build file ‘***********/build.gradle’ line: 9 -
What went wrong:
Could not compile build file ‘******/build.gradle’.
startup failed:
build file ‘***********/build.gradle’: 9: unable to resolve class Map.Entry
@ line 9, column 1.
for(Map.Entry entry : properties.entrySet()) {
^
1 error
The build.gradle contents:
apply plugin: ‘base’
Properties properties = new Properties()
File propertiesFile = new File(rootProject.projectDir, ‘gradle.properties’)
propertiesFile.withInputStream {
properties.load(it)
}
for(Map.Entry entry : properties.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
rootProject.ext.setProperty(key, value)
println “${key}=${value}”
}
And the gradle.properties in the same directory just has:
TEST_PROPERTY=value
With older releases of gradle the file works:
gradle build
TEST_PROPERTY=value
:assemble UP-TO-DATE
:check UP-TO-DATE
:build UP-TO-DATE
BUILD SUCCESSFUL
Total time: 3.335 secs