mirror of
https://github.com/servo/servo.git
synced 2025-06-20 15:18:58 +01:00
Package: Small cleanup
This commit is contained in:
parent
736559887b
commit
fe7cb599a0
1 changed files with 9 additions and 12 deletions
|
@ -149,6 +149,7 @@ class PackageCommands(CommandBase):
|
|||
android = self.config["build"]["android"]
|
||||
binary_path = self.get_binary_path(release, dev, android=android)
|
||||
dir_to_root = self.get_top_dir()
|
||||
target_dir = path.dirname(binary_path)
|
||||
if android:
|
||||
if dev:
|
||||
env["NDK_DEBUG"] = "1"
|
||||
|
@ -158,7 +159,6 @@ class PackageCommands(CommandBase):
|
|||
env["ANT_FLAVOR"] = "release"
|
||||
dev_flag = ""
|
||||
|
||||
target_dir = path.dirname(binary_path)
|
||||
output_apk = "{}.apk".format(binary_path)
|
||||
|
||||
dir_to_apk = path.join(target_dir, "apk")
|
||||
|
@ -184,10 +184,8 @@ class PackageCommands(CommandBase):
|
|||
print("Packaging Android exited with return value %d" % e.returncode)
|
||||
return e.returncode
|
||||
elif is_macosx():
|
||||
dir_to_build = path.dirname(binary_path)
|
||||
|
||||
print("Creating Servo.app")
|
||||
dir_to_dmg = path.join(dir_to_build, 'dmg')
|
||||
dir_to_dmg = path.join(target_dir, 'dmg')
|
||||
dir_to_app = path.join(dir_to_dmg, 'Servo.app')
|
||||
dir_to_resources = path.join(dir_to_app, 'Contents', 'Resources')
|
||||
if path.exists(dir_to_dmg):
|
||||
|
@ -230,7 +228,7 @@ class PackageCommands(CommandBase):
|
|||
|
||||
print("Creating dmg")
|
||||
os.symlink('/Applications', path.join(dir_to_dmg, 'Applications'))
|
||||
dmg_path = path.join(dir_to_build, "servo-tech-demo.dmg")
|
||||
dmg_path = path.join(target_dir, "servo-tech-demo.dmg")
|
||||
|
||||
try:
|
||||
subprocess.check_call(['hdiutil', 'create', '-volname', 'Servo', dmg_path, '-srcfolder', dir_to_dmg])
|
||||
|
@ -242,8 +240,8 @@ class PackageCommands(CommandBase):
|
|||
print("Packaged Servo into " + dmg_path)
|
||||
|
||||
print("Creating brew package")
|
||||
dir_to_brew = path.join(dir_to_build, 'brew_tmp')
|
||||
dir_to_tar = path.join(dir_to_build, 'brew')
|
||||
dir_to_brew = path.join(target_dir, 'brew_tmp')
|
||||
dir_to_tar = path.join(target_dir, 'brew')
|
||||
if not path.exists(dir_to_tar):
|
||||
os.makedirs(dir_to_tar)
|
||||
tar_path = path.join(dir_to_tar, "servo.tar.gz")
|
||||
|
@ -264,8 +262,7 @@ class PackageCommands(CommandBase):
|
|||
delete(dir_to_brew)
|
||||
print("Packaged Servo into " + tar_path)
|
||||
elif is_windows():
|
||||
dir_to_package = path.dirname(binary_path)
|
||||
dir_to_msi = path.join(dir_to_package, 'msi')
|
||||
dir_to_msi = path.join(target_dir, 'msi')
|
||||
if path.exists(dir_to_msi):
|
||||
print("Cleaning up from previous packaging")
|
||||
delete(dir_to_msi)
|
||||
|
@ -283,7 +280,7 @@ class PackageCommands(CommandBase):
|
|||
template = Template(open(template_path).read())
|
||||
wxs_path = path.join(dir_to_msi, "Servo.wxs")
|
||||
open(wxs_path, "w").write(template.render(
|
||||
exe_path=dir_to_package,
|
||||
exe_path=target_dir,
|
||||
resources_path=dir_to_resources,
|
||||
browserhtml_path=browserhtml_path))
|
||||
|
||||
|
@ -305,7 +302,7 @@ class PackageCommands(CommandBase):
|
|||
msi_path = path.join(dir_to_msi, "Servo.msi")
|
||||
print("Packaged Servo into {}".format(msi_path))
|
||||
else:
|
||||
dir_to_temp = path.join(path.dirname(binary_path), 'packaging-temp')
|
||||
dir_to_temp = path.join(target_dir, 'packaging-temp')
|
||||
browserhtml_path = get_browserhtml_path(binary_path)
|
||||
if path.exists(dir_to_temp):
|
||||
# TODO(aneeshusa): lock dir_to_temp to prevent simultaneous builds
|
||||
|
@ -321,7 +318,7 @@ class PackageCommands(CommandBase):
|
|||
change_prefs(dir_to_resources, "linux")
|
||||
|
||||
print("Creating tarball")
|
||||
tar_path = path.join(path.dirname(binary_path), 'servo-tech-demo.tar.gz')
|
||||
tar_path = path.join(target_dir, 'servo-tech-demo.tar.gz')
|
||||
|
||||
archive_deterministically(dir_to_temp, tar_path, prepend_path='servo/')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue