Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: build.py

Issue 29323490: Issue 2751 - Add mozconfigs for devbuild/release builds (Closed)
Patch Set: Created Aug. 12, 2015, 9:55 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « .hgignore ('k') | config.py.sample » ('j') | mozconfig-devbuild » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
René Jeschke 2015/08/13 08:15:05 I would have written that I dislike `import` in fu
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
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)
OLDNEW
« no previous file with comments | « .hgignore ('k') | config.py.sample » ('j') | mozconfig-devbuild » ('J')

Powered by Google App Engine
This is Rietveld