changeset 4265:f3c2a366c257

Fix FT-31507 property canBuild set to false doesn't stop the build. Remove compile target if it has canBuild set to false. Reviewed by RichardB.
author tb115823 <Tomas.Brandalik@oracle.com>
date Thu, 11 Jul 2013 10:25:33 +0200
parents 11d12ec5d040
children 406c46acc988
files build.gradle
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Thu Jul 11 09:06:53 2013 +0200
+++ b/build.gradle	Thu Jul 11 10:25:33 2013 +0200
@@ -136,6 +136,9 @@
  * @param c The closure to call
  */
 void compileTargets(Closure c) {
+    if (COMPILE_TARGETS == "") {
+        return
+    }
     COMPILE_TARGETS.split(",").each { target ->
         CompileTarget ct = new CompileTarget();
         ct.name = target;
@@ -489,6 +492,16 @@
     }
 }
 
+if (COMPILE_TARGETS != "") {
+    def tmp = []
+    COMPILE_TARGETS.split(",").each {target ->
+        if (project.ext["${target.toUpperCase()}"].canBuild) {
+            tmp.add(target)
+        }
+    }
+    COMPILE_TARGETS = tmp.collect { "${it.toLowerCase()}"}.join(",")
+}
+
 // Sanity check the expected properties all exist
 compileTargets { t ->
     // Every platform must define these variables