Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8094389

Gradle build scripts don't work with Gradle 1.12

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 8u60
    • 8u5
    • javafx

      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')

            kcr Kevin Rushforth
            swpalmer Scott Palmer
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: