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

Unified Diff: build.py

Issue 29399743: Issue 3768 - Check (and fix, if needed) multilocale builds (Closed)
Patch Set: Created March 31, 2017, 9:34 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
Index: build.py
===================================================================
--- a/build.py
+++ b/build.py
@@ -7,17 +7,18 @@ import re
import shutil
import string
import subprocess
import sys
import tempfile
_BASE_DIR = os.path.dirname(os.path.abspath(__file__))
_ENSURE_DEPENDENCIES_PATH = os.path.join(_BASE_DIR, "ensure_dependencies.py")
-_GENERATED_MOZCONFIG_PATH = os.path.join(_BASE_DIR, "generated", "mozconfig")
+_GENERATED_PATH = os.path.join(_BASE_DIR, "generated")
+_GENERATED_MOZCONFIG_PATH = os.path.join(_GENERATED_PATH, "mozconfig")
_MOZCONFIG_COMMON_PATH = os.path.join(_BASE_DIR, "mozconfig-common")
_MOZCONFIG_ARM_PATH = os.path.join(_BASE_DIR, "mozconfig-arm")
_MOZCONFIG_X86_PATH = os.path.join(_BASE_DIR, "mozconfig-x86")
_MOZCONFIG_STORE_PATH = os.path.join(_BASE_DIR, "mozconfig-store")
_MOZCONFIG_RELEASE_PATH = os.path.join(_BASE_DIR, "mozconfig-release")
_MOZCONFIG_CUSTOM_PATH = os.path.join(_BASE_DIR, "mozconfig-custom")
_MULTI_L10N_PATH = os.path.join(_BASE_DIR, "mozharness", "scripts",
"multil10n.py")
@@ -44,29 +45,30 @@ def print_usage():
Usage: $name %s
$name %s APK_PATH
$name %s\
""" % (_CMD_BUILD, _CMD_SIGN,
_CMD_BUILD_SIGN)).substitute({"name": os.path.basename(sys.argv[0])})
def _generate_mozconfig(architecture, distribution_mode, build_mode):
- mozconfig_path = _GENERATED_MOZCONFIG_PATH
- with open(mozconfig_path, "w+") as mozconfig:
+ if not os.path.exists(_GENERATED_PATH):
+ os.makedirs(_GENERATED_PATH)
anton 2017/04/03 06:28:11 i had to figure this out when trying to build it a
+ with open(_GENERATED_MOZCONFIG_PATH, "w+") as mozconfig:
mozconfig.write(". \"%s\"\n" % _MOZCONFIG_COMMON_PATH)
if architecture == _ARCH_X86:
mozconfig.write(". \"%s\"\n" % _MOZCONFIG_X86_PATH)
else:
mozconfig.write(". \"%s\"\n" % _MOZCONFIG_ARM_PATH)
if distribution_mode == _DIST_STORE:
mozconfig.write(". \"%s\"\n" % _MOZCONFIG_STORE_PATH)
if build_mode == _BUILD_RELEASE:
mozconfig.write(". \"%s\"\n" % _MOZCONFIG_RELEASE_PATH)
mozconfig.write(". \"%s\"\n" % _MOZCONFIG_CUSTOM_PATH)
- return mozconfig_path
+ return _GENERATED_MOZCONFIG_PATH
def _build(architecture, distribution_mode, build_mode, sdk_path, ndk_path):
build_environment = os.environ.copy()
build_environment["ANDROID_SDK_PATH"] = sdk_path
build_environment["ANDROID_NDK_PATH"] = ndk_path
build_environment["MOZCONFIG"] = _generate_mozconfig(
architecture, distribution_mode, build_mode)
@@ -146,17 +148,17 @@ if __name__ == "__main__":
if build_mode not in _BUILD_MODES:
print >>sys.stderr, error_msg % (
"build mode", "build modes", _BUILD_MODES)
sys.exit(5)
architecture = config.ARCHITECTURE
if architecture not in _ARCHS:
print >>sys.stderr, error_msg % (
- "architecture", "architectures", _ARCHS)
+ "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.
sys.exit(6)
if do_build:
apk_path = _build(architecture, distribution_mode, 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:

Powered by Google App Engine
This is Rietveld