Bug 1411654 - Pre: Teach |mach gradle| to take GRADLE_FLAGS from the command line. r=maliu
MozReview-Commit-ID: 150llND5h0j
--- a/mobile/android/mach_commands.py
+++ b/mobile/android/mach_commands.py
@@ -409,17 +409,19 @@ class MachCommands(MachCommandBase):
# Avoid logging the command
self.log_manager.terminal_handler.setLevel(logging.CRITICAL)
# In automation, JAVA_HOME is set via mozconfig, which needs
# to be specially handled in each mach command. This turns
# $JAVA_HOME/bin/java into $JAVA_HOME.
java_home = os.path.dirname(os.path.dirname(self.substs['JAVA']))
- gradle_flags = shell_split(self.substs.get('GRADLE_FLAGS', ''))
+ gradle_flags = self.substs.get('GRADLE_FLAGS', '') or \
+ os.environ.get('GRADLE_FLAGS', '')
+ gradle_flags = shell_split(gradle_flags)
# We force the Gradle JVM to run with the UTF-8 encoding, since we
# filter strings.xml, which is really UTF-8; the ellipsis character is
# replaced with ??? in some encodings (including ASCII). It's not yet
# possible to filter with encodings in Gradle
# (https://github.com/gradle/gradle/pull/520) and it's challenging to
# do our filtering with Gradle's Ant support. Moreover, all of the
# Android tools expect UTF-8: see