mirror of
https://github.com/servo/servo.git
synced 2025-06-19 14:48:59 +01:00
parent
01c7ac785b
commit
736559887b
2 changed files with 13 additions and 7 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue