diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2018-10-11 16:07:24 +0200 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2018-10-11 16:08:41 +0200 |
commit | 6c82c471c526f7d08613ba70659e51d248b07f82 (patch) | |
tree | 25f7b1613de3c94cf6d6bc311889640626adc419 /python/servo/bootstrap_commands.py | |
parent | 89e1878bd6dcc7f7304abbf385ca4a76356b6313 (diff) | |
download | servo-6c82c471c526f7d08613ba70659e51d248b07f82.tar.gz servo-6c82c471c526f7d08613ba70659e51d248b07f82.zip |
Add --accept-all-licences to ./mach bootstrap-android
Diffstat (limited to 'python/servo/bootstrap_commands.py')
-rw-r--r-- | python/servo/bootstrap_commands.py | 16 |
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") |