Bug 1789051 - Disable browser_view_selectionByMouse.js on a11y-checks for permafailin...
[gecko.git] / settings.gradle
blob31d412bf641824a9810570f951620610eb929606
1 // You might think topsrcdir is '.', but that's not true when the Gradle build
2 // is launched from within IntelliJ.
3 def topsrcdir = rootProject.projectDir.absolutePath
5 apply from: "${topsrcdir}/mobile/android/gradle/mach_env.gradle"
7 def commandLine = ["${topsrcdir}/mach", "environment", "--format", "json", "--verbose"]
8 if (System.env.GRADLE_MACH_PYTHON) {
9     commandLine.addAll(0, [System.env.GRADLE_MACH_PYTHON])
10 } else if (System.properties["os.name"].contains("Windows")) {
11     commandLine.addAll(0, ["python"])
14 def proc = commandLine.execute(machEnv(topsrcdir), new File(topsrcdir))
15 def standardOutput = new ByteArrayOutputStream()
16 def standardError = new ByteArrayOutputStream()
17 proc.consumeProcessOutput(standardOutput, standardError)
18 proc.waitFor()
20 // Only show the output if something went wrong.
21 if (proc.exitValue() != 0) {
22     logger.info("Error running ./mach environment: \n\n"
23         + "Process '${commandLine}' finished with non-zero exit value ${proc.exitValue()}:\n\n"
24         + "stdout:\n"
25         + "${standardOutput.toString()}\n\n"
26         + "stderr:\n"
27         + "${standardError.toString()}")
28     throw new StopExecutionException(
29             "Could not run ./mach environment. Try running ./mach build first.")
32 import groovy.json.JsonSlurper
34 def slurper = new JsonSlurper()
35 def json = slurper.parseText(standardOutput.toString())
37 if (json.substs.MOZ_BUILD_APP != 'mobile/android') {
38     throw new GradleException("Building with Gradle is only supported for Fennec, i.e., MOZ_BUILD_APP == 'mobile/android'.")
41 // Set the Android SDK location.  This is the *least specific* mechanism, which
42 // is unfortunate: we'd prefer to use the *most specific* mechanism.  That is,
43 // local.properties (first 'sdk.dir', then 'android.dir') and then the
44 // environment variable ANDROID_HOME will override this.  That's unfortunate,
45 // but it's hard to automatically arrange better.
46 System.setProperty('android.home', json.substs.ANDROID_SDK_ROOT)
48 include ':annotations', ':messaging_example', ':port_messaging_example'
49 include ':geckoview'
50 include ':geckoview_example'
51 include ':test_runner'
52 include ':exoplayer2'
54 project(':annotations').projectDir = new File("${json.topsrcdir}/mobile/android/annotations")
55 project(':geckoview').projectDir = new File("${json.topsrcdir}/mobile/android/geckoview")
56 project(':geckoview_example').projectDir = new File("${json.topsrcdir}/mobile/android/geckoview_example")
57 project(':test_runner').projectDir = new File("${json.topsrcdir}/mobile/android/test_runner")
58 project(':exoplayer2').projectDir = new File("${json.topsrcdir}/mobile/android/exoplayer2")
60 if (hasProperty("androidFormatLintTest")) {
61     include ':androidFormatLintTest'
62     project(':androidFormatLintTest').projectDir = new File("${json.topsrcdir}/tools/lint/test/files/android-format")
65 // The Gradle instance is shared between settings.gradle and all the
66 // other build.gradle files (see
67 // http://forums.gradle.org/gradle/topics/define_extension_properties_from_settings_xml).
68 // We use this ext property to pass the per-object-directory mozconfig
69 // between scripts.  This lets us execute set-up code before we gradle
70 // tries to configure the project even once, and as a side benefit
71 // saves invoking |mach environment| multiple times.
72 gradle.ext.mozconfig = json
74 // Produced by `mach build`.  Bug 1543982: the mozconfig determined by `mach
75 // environment` above can be different because `mach build` itself sets certain
76 // critical environment variables including MOZ_OBJDIR, CC, and CXX.  We use
77 // this record to patch up the environment when we recursively invoke `mach
78 // build ...` commands from within Gradle.  This avoids invalidating configure
79 // based on the changed environment variables.
80 def orig = slurper.parse(new File(json.topobjdir, '.mozconfig.json'))
81 gradle.ext.mozconfig.orig_mozconfig = orig.mozconfig
82 project(':messaging_example').projectDir = new File('mobile/android/examples/messaging_example/app')
83 project(':port_messaging_example').projectDir = new File('mobile/android/examples/port_messaging_example/app')