aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/bootstrap_commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/servo/bootstrap_commands.py')
-rw-r--r--python/servo/bootstrap_commands.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py
index 00e54c16a88..4ef19b2b45f 100644
--- a/python/servo/bootstrap_commands.py
+++ b/python/servo/bootstrap_commands.py
@@ -85,7 +85,10 @@ class MachCommands(CommandBase):
@CommandArgument('--emulator-x86',
action='store_true',
help='Install Android x86 emulator and system image')
- def bootstrap_android(self, build=False, emulator_x86=False):
+ @CommandArgument('--accept-all-licences',
+ action='store_true',
+ help='For non-interactive use')
+ def bootstrap_android(self, build=False, emulator_x86=False, accept_all_licences=False):
if not (build or emulator_x86):
print("Must specify `--build` or `--emulator-x86` or both.")
@@ -156,9 +159,14 @@ class MachCommands(CommandBase):
components += [
"platforms;android-18",
]
- subprocess.check_call(
- [path.join(toolchains, "sdk", "tools", "bin", "sdkmanager")] + components
- )
+
+ sdkmanager = [path.join(toolchains, "sdk", "tools", "bin", "sdkmanager")] + components
+ if accept_all_licences:
+ yes = subprocess.Popen(["yes"], stdout=subprocess.PIPE)
+ subprocess.check_call(sdkmanager, stdin=yes.stdout)
+ yes.terminate()
+ else:
+ subprocess.check_call(sdkmanager)
if emulator_x86:
avd_path = path.join(toolchains, "avd", "servo-x86")