| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 print >>sys.stderr, string.Template("""\ | 44 print >>sys.stderr, string.Template("""\ |
| 45 Usage: $name %s | 45 Usage: $name %s |
| 46 $name %s APK_PATH | 46 $name %s APK_PATH |
| 47 $name %s\ | 47 $name %s\ |
| 48 """ % (_CMD_BUILD, _CMD_SIGN, | 48 """ % (_CMD_BUILD, _CMD_SIGN, |
| 49 _CMD_BUILD_SIGN)).substitute({"name": os.path.basename(sys.argv[0])}) | 49 _CMD_BUILD_SIGN)).substitute({"name": os.path.basename(sys.argv[0])}) |
| 50 | 50 |
| 51 | 51 |
| 52 def _generate_mozconfig(architecture, distribution_mode, build_mode): | 52 def _generate_mozconfig(architecture, distribution_mode, build_mode): |
| 53 if not os.path.exists(_GENERATED_PATH): | 53 if not os.path.exists(_GENERATED_PATH): |
| 54 os.makedirs(_GENERATED_PATH) | 54 os.makedirs(_GENERATED_PATH) |
|
anton
2017/04/03 06:28:11
i had to figure this out when trying to build it a
| |
| 55 with open(_GENERATED_MOZCONFIG_PATH, "w+") as mozconfig: | 55 with open(_GENERATED_MOZCONFIG_PATH, "w+") as mozconfig: |
| 56 mozconfig.write(". \"%s\"\n" % _MOZCONFIG_COMMON_PATH) | 56 mozconfig.write(". \"%s\"\n" % _MOZCONFIG_COMMON_PATH) |
| 57 if architecture == _ARCH_X86: | 57 if architecture == _ARCH_X86: |
| 58 mozconfig.write(". \"%s\"\n" % _MOZCONFIG_X86_PATH) | 58 mozconfig.write(". \"%s\"\n" % _MOZCONFIG_X86_PATH) |
| 59 else: | 59 else: |
| 60 mozconfig.write(". \"%s\"\n" % _MOZCONFIG_ARM_PATH) | 60 mozconfig.write(". \"%s\"\n" % _MOZCONFIG_ARM_PATH) |
| 61 if distribution_mode == _DIST_STORE: | 61 if distribution_mode == _DIST_STORE: |
| 62 mozconfig.write(". \"%s\"\n" % _MOZCONFIG_STORE_PATH) | 62 mozconfig.write(". \"%s\"\n" % _MOZCONFIG_STORE_PATH) |
| 63 if build_mode == _BUILD_RELEASE: | 63 if build_mode == _BUILD_RELEASE: |
| 64 mozconfig.write(". \"%s\"\n" % _MOZCONFIG_RELEASE_PATH) | 64 mozconfig.write(". \"%s\"\n" % _MOZCONFIG_RELEASE_PATH) |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 | 146 |
| 147 build_mode = config.BUILD_MODE | 147 build_mode = config.BUILD_MODE |
| 148 if build_mode not in _BUILD_MODES: | 148 if build_mode not in _BUILD_MODES: |
| 149 print >>sys.stderr, error_msg % ( | 149 print >>sys.stderr, error_msg % ( |
| 150 "build mode", "build modes", _BUILD_MODES) | 150 "build mode", "build modes", _BUILD_MODES) |
| 151 sys.exit(5) | 151 sys.exit(5) |
| 152 | 152 |
| 153 architecture = config.ARCHITECTURE | 153 architecture = config.ARCHITECTURE |
| 154 if architecture not in _ARCHS: | 154 if architecture not in _ARCHS: |
| 155 print >>sys.stderr, error_msg % ( | 155 print >>sys.stderr, error_msg % ( |
| 156 "architecture", "architectures", _ARCHS) | 156 "architecture", "architectures", _ARCHS ) |
|
Felix Dahlke
2017/03/31 09:53:54
Seems unrelated, could you do this in a separate n
diegocarloslima
2017/03/31 10:07:23
Acknowledged.
| |
| 157 sys.exit(6) | 157 sys.exit(6) |
| 158 | 158 |
| 159 if do_build: | 159 if do_build: |
| 160 apk_path = _build(architecture, distribution_mode, build_mode, | 160 apk_path = _build(architecture, distribution_mode, build_mode, |
| 161 config.ANDROID_SDK_PATH, config.ANDROID_NDK_PATH) | 161 config.ANDROID_SDK_PATH, config.ANDROID_NDK_PATH) |
| 162 if do_sign: | 162 if do_sign: |
| 163 _sign(apk_path, config.ANDROID_KEYSTORE_PATH, config.ANDROID_KEY_NAME) | 163 _sign(apk_path, config.ANDROID_KEYSTORE_PATH, config.ANDROID_KEY_NAME) |
| 164 else: | 164 else: |
| 165 print apk_path | 165 print apk_path |
| LEFT | RIGHT |