diff options
-rw-r--r-- | python/servo/post_build_commands.py | 28 | ||||
-rw-r--r-- | support/android/.gitignore | 3 | ||||
-rw-r--r-- | support/android/apk/.gitignore | 6 |
3 files changed, 30 insertions, 7 deletions
diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py index 4d69e976e37..682fae4da25 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) @@ -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()) 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 |