aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/command_base.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/servo/command_base.py')
-rw-r--r--python/servo/command_base.py27
1 files changed, 24 insertions, 3 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index 01dac1ca7fb..d5b1881618b 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -520,9 +520,9 @@ class CommandBase(object):
return env
@staticmethod
- def common_command_arguments(build_configuration=False, build_type=False):
+ def common_command_arguments(build_configuration=False, build_type=False, binary_selection=False):
decorators = []
- if build_type:
+ if build_type or binary_selection:
decorators += [
CommandArgumentGroup('Build Type'),
CommandArgument('--release', '-r', group="Build Type",
@@ -591,9 +591,18 @@ class CommandBase(object):
)
]
+ if binary_selection:
+ decorators += [
+ CommandArgumentGroup('Binary selection'),
+ CommandArgument('--bin', default=None,
+ help='Launch with specific binary'),
+ CommandArgument('--nightly', '-n', default=None,
+ help='Specify a YYYY-MM-DD nightly build to run'),
+ ]
+
def decorator_function(original_function):
def configuration_decorator(self, *args, **kwargs):
- if build_type:
+ if build_type or binary_selection:
# If `build_type` already exists in kwargs we are doing a recursive dispatch.
if 'build_type' not in kwargs:
kwargs['build_type'] = self.configure_build_type(
@@ -609,6 +618,18 @@ class CommandBase(object):
self.features = kwargs.get("features", None) or []
self.enable_media = self.is_media_enabled(kwargs['media_stack'])
+ if binary_selection:
+ if 'servo_binary' not in kwargs:
+ kwargs['servo_binary'] = (kwargs.get('bin')
+ or self.get_nightly_binary_path(kwargs.get('nightly'))
+ or self.get_binary_path(kwargs.get('build_type'),
+ asan=kwargs.get('with_asan')))
+ kwargs.pop('bin')
+ kwargs.pop('nightly')
+ if not build_type:
+ kwargs.pop('build_type')
+ kwargs.pop('with_asan')
+
return original_function(self, *args, **kwargs)
decorators.reverse()