mirror of
https://github.com/servo/servo.git
synced 2025-06-10 01:23:13 +00:00
parent
6a52ec9484
commit
fe7b443c16
1 changed files with 21 additions and 12 deletions
|
@ -110,6 +110,14 @@ def notify(title, text):
|
||||||
print("[Warning] Could not generate notification! %s" % extra, file=sys.stderr)
|
print("[Warning] Could not generate notification! %s" % extra, file=sys.stderr)
|
||||||
|
|
||||||
|
|
||||||
|
def call(*args, **kwargs):
|
||||||
|
"""Wrap `subprocess.call`, printing the command if verbose=True."""
|
||||||
|
verbose = kwargs.pop('verbose', False)
|
||||||
|
if verbose:
|
||||||
|
print(' '.join(args[0]))
|
||||||
|
subprocess.call(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
@CommandProvider
|
@CommandProvider
|
||||||
class MachCommands(CommandBase):
|
class MachCommands(CommandBase):
|
||||||
@Command('build',
|
@Command('build',
|
||||||
|
@ -187,7 +195,7 @@ class MachCommands(CommandBase):
|
||||||
# Ensure the APK builder submodule has been built first
|
# Ensure the APK builder submodule has been built first
|
||||||
apk_builder_dir = "support/android-rs-glue"
|
apk_builder_dir = "support/android-rs-glue"
|
||||||
with cd(path.join(apk_builder_dir, "apk-builder")):
|
with cd(path.join(apk_builder_dir, "apk-builder")):
|
||||||
subprocess.call(["cargo", "build"], env=self.build_env())
|
call(["cargo", "build"], env=self.build_env(), verbose=verbose)
|
||||||
|
|
||||||
opts += ["--target", "arm-linux-androideabi"]
|
opts += ["--target", "arm-linux-androideabi"]
|
||||||
|
|
||||||
|
@ -212,9 +220,10 @@ class MachCommands(CommandBase):
|
||||||
if jobs is not None:
|
if jobs is not None:
|
||||||
make_cmd += ["-j" + jobs]
|
make_cmd += ["-j" + jobs]
|
||||||
with cd(self.android_support_dir()):
|
with cd(self.android_support_dir()):
|
||||||
status = subprocess.call(
|
status = call(
|
||||||
make_cmd + ["-f", "openssl.makefile"],
|
make_cmd + ["-f", "openssl.makefile"],
|
||||||
env=self.build_env())
|
env=self.build_env(),
|
||||||
|
verbose=verbose)
|
||||||
if status:
|
if status:
|
||||||
return status
|
return status
|
||||||
openssl_dir = path.join(self.android_support_dir(), "openssl-1.0.1k")
|
openssl_dir = path.join(self.android_support_dir(), "openssl-1.0.1k")
|
||||||
|
@ -222,9 +231,9 @@ class MachCommands(CommandBase):
|
||||||
env['OPENSSL_INCLUDE_DIR'] = path.join(openssl_dir, "include")
|
env['OPENSSL_INCLUDE_DIR'] = path.join(openssl_dir, "include")
|
||||||
env['OPENSSL_STATIC'] = 'TRUE'
|
env['OPENSSL_STATIC'] = 'TRUE'
|
||||||
|
|
||||||
status = subprocess.call(
|
status = call(
|
||||||
["cargo", "build"] + opts,
|
["cargo", "build"] + opts,
|
||||||
env=env, cwd=self.servo_crate())
|
env=env, cwd=self.servo_crate(), verbose=verbose)
|
||||||
elapsed = time() - build_start
|
elapsed = time() - build_start
|
||||||
|
|
||||||
# Generate Desktop Notification if elapsed-time > some threshold value
|
# Generate Desktop Notification if elapsed-time > some threshold value
|
||||||
|
@ -259,8 +268,8 @@ class MachCommands(CommandBase):
|
||||||
|
|
||||||
build_start = time()
|
build_start = time()
|
||||||
with cd(path.join("ports", "cef")):
|
with cd(path.join("ports", "cef")):
|
||||||
ret = subprocess.call(["cargo", "build"] + opts,
|
ret = call(["cargo", "build"] + opts,
|
||||||
env=self.build_env())
|
env=self.build_env(), verbose=verbose)
|
||||||
elapsed = time() - build_start
|
elapsed = time() - build_start
|
||||||
|
|
||||||
# Generate Desktop Notification if elapsed-time > some threshold value
|
# Generate Desktop Notification if elapsed-time > some threshold value
|
||||||
|
@ -298,7 +307,7 @@ class MachCommands(CommandBase):
|
||||||
env = self.build_env(gonk=True)
|
env = self.build_env(gonk=True)
|
||||||
build_start = time()
|
build_start = time()
|
||||||
with cd(path.join("ports", "gonk")):
|
with cd(path.join("ports", "gonk")):
|
||||||
ret = subprocess.call(["cargo", "build"] + opts, env=env)
|
ret = call(["cargo", "build"] + opts, env=env, verbose=verbose)
|
||||||
elapsed = time() - build_start
|
elapsed = time() - build_start
|
||||||
|
|
||||||
# Generate Desktop Notification if elapsed-time > some threshold value
|
# Generate Desktop Notification if elapsed-time > some threshold value
|
||||||
|
@ -323,9 +332,9 @@ class MachCommands(CommandBase):
|
||||||
args += ["--no-default-features", "--features", "headless"]
|
args += ["--no-default-features", "--features", "headless"]
|
||||||
if release:
|
if release:
|
||||||
args += ["--release"]
|
args += ["--release"]
|
||||||
return subprocess.call(
|
return call(
|
||||||
args,
|
args,
|
||||||
env=self.build_env(), cwd=self.servo_crate())
|
env=self.build_env(), cwd=self.servo_crate(), verbose=verbose)
|
||||||
|
|
||||||
@Command('clean',
|
@Command('clean',
|
||||||
description='Clean the build directory.',
|
description='Clean the build directory.',
|
||||||
|
@ -347,5 +356,5 @@ class MachCommands(CommandBase):
|
||||||
if verbose:
|
if verbose:
|
||||||
opts += ["-v"]
|
opts += ["-v"]
|
||||||
opts += params
|
opts += params
|
||||||
return subprocess.call(["cargo", "clean"] + opts,
|
return call(["cargo", "clean"] + opts,
|
||||||
env=self.build_env(), cwd=self.servo_crate())
|
env=self.build_env(), cwd=self.servo_crate(), verbose=verbose)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue