From 96dc0eb8892821627c287e6fa71e1ce03e7eb917 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Tue, 8 Dec 2015 10:53:58 -0800 Subject: [PATCH 1/3] Update .gitignore files --- support/android/.gitignore | 3 --- support/android/apk/.gitignore | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) delete mode 100644 support/android/.gitignore create mode 100644 support/android/apk/.gitignore diff --git a/support/android/.gitignore b/support/android/.gitignore deleted file mode 100644 index 1071c3d9fe4..00000000000 --- a/support/android/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -openssl-1.0.1k/ -openssl-1.0.1k.tar.gz - diff --git a/support/android/apk/.gitignore b/support/android/apk/.gitignore new file mode 100644 index 00000000000..4d87ae843a8 --- /dev/null +++ b/support/android/apk/.gitignore @@ -0,0 +1,6 @@ +/assets/ +/bin/ +/gen/ +/libs/ +/local.properties +/proguard-project.txt From 2a00eb6c08409e174c09d96e23f07d7c41b58b7e Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Tue, 8 Dec 2015 11:12:38 -0800 Subject: [PATCH 2/3] Remove unused params from mach package command --- python/servo/post_build_commands.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py index 4d69e976e37..ee57ebf73dd 100644 --- a/python/servo/post_build_commands.py +++ b/python/servo/post_build_commands.py @@ -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) From 53871321a3b22f14e31868405a9f98b31b529acc Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Tue, 8 Dec 2015 11:13:08 -0800 Subject: [PATCH 3/3] Add mach install command (Android-only for now) --- python/servo/post_build_commands.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py index ee57ebf73dd..682fae4da25 100644 --- a/python/servo/post_build_commands.py +++ b/python/servo/post_build_commands.py @@ -215,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())