| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 50 if distribution_mode == DIST_STORE: | 50 if distribution_mode == DIST_STORE: |
| 51 mozconfig.write(". \"%s\"\n" % MOZCONFIG_STORE_PATH) | 51 mozconfig.write(". \"%s\"\n" % MOZCONFIG_STORE_PATH) |
| 52 if build_mode == BUILD_RELEASE: | 52 if build_mode == BUILD_RELEASE: |
| 53 mozconfig.write(". \"%s\"\n" % MOZCONFIG_RELEASE_PATH) | 53 mozconfig.write(". \"%s\"\n" % MOZCONFIG_RELEASE_PATH) |
| 54 mozconfig.write(". \"%s\"\n" % MOZCONFIG_CUSTOM_PATH) | 54 mozconfig.write(". \"%s\"\n" % MOZCONFIG_CUSTOM_PATH) |
| 55 return mozconfig_path | 55 return mozconfig_path |
| 56 | 56 |
| 57 | 57 |
| 58 def build(architecture, distribution_mode, build_mode, sdk_path, ndk_path): | 58 def build(architecture, distribution_mode, build_mode, sdk_path, ndk_path): |
| 59 build_environment = os.environ.copy() | 59 build_environment = os.environ.copy() |
| 60 build_environment["MOZCONFIG"] = generate_mozconfig( | 60 build_environment["MOZCONFIG"] = generate_mozconfig( |
|
anton
2016/12/01 07:03:58
it might be more reliable not just remove `find_mo
diegocarloslima
2016/12/01 10:35:59
I understand your point of view, but my reasons to
| |
| 61 architecture, distribution_mode, build_mode) | 61 architecture, distribution_mode, build_mode) |
| 62 build_environment["ANDROID_SDK_PATH"] = sdk_path | 62 build_environment["ANDROID_SDK_PATH"] = sdk_path |
| 63 build_environment["ANDROID_NDK_PATH"] = ndk_path | 63 build_environment["ANDROID_NDK_PATH"] = ndk_path |
| 64 obj_dir = OBJDIR_X86 if architecture == ARCH_X86 else OBJDIR_ARM | 64 obj_dir = OBJDIR_X86 if architecture == ARCH_X86 else OBJDIR_ARM |
| 65 build_environment["OBJDIR"] = obj_dir | 65 build_environment["OBJDIR"] = obj_dir |
| 66 subprocess.check_call([os.path.join(ABB_PATH, "mach"), "clobber"], | 66 subprocess.check_call([os.path.join(ABB_PATH, "mach"), "clobber"], |
| 67 env=build_environment) | 67 env=build_environment) |
| 68 subprocess.check_call([MULTI_L10N_PATH, "--cfg", "adblockbrowser-cfg.py"], | 68 subprocess.check_call([MULTI_L10N_PATH, "--cfg", "adblockbrowser-cfg.py"], |
| 69 env=build_environment) | 69 env=build_environment) |
| 70 | 70 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 | 117 |
| 118 if do_sign: | 118 if do_sign: |
| 119 if len(sys.argv) < 3: | 119 if len(sys.argv) < 3: |
| 120 print_usage() | 120 print_usage() |
| 121 sys.exit(3) | 121 sys.exit(3) |
| 122 apk_path = sys.argv[2] | 122 apk_path = sys.argv[2] |
| 123 | 123 |
| 124 subprocess.check_call([ENSURE_DEPENDENCIES_PATH]) | 124 subprocess.check_call([ENSURE_DEPENDENCIES_PATH]) |
| 125 import config | 125 import config |
| 126 | 126 |
| 127 architecture = config.ARCHITECTURE | |
| 128 if architecture not in (ARCH_ARM, ARCH_X86): | |
| 129 print >>sys.stderr, "Invalid architecture, check config.py" | |
| 130 sys.exit(4) | |
|
anton
2016/12/01 07:03:58
From integration point of view (f.e. CI server - l
diegocarloslima
2016/12/01 10:35:59
Acknowledged.
| |
| 131 | |
| 132 distribution_mode = config.DISTRIBUTION_MODE | 127 distribution_mode = config.DISTRIBUTION_MODE |
| 133 if distribution_mode not in ("standalone", "store"): | 128 if distribution_mode not in ("standalone", "store"): |
| 134 print >>sys.stderr, "Invalid distribution mode, check config.py" | 129 print >>sys.stderr, "Invalid distribution mode, check config.py" |
| 135 sys.exit(5) | 130 sys.exit(4) |
| 136 | 131 |
| 137 build_mode = config.BUILD_MODE | 132 build_mode = config.BUILD_MODE |
| 138 if build_mode not in ("devbuild", "release"): | 133 if build_mode not in ("devbuild", "release"): |
| 139 print >>sys.stderr, "Invalid build mode, check config.py" | 134 print >>sys.stderr, "Invalid build mode, check config.py" |
| 135 sys.exit(5) | |
| 136 | |
| 137 architecture = config.ARCHITECTURE | |
| 138 if architecture not in (ARCH_ARM, ARCH_X86): | |
| 139 print >>sys.stderr, "Invalid architecture, check config.py" | |
| 140 sys.exit(6) | 140 sys.exit(6) |
| 141 | 141 |
| 142 if do_build: | 142 if do_build: |
| 143 apk_path = build(architecture, distribution_mode, build_mode, | 143 apk_path = build(architecture, distribution_mode, build_mode, |
| 144 config.ANDROID_SDK_PATH, config.ANDROID_NDK_PATH) | 144 config.ANDROID_SDK_PATH, config.ANDROID_NDK_PATH) |
| 145 if do_sign: | 145 if do_sign: |
| 146 sign(apk_path, config.ANDROID_KEYSTORE_PATH, config.ANDROID_KEY_NAME) | 146 sign(apk_path, config.ANDROID_KEYSTORE_PATH, config.ANDROID_KEY_NAME) |
| 147 else: | 147 else: |
| 148 print apk_path | 148 print apk_path |
| LEFT | RIGHT |