| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 import glob | 3 import glob |
| 4 import json | 4 import json |
| 5 import os | 5 import os |
| 6 import re | 6 import re |
| 7 import shutil | 7 import shutil |
| 8 import string | 8 import string |
| 9 import subprocess | 9 import subprocess |
| 10 import sys | 10 import sys |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 dist_path = os.path.join(_ABB_PATH, obj_dir, "dist") | 82 dist_path = os.path.join(_ABB_PATH, obj_dir, "dist") |
| 83 arch_suffix = _ARCH_X86_I386 if architecture == _ARCH_X86 else _ARCH_ARM | 83 arch_suffix = _ARCH_X86_I386 if architecture == _ARCH_X86 else _ARCH_ARM |
| 84 [manifest_path] = glob.glob(os.path.join( | 84 [manifest_path] = glob.glob(os.path.join( |
| 85 dist_path, "fennec-*.multi.android-%s.json" % arch_suffix)) | 85 dist_path, "fennec-*.multi.android-%s.json" % arch_suffix)) |
| 86 with open(manifest_path) as manifest_file: | 86 with open(manifest_path) as manifest_file: |
| 87 manifest = json.load(manifest_file) | 87 manifest = json.load(manifest_file) |
| 88 apk_name = "fennec-%s.multi.android-%s-unsigned-unaligned.apk" % ( | 88 apk_name = "fennec-%s.multi.android-%s-unsigned-unaligned.apk" % ( |
| 89 manifest["moz_app_version"], architecture) | 89 manifest["moz_app_version"], architecture) |
| 90 apk_path = os.path.join(dist_path, apk_name) | 90 apk_path = os.path.join(dist_path, apk_name) |
| 91 if build_mode == _BUILD_RELEASE: | 91 build_suffix = ("-%s" % manifest["buildid"] |
| 92 target_apk_name = "adblockbrowser-%s-%s.apk" % ( | 92 if build_mode == _BUILD_DEVBUILD |
| 93 manifest["moz_app_version"], architecture) | 93 else "") |
| 94 else: | 94 dist_suffix = ("-%s" % _DIST_STANDALONE |
| 95 target_apk_name = "adblockbrowser-%s.%s-%s.apk" % ( | 95 if distribution_mode == _DIST_STANDALONE |
| 96 manifest["moz_app_version"], manifest["buildid"], architecture) | 96 else "") |
| 97 target_apk_name = "adblockbrowser-%s%s-%s%s.apk" % ( |
| 98 manifest["moz_app_version"], build_suffix, architecture, dist_suffix) |
| 97 target_apk_path = os.path.join(dist_path, target_apk_name) | 99 target_apk_path = os.path.join(dist_path, target_apk_name) |
| 98 shutil.copyfile(apk_path, target_apk_path) | 100 shutil.copyfile(apk_path, target_apk_path) |
| 99 | 101 |
| 100 target_manifest_path = re.sub(r".apk$", ".json", target_apk_path) | 102 target_manifest_path = re.sub(r".apk$", ".json", target_apk_path) |
| 101 shutil.copyfile(manifest_path, target_manifest_path) | 103 shutil.copyfile(manifest_path, target_manifest_path) |
| 102 | 104 |
| 103 return target_apk_path | 105 return target_apk_path |
| 104 | 106 |
| 105 | 107 |
| 106 def _sign(apk_path, key_store, key_name, sdk_path): | 108 def _sign(apk_path, key_store, key_name, sdk_path): |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 sys.exit(6) | 165 sys.exit(6) |
| 164 | 166 |
| 165 if do_build: | 167 if do_build: |
| 166 apk_path = _build(architecture, distribution_mode, build_mode, | 168 apk_path = _build(architecture, distribution_mode, build_mode, |
| 167 config.ANDROID_SDK_PATH, config.ANDROID_NDK_PATH) | 169 config.ANDROID_SDK_PATH, config.ANDROID_NDK_PATH) |
| 168 if do_sign: | 170 if do_sign: |
| 169 _sign(apk_path, config.ANDROID_KEYSTORE_PATH, config.ANDROID_KEY_NAME, | 171 _sign(apk_path, config.ANDROID_KEYSTORE_PATH, config.ANDROID_KEY_NAME, |
| 170 config.ANDROID_SDK_PATH) | 172 config.ANDROID_SDK_PATH) |
| 171 else: | 173 else: |
| 172 print apk_path | 174 print apk_path |
| OLD | NEW |