Gradle 1.12 fails to compile the build scripts.
The main issue I encountered was the use of a defineProperty method from build.gradle in the platform-specific build scripts, e.g. buildSrc/windows.gradle, buildSrc/mac.gradle.
According to the Gradle documentation at http://www.gradle.org/docs/current/userguide/writing_build_scripts.html
the scope of a method is the script it is defined in.
To add a method to the Project you would need to use a Convention object.
Consider using a closure instead:
ext.defineProperty = { name, defaultValue ->
if (!project.hasProperty(name)) {
project.ext.set(name, defaultValue);
}
}
Or factor out the utility methods into a common.gradle script and use something like:
apply from: rootProject.file('common.gradle')
The main issue I encountered was the use of a defineProperty method from build.gradle in the platform-specific build scripts, e.g. buildSrc/windows.gradle, buildSrc/mac.gradle.
According to the Gradle documentation at http://www.gradle.org/docs/current/userguide/writing_build_scripts.html
the scope of a method is the script it is defined in.
To add a method to the Project you would need to use a Convention object.
Consider using a closure instead:
ext.defineProperty = { name, defaultValue ->
if (!project.hasProperty(name)) {
project.ext.set(name, defaultValue);
}
}
Or factor out the utility methods into a common.gradle script and use something like:
apply from: rootProject.file('common.gradle')
- duplicates
-
JDK-8098276 Allow building with gradle 2.X
- Resolved