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

Unified Diff: build.py

Issue 29323547: Issue 2751 - Separate build and sign steps (Closed)
Patch Set: Created Aug. 13, 2015, 7:15 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build.py
===================================================================
--- a/build.py
+++ b/build.py
@@ -4,6 +4,7 @@
import json
import os
import shutil
+import string
import subprocess
import sys
import tempfile
@@ -16,8 +17,11 @@
"obj-arm-linux-androideabi", "dist")
def print_usage():
- print >>sys.stderr, "Usage: %s devbuild|release" % \
- os.path.basename(sys.argv[0])
+ print >>sys.stderr, string.Template("""\
+Usage: $name build devbuild|release
+ $name sign APK_PATH
+ $name build-and-sign devbuild|release\
+""").substitute({"name": os.path.basename(sys.argv[0])})
def check_mozconfig(path, mode):
if not os.path.exists(path):
@@ -85,16 +89,33 @@
os.remove(temp_apk_path)
if __name__ == "__main__":
- if len(sys.argv) < 2:
+ if len(sys.argv) < 3:
print_usage()
sys.exit(1)
mode = sys.argv[1]
- if mode not in ("devbuild", "release"):
+ do_build = mode in ("build", "build-and-sign")
+ do_sign = mode in ("sign", "build-and-sign")
+ if not do_build and not do_sign:
print_usage()
sys.exit(2)
+ if do_build:
+ build_mode = sys.argv[2]
+ if build_mode not in ("devbuild", "release"):
+ print_usage()
+ sys.exit(3)
+
+ if do_sign:
+ apk_path = sys.argv[2]
+
subprocess.check_call([ENSURE_DEPENDENCIES_PATH])
import config
- apk_path = build(mode, config.ANDROID_SDK_PATH, config.ANDROID_NDK_PATH)
- sign(apk_path, config.ANDROID_KEYSTORE_PATH, config.ANDROID_KEY_NAME)
+
+ if do_build:
+ apk_path = build(build_mode, config.ANDROID_SDK_PATH,
+ config.ANDROID_NDK_PATH)
+ if do_sign:
+ sign(apk_path, config.ANDROID_KEYSTORE_PATH, config.ANDROID_KEY_NAME)
+ else:
René Jeschke 2015/08/13 08:01:52 Nit: this (and the next line) could be removed, as
+ print apk_path
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld