summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authormichaelbai <michaelbai@chromium.org>2015-09-28 15:50:11 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-28 22:52:17 +0000
commitc0ca6bacc1e4bb753d451618d84fc3700089d7c9 (patch)
treee8304b555e525abd35f9e37c6cfefa441c6d8745 /build
parent3446a1d9927c166bf4bfba76343040d84411e4b0 (diff)
downloadchromium_src-c0ca6bacc1e4bb753d451618d84fc3700089d7c9.zip
chromium_src-c0ca6bacc1e4bb753d451618d84fc3700089d7c9.tar.gz
chromium_src-c0ca6bacc1e4bb753d451618d84fc3700089d7c9.tar.bz2
Support alternative locale zip
Instead of using the locale zip in dep graph, alternative locale zip could be used when building APK. - Using dedicated variables in all_dependencies_settings for locale zip - Not using locale zip from all_dependences_settings if alternative file specified. - Make resources_zip_path in locale_pak_resources.gypi setable, so the file could be used as alternative lcoale zip for APK. BUG=535379 Review URL: https://codereview.chromium.org/1357423011 Cr-Commit-Position: refs/heads/master@{#351190}
Diffstat (limited to 'build')
-rw-r--r--build/android/locale_pak_resources.gypi8
-rw-r--r--build/java.gypi16
-rw-r--r--build/java_apk.gypi36
3 files changed, 49 insertions, 11 deletions
diff --git a/build/android/locale_pak_resources.gypi b/build/android/locale_pak_resources.gypi
index 6f8e56f8..020b831 100644
--- a/build/android/locale_pak_resources.gypi
+++ b/build/android/locale_pak_resources.gypi
@@ -12,6 +12,8 @@
# Variables:
# locale_pak_files - List of .pak files to process.
# Names must be of the form "en.pak" or "en-US.pak".
+# resource_zip_path - the path of generated zip file, optional, normally, you
+# don't need to set this variable.
#
# Example
# {
@@ -25,12 +27,12 @@
#
{
'variables': {
- 'resources_zip_path': '<(PRODUCT_DIR)/res.java/<(_target_name).zip',
+ 'resources_zip_path%': '<(PRODUCT_DIR)/res.java/<(_target_name).zip',
},
'all_dependent_settings': {
'variables': {
- 'additional_input_paths': ['<(resources_zip_path)'],
- 'dependencies_res_zip_paths': ['<(resources_zip_path)'],
+ 'additional_locale_input_paths': ['<(resources_zip_path)'],
+ 'dependencies_locale_zip_paths': ['<(resources_zip_path)'],
},
},
'actions': [{
diff --git a/build/java.gypi b/build/java.gypi
index c97b07e..0fdf19b 100644
--- a/build/java.gypi
+++ b/build/java.gypi
@@ -63,6 +63,7 @@
'jar_excluded_classes': [ '*/R.class', '*/R##*.class' ],
'instr_stamp': '<(intermediate_dir)/instr.stamp',
'additional_input_paths': [],
+ 'additional_locale_input_paths': [],
'dex_path': '<(PRODUCT_DIR)/lib.java/<(_target_name).dex.jar',
'main_dex_list_path': '<(intermediate_dir)/main_dex_list.txt',
'generated_src_dirs': ['>@(generated_R_dirs)'],
@@ -135,6 +136,7 @@
'generated_src_dirs': ['<(R_dir)'],
'additional_input_paths': ['<(resource_zip_path)', ],
+ 'dependencies_locale_zip_paths': [],
'dependencies_res_zip_paths': [],
'resource_zip_path': '<(PRODUCT_DIR)/res.java/<(_target_name).zip',
},
@@ -166,6 +168,10 @@
# the list of inputs changes.
'inputs_list_file': '>|(java_resources.<(_target_name).gypcmd >@(resource_input_paths))',
'process_resources_options': [],
+ 'local_dependencies_res_zip_paths': [
+ '>@(dependencies_res_zip_paths)',
+ '>@(dependencies_locale_zip_paths)'
+ ],
'conditions': [
['res_v14_skip == 1', {
'process_resources_options': ['--v14-skip']
@@ -177,7 +183,7 @@
'<(DEPTH)/build/android/gyp/process_resources.py',
'<(DEPTH)/build/android/gyp/generate_v14_compatible_resources.py',
'>@(resource_input_paths)',
- '>@(dependencies_res_zip_paths)',
+ '>@(local_dependencies_res_zip_paths)',
'>(inputs_list_file)',
],
'outputs': [
@@ -193,7 +199,7 @@
'--android-manifest', '<(android_manifest)',
'--custom-package', '<(R_package)',
- '--dependencies-res-zips', '>(dependencies_res_zip_paths)',
+ '--dependencies-res-zips', '>(local_dependencies_res_zip_paths)',
'--resource-dirs', '<(res_input_dirs)',
'--R-dir', '<(R_dir)',
@@ -278,6 +284,10 @@
'action_name': 'javac_<(_target_name)',
'message': 'Compiling <(_target_name) java sources',
'variables': {
+ 'local_additional_input_paths': [
+ '>@(additional_input_paths)',
+ '>@(additional_locale_input_paths)',
+ ],
'extra_args': [],
'extra_inputs': [],
'java_sources': ['>!@(find >(java_in_dir)>(java_in_dir_suffix) >(additional_src_dirs) -name "*.java")'],
@@ -295,7 +305,7 @@
'<(DEPTH)/build/android/gyp/javac.py',
'>@(java_sources)',
'>@(input_jars_paths)',
- '>@(additional_input_paths)',
+ '>@(local_additional_input_paths)',
'<@(extra_inputs)',
],
'outputs': [
diff --git a/build/java_apk.gypi b/build/java_apk.gypi
index 992f0cb..3ff9d6e 100644
--- a/build/java_apk.gypi
+++ b/build/java_apk.gypi
@@ -68,12 +68,15 @@
# java_in_dir_suffix - To override the /src suffix on java_in_dir.
# app_manifest_version_name - set the apps 'human readable' version number.
# app_manifest_version_code - set the apps version number.
+# dependencies_locale_zip_alternative_paths - a list of paths that used to
+# replace dependencies_locale_zip_paths of all_dependent_settings.
{
'variables': {
'tested_apk_obfuscated_jar_path%': '/',
'tested_apk_dex_path%': '/',
'tested_apk_is_multidex%': 0,
'additional_input_paths': [],
+ 'additional_locale_input_paths': [],
'create_density_splits%': 0,
'language_splits': [],
'input_jars_paths': [],
@@ -93,6 +96,8 @@
'R_package%':'',
'include_all_resources%': 0,
'additional_R_text_files': [],
+ 'dependencies_locale_zip_alternative_paths%': [],
+ 'dependencies_locale_zip_paths': [],
'dependencies_res_zip_paths': [],
'additional_res_packages': [],
'additional_bundled_libs%': [],
@@ -781,12 +786,27 @@
'action_name': 'process_resources',
'message': 'processing resources for <(_target_name)',
'variables': {
+ 'local_additional_input_paths': [
+ '>@(additional_input_paths)',
+ ],
+ 'local_dependencies_res_zip_paths': [
+ '>@(dependencies_res_zip_paths)'
+ ],
# Write the inputs list to a file, so that its mtime is updated when
# the list of inputs changes.
- 'inputs_list_file': '>|(apk_codegen.<(_target_name).gypcmd >@(additional_input_paths) >@(resource_input_paths))',
+ 'inputs_list_file': '>|(apk_codegen.<(_target_name).gypcmd >@(local_additional_input_paths) >@(resource_input_paths))',
+
'process_resources_options': [],
'conditions': [
+ ['dependencies_locale_zip_alternative_paths == []', {
+ 'local_dependencies_res_zip_paths': ['>@(dependencies_locale_zip_paths)'],
+ 'local_additional_input_paths': ['>@(additional_locale_input_paths)']
+ }, {
+ 'local_dependencies_res_zip_paths': ['<@(dependencies_locale_zip_alternative_paths)'],
+ 'local_additional_input_paths': ['>@(dependencies_locale_zip_alternative_paths)'],
+ }],
['is_test_apk == 1', {
+ 'dependencies_locale_zip_paths=': [],
'dependencies_res_zip_paths=': [],
'additional_res_packages=': [],
}],
@@ -811,9 +831,9 @@
'<(DEPTH)/build/android/gyp/util/build_utils.py',
'<(DEPTH)/build/android/gyp/process_resources.py',
'<(android_manifest_path)',
- '>@(additional_input_paths)',
+ '>@(local_additional_input_paths)',
'>@(resource_input_paths)',
- '>@(dependencies_res_zip_paths)',
+ '>@(local_dependencies_res_zip_paths)',
'>(inputs_list_file)',
],
'outputs': [
@@ -827,7 +847,7 @@
'--aapt-path', '<(android_aapt_path)',
'--android-manifest', '<(android_manifest_path)',
- '--dependencies-res-zips', '>(dependencies_res_zip_paths)',
+ '--dependencies-res-zips', '>(local_dependencies_res_zip_paths)',
'--extra-res-packages', '>(additional_res_packages)',
'--extra-r-text-files', '>(additional_R_text_files)',
@@ -1096,14 +1116,20 @@
},
{
'variables': {
+ 'local_dependencies_res_zip_paths': ['>@(dependencies_res_zip_paths)'],
'extra_inputs': ['<(codegen_stamp)'],
'resource_zips': [
'<(resource_zip_path)',
],
'conditions': [
+ ['dependencies_locale_zip_alternative_paths == []', {
+ 'local_dependencies_res_zip_paths': ['>@(dependencies_locale_zip_paths)'],
+ }, {
+ 'local_dependencies_res_zip_paths': ['<@(dependencies_locale_zip_alternative_paths)'],
+ }],
['is_test_apk == 0', {
'resource_zips': [
- '>@(dependencies_res_zip_paths)',
+ '>@(local_dependencies_res_zip_paths)',
],
}],
],