diff options
author | UK992 <urbankrajnc92@gmail.com> | 2016-12-28 18:27:55 +0100 |
---|---|---|
committer | UK992 <urbankrajnc92@gmail.com> | 2016-12-29 19:19:05 +0100 |
commit | 736559887b9124c9ca2d4eb1922ccbe5a7744371 (patch) | |
tree | 06b832098640135c671aa7d9257b13a6816d7156 /python/servo/package_commands.py | |
parent | 01c7ac785b557304b1008799785f13a725a347ce (diff) | |
download | servo-736559887b9124c9ca2d4eb1922ccbe5a7744371.tar.gz servo-736559887b9124c9ca2d4eb1922ccbe5a7744371.zip |
Package: Move Android packaging to target dir
Fixes #13800
Diffstat (limited to 'python/servo/package_commands.py')
-rw-r--r-- | python/servo/package_commands.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py index c16d89202a5..25de943f7ee 100644 --- a/python/servo/package_commands.py +++ b/python/servo/package_commands.py @@ -148,6 +148,7 @@ class PackageCommands(CommandBase): if android is None: android = self.config["build"]["android"] binary_path = self.get_binary_path(release, dev, android=android) + dir_to_root = self.get_top_dir() if android: if dev: env["NDK_DEBUG"] = "1" @@ -159,25 +160,31 @@ class PackageCommands(CommandBase): target_dir = path.dirname(binary_path) output_apk = "{}.apk".format(binary_path) + + dir_to_apk = path.join(target_dir, "apk") + if path.exists(dir_to_apk): + print("Cleaning up from previous packaging") + delete(dir_to_apk) + shutil.copytree(path.join(dir_to_root, "support", "android", "apk"), dir_to_apk) + blurdroid_path = find_dep_path_newest('blurdroid', binary_path) if blurdroid_path is None: print("Could not find blurdroid package; perhaps you haven't built Servo.") return 1 else: - dir_to_libs = path.join("support", "android", "apk", "libs") + dir_to_libs = path.join(dir_to_apk, "libs") if not path.exists(dir_to_libs): os.makedirs(dir_to_libs) shutil.copy2(blurdroid_path + '/out/blurdroid.jar', dir_to_libs) try: with cd(path.join("support", "android", "build-apk")): subprocess.check_call(["cargo", "run", "--", dev_flag, "-o", output_apk, "-t", target_dir, - "-r", self.get_top_dir()], env=env) + "-r", dir_to_root], env=env) except subprocess.CalledProcessError as e: print("Packaging Android exited with return value %d" % e.returncode) return e.returncode elif is_macosx(): dir_to_build = path.dirname(binary_path) - dir_to_root = self.get_top_dir() print("Creating Servo.app") dir_to_dmg = path.join(dir_to_build, 'dmg') @@ -258,7 +265,6 @@ class PackageCommands(CommandBase): print("Packaged Servo into " + tar_path) elif is_windows(): dir_to_package = path.dirname(binary_path) - dir_to_root = self.get_top_dir() dir_to_msi = path.join(dir_to_package, 'msi') if path.exists(dir_to_msi): print("Cleaning up from previous packaging") @@ -268,7 +274,7 @@ class PackageCommands(CommandBase): print("Copying files") dir_to_resources = path.join(dir_to_msi, 'resources') - shutil.copytree(path.join(self.get_top_dir(), 'resources'), dir_to_resources) + shutil.copytree(path.join(dir_to_root, 'resources'), dir_to_resources) change_prefs(dir_to_resources, "windows") @@ -308,7 +314,7 @@ class PackageCommands(CommandBase): print("Copying files") dir_to_resources = path.join(dir_to_temp, 'resources') - shutil.copytree(path.join(self.get_top_dir(), 'resources'), dir_to_resources) + shutil.copytree(path.join(dir_to_root, 'resources'), dir_to_resources) shutil.copytree(browserhtml_path, path.join(dir_to_temp, 'browserhtml')) shutil.copy(binary_path, dir_to_temp) |