Bug 1123416 - Restrict $topsrcdir/build.gradle to Fennec. r?sebastian draft
authorNick Alexander <nalexander@mozilla.com>
Tue, 20 Oct 2015 10:32:26 -0700
changeset 302080 2a407cd3a276307c9cbe73b78f7229f5859af7fa
parent 302079 25e10abb1ef5eab6949e4d9227663f99f91ff967
child 302090 aaf35d340d876a4e828d7a318c90a451b1a966e3
push id6556
push usernalexander@mozilla.com
push dateTue, 20 Oct 2015 17:34:07 +0000
reviewerssebastian
bugs1123416
milestone44.0a1
Bug 1123416 - Restrict $topsrcdir/build.gradle to Fennec. r?sebastian
settings.gradle
--- a/settings.gradle
+++ b/settings.gradle
@@ -12,16 +12,20 @@ proc.waitFor()
 if (proc.exitValue() != 0) {
     throw new GradleException("Process '${commandLine}' finished with non-zero exit value ${proc.exitValue()}:\n\n${standardOutput.toString()}")
 }
 
 import groovy.json.JsonSlurper
 def slurper = new JsonSlurper()
 def json = slurper.parseText(standardOutput.toString())
 
+if (json.substs.MOZ_BUILD_APP != 'mobile/android') {
+    throw new GradleException("Building with Gradle is only supported for Fennec, i.e., MOZ_BUILD_APP == 'mobile/android'.");
+}
+
 include ':app'
 include ':base'
 include ':omnijar'
 include ':thirdparty'
 
 def gradleRoot = new File("${json.topobjdir}/mobile/android/gradle")
 project(':app').projectDir = new File(gradleRoot, 'app')
 project(':base').projectDir = new File(gradleRoot, 'base')