mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
servo: Merge #8891 - Android build system improvements (from mbrubeck:mach-install); r=larsbergstrom
This PR adds a `mach install` command (a convenient way to run `adb install`), and does some minor code cleanup. It also fixes parallelism in the OpenSSL build. For [complicated reasons][1], a sub-Make will not inherit `-j` options from its parent process unless it is invoked directly from another Makefile. This means we should run make from openssl.makefile rather than openssl.sh. r? @larsbergstrom [1]: http://make.mad-scientist.net/papers/jobserver-implementation/ Source-Repo: https://github.com/servo/servo Source-Revision: a1fb12616a29d2190baadd20d7763af1d9c02260
This commit is contained in:
parent
1e2a317f1b
commit
7af235e026
@ -194,10 +194,7 @@ class PostBuildCommands(CommandBase):
|
||||
help='Package the release build')
|
||||
@CommandArgument('--dev', '-d', action='store_true',
|
||||
help='Package the dev build')
|
||||
@CommandArgument(
|
||||
'params', nargs='...',
|
||||
help="Command-line arguments to be passed through to Servo")
|
||||
def package(self, params, release=False, dev=False, debug=False, debugger=None):
|
||||
def package(self, release=False, dev=False, debug=False, debugger=None):
|
||||
env = self.build_env()
|
||||
binary_path = self.get_binary_path(release, dev, android=True)
|
||||
|
||||
@ -218,3 +215,26 @@ class PostBuildCommands(CommandBase):
|
||||
except subprocess.CalledProcessError as e:
|
||||
print("Packaging Android exited with return value %d" % e.returncode)
|
||||
return e.returncode
|
||||
|
||||
@Command('install',
|
||||
description='Install Servo (currently, Android only)',
|
||||
category='post-build')
|
||||
@CommandArgument('--release', '-r', action='store_true',
|
||||
help='Package the release build')
|
||||
@CommandArgument('--dev', '-d', action='store_true',
|
||||
help='Package the dev build')
|
||||
def install(self, release=False, dev=False):
|
||||
binary_path = self.get_binary_path(release, dev, android=True)
|
||||
if not path.exists(binary_path):
|
||||
# TODO: Run the build command automatically?
|
||||
print("Servo build not found. Please run `./mach build` to compile Servo.")
|
||||
return 1
|
||||
|
||||
apk_path = binary_path + ".apk"
|
||||
if not path.exists(apk_path):
|
||||
result = Registrar.dispatch("package", context=self.context, release=release, dev=dev)
|
||||
if result is not 0:
|
||||
return result
|
||||
|
||||
print(["adb", "install", "-r", apk_path])
|
||||
return subprocess.call(["adb", "install", "-r", apk_path], env=self.build_env())
|
||||
|
3
servo/support/android/.gitignore
vendored
3
servo/support/android/.gitignore
vendored
@ -1,3 +0,0 @@
|
||||
openssl-1.0.1k/
|
||||
openssl-1.0.1k.tar.gz
|
||||
|
6
servo/support/android/apk/.gitignore
vendored
Normal file
6
servo/support/android/apk/.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/assets/
|
||||
/bin/
|
||||
/gen/
|
||||
/libs/
|
||||
/local.properties
|
||||
/proguard-project.txt
|
Loading…
Reference in New Issue
Block a user