aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorUK992 <urbankrajnc92@gmail.com>2016-12-29 19:18:18 +0100
committerUK992 <urbankrajnc92@gmail.com>2016-12-29 19:21:18 +0100
commitfe7cb599a0b77aca165373402279c340660299a1 (patch)
tree8d82ffba2bf03562b2d36e40fef425a39160eee8 /python
parent736559887b9124c9ca2d4eb1922ccbe5a7744371 (diff)
downloadservo-fe7cb599a0b77aca165373402279c340660299a1.tar.gz
servo-fe7cb599a0b77aca165373402279c340660299a1.zip
Package: Small cleanup
Diffstat (limited to 'python')
-rw-r--r--python/servo/package_commands.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py
index 25de943f7ee..64536fa24db 100644
--- a/python/servo/package_commands.py
+++ b/python/servo/package_commands.py
@@ -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/')