diff options
author | Martin Robinson <mrobinson@igalia.com> | 2023-05-18 15:09:30 +0200 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2023-05-19 13:08:43 +0200 |
commit | 5be14ecc3cc92309637604b48bdcf249b110ac16 (patch) | |
tree | ef5f13d8e79866eda1a84c847837938c884ebb2c /python/servo/bootstrap_commands.py | |
parent | e09f85e17bd504a4c1c218ad14fa1a0ecbcaa839 (diff) | |
download | servo-5be14ecc3cc92309637604b48bdcf249b110ac16.tar.gz servo-5be14ecc3cc92309637604b48bdcf249b110ac16.zip |
Start organizing platform-specific Python code
This starts to split platform-specific Python code into its own module,
which should help to tidy up our mach commands and make things more
reusable.
Diffstat (limited to 'python/servo/bootstrap_commands.py')
-rw-r--r-- | python/servo/bootstrap_commands.py | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index aac03c8d645..f75be592e74 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -27,7 +27,8 @@ from mach.decorators import ( Command, ) -import servo.bootstrap as bootstrap +import servo.platform + from servo.command_base import CommandBase, cd, check_call from servo.util import delete, download_bytes, download_file, extract, check_hash @@ -41,10 +42,15 @@ class MachCommands(CommandBase): action='store_true', help='Boostrap without confirmation') def bootstrap(self, force=False): - # This entry point isn't actually invoked, ./mach bootstrap is directly - # called by mach (see mach_bootstrap.bootstrap_command_only) so that + # Note: This entry point isn't actually invoked by ./mach bootstrap. + # ./mach bootstrap calls mach_bootstrap.bootstrap_command_only so that # it can install dependencies without needing mach's dependencies - return bootstrap.bootstrap(self.context, force=force) + try: + servo.platform.get().bootstrap(self.context.sharedir, force) + except NotImplementedError as exception: + print(exception) + return 1 + return 0 @Command('bootstrap-gstreamer', description='Set up a local copy of the gstreamer libraries (linux only).', @@ -53,7 +59,12 @@ class MachCommands(CommandBase): action='store_true', help='Boostrap without confirmation') def bootstrap_gstreamer(self, force=False): - return bootstrap.bootstrap(self.context, force=force, specific="gstreamer") + try: + servo.platform.get().bootstrap_gstreamer(self.context.sharedir, force) + except NotImplementedError as exception: + print(exception) + return 1 + return 0 @Command('bootstrap-android', description='Install the Android SDK and NDK.', |