changeset 6537:27390e79b4cf

RT-36330: Gradle 1.11 fails to build JFX
author kcr
date Fri, 21 Mar 2014 16:04:59 -0700
parents 1e3c73548b16
children 6c7047fd93f0
files build.gradle gradle.properties.template
diffstat 2 files changed, 36 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Fri Mar 21 15:40:11 2014 -0700
+++ b/build.gradle	Fri Mar 21 16:04:59 2014 -0700
@@ -297,6 +297,11 @@
     apply from: supplementalPreBuildFile
 }
 
+// GRADLE_VERSION_CHECK specifies whether to fail the build if the
+// gradle version check fails
+defineProperty("GRADLE_VERSION_CHECK", "true")
+ext.IS_GRADLE_VERSION_CHECK = Boolean.parseBoolean(GRADLE_VERSION_CHECK)
+
 // COMPILE_WEBKIT specifies whether to build all of webkit.
 defineProperty("COMPILE_WEBKIT", "false")
 ext.IS_COMPILE_WEBKIT = Boolean.parseBoolean(COMPILE_WEBKIT)
@@ -687,7 +692,32 @@
 
 // Check that Gradle 1.8 is in use.
 if (gradle.gradleVersion != "1.8") {
-    logger.warn("Unsupported gradle version $gradle.gradleVersion in use. Only 1.8 is supported")
+    def ver = gradle.gradleVersion.split("[\\.]");
+    def gradleMajor = Integer.parseInt(ver[0]);
+    def gradleMinor = Integer.parseInt(ver[1]);
+    def err = "";
+    if (gradleMajor != 1) {
+        err = "Gradle major version is incompatible: ${gradle.gradleVersion}; expected 1.8";
+    } else {
+        if (gradleMinor < 8) {
+            err = "Gradle version too old: ${gradle.gradleVersion}; must be at least 1.8"
+        }
+
+        // Blacklisted versions of gradle
+        if (gradleMinor == 11) {
+            err = "JavaFX fails to build with Gradle ${gradle.gradleVersion}"
+        }
+    }
+
+    if (IS_GRADLE_VERSION_CHECK && err != "") {
+        fail(err);
+    }
+
+    logger.warn("*****************************************************************");
+    logger.warn("Unsupported gradle version $gradle.gradleVersion in use.");
+    logger.warn("Only version 1.8 is supported. Use this version at your own risk");
+    if ( err != "") logger.warn(err);
+    logger.warn("*****************************************************************");
 }
 
 /******************************************************************************
--- a/gradle.properties.template	Fri Mar 21 15:40:11 2014 -0700
+++ b/gradle.properties.template	Fri Mar 21 16:04:59 2014 -0700
@@ -31,6 +31,11 @@
 #                                                                                   #
 #####################################################################################
 
+# By default, the build will 'fail fast' if the version of gradle is incompatible.
+# Set this flag to false to have it print a warning and try to build anyway.
+
+#GRADLE_VERSION_CHECK = false
+
 # These properties give developers the chance to skip building WebKit and/or
 # GStreamer. WebKit takes a fair amount of time to build (more than 50% of the
 # overall full build time is taken by WebKit), so allowing a developer to