Index: third_party/apk-patch-size-estimator/apk_patch_size_estimator.py |
diff --git a/third_party/apk-patch-size-estimator/apk_patch_size_estimator.py b/third_party/apk-patch-size-estimator/apk_patch_size_estimator.py |
index 1be08e731a2e1610e60058c9d4ac037568bfe73c..64b4bb635b6a355d1d249a99048a0fed024d8cd8 100755 |
--- a/third_party/apk-patch-size-estimator/apk_patch_size_estimator.py |
+++ b/third_party/apk-patch-size-estimator/apk_patch_size_estimator.py |
@@ -36,6 +36,9 @@ import math |
import os |
import subprocess |
+_FILEBYFILE_JAR_PATH = os.path.abspath( |
+ os.path.join(os.path.dirname(__file__), 'lib', 'file-by-file-tools.jar')) |
+ |
bsdiff_path = None |
gzip_path = None |
head_path = None |
@@ -259,8 +262,8 @@ def calculate_filebyfile(old_file, new_file, save_patch_path, temp_path): |
# We use a jar from https://github.com/andrewhayden/archive-patcher |
if os.path.exists(filebyfile_patch_path): os.remove(filebyfile_patch_path) |
p = subprocess.Popen( |
- [java_path, '-jar', 'lib/file-by-file-tools.jar', '--generate', |
- '--old', old_file, '--new', new_file, '--patch', filebyfile_patch_path], |
+ [java_path, '-jar', _FILEBYFILE_JAR_PATH, '--generate', '--old', old_file, |
+ '--new', new_file, '--patch', filebyfile_patch_path], |
shell=False) |
ret_code = p.wait() |
if ret_code != 0: raise Exception( |