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 shutil | 6 import shutil |
7 import subprocess | 7 import subprocess |
8 import sys | 8 import sys |
9 import tempfile | 9 import tempfile |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 "'%s' doesn't seem to set --disable-updater, please do." % path) | 44 "'%s' doesn't seem to set --disable-updater, please do." % path) |
45 | 45 |
46 def find_mozconfig(mode): | 46 def find_mozconfig(mode): |
47 mozconfig_path = os.path.join(BASE_DIR, "mozconfig-" + mode) | 47 mozconfig_path = os.path.join(BASE_DIR, "mozconfig-" + mode) |
48 check_mozconfig(mozconfig_path, mode) | 48 check_mozconfig(mozconfig_path, mode) |
49 return mozconfig_path | 49 return mozconfig_path |
50 | 50 |
51 def build(mode): | 51 def build(mode): |
52 mozharness_environment = os.environ.copy() | 52 mozharness_environment = os.environ.copy() |
53 mozharness_environment["MOZCONFIG"] = find_mozconfig(mode) | 53 mozharness_environment["MOZCONFIG"] = find_mozconfig(mode) |
| 54 import config |
| 55 mozharness_environment["ANDROID_SDK_PATH"] = config.ANDROID_SDK_PATH |
| 56 mozharness_environment["ANDROID_NDK_PATH"] = config.ANDROID_NDK_PATH |
| 57 |
54 subprocess.check_call([MULTI_L10N_PATH, "--cfg", "adblockbrowser-cfg.py"], | 58 subprocess.check_call([MULTI_L10N_PATH, "--cfg", "adblockbrowser-cfg.py"], |
55 env=mozharness_environment) | 59 env=mozharness_environment) |
56 | 60 |
57 [manifest_path] = glob.glob(os.path.join( | 61 [manifest_path] = glob.glob(os.path.join( |
58 DIST_PATH, "fennec-*.multi.android-arm.json")) | 62 DIST_PATH, "fennec-*.multi.android-arm.json")) |
59 with open(manifest_path) as manifest_file: | 63 with open(manifest_path) as manifest_file: |
60 manifest = json.load(manifest_file) | 64 manifest = json.load(manifest_file) |
61 | 65 |
62 apk_path = os.path.join(DIST_PATH, "gecko-unsigned-unaligned.apk") | 66 apk_path = os.path.join(DIST_PATH, "gecko-unsigned-unaligned.apk") |
63 if mode == "release": | 67 if mode == "release": |
(...skipping 23 matching lines...) Expand all Loading... |
87 sys.exit(1) | 91 sys.exit(1) |
88 | 92 |
89 mode, key_store, key_name = sys.argv[1:] | 93 mode, key_store, key_name = sys.argv[1:] |
90 if mode not in ("devbuild", "release"): | 94 if mode not in ("devbuild", "release"): |
91 print_usage() | 95 print_usage() |
92 sys.exit(2) | 96 sys.exit(2) |
93 | 97 |
94 subprocess.check_call([ENSURE_DEPENDENCIES_PATH]) | 98 subprocess.check_call([ENSURE_DEPENDENCIES_PATH]) |
95 apk_path = build(mode) | 99 apk_path = build(mode) |
96 sign(apk_path, key_store, key_name) | 100 sign(apk_path, key_store, key_name) |
OLD | NEW |