Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3197)

Unified Diff: build/android/gyp/write_build_config.py

Issue 2212443002: Use more generic approach to pack java resources into final APK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use the original JAR as the source of resources. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/gyp/apkbuilder.py ('k') | build/config/android/internal_rules.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/write_build_config.py
diff --git a/build/android/gyp/write_build_config.py b/build/android/gyp/write_build_config.py
index fa38432075a41a1acb707d4708b51e6da286810e..7bbe25a35d8da131095e075f5a2e3763139212b8 100755
--- a/build/android/gyp/write_build_config.py
+++ b/build/android/gyp/write_build_config.py
@@ -253,6 +253,10 @@ def main(argv):
help='Whether this library requires running on the Android platform.')
parser.add_option('--bypass-platform-checks', action='store_true',
help='Bypass checks for support/require Android platform.')
+ parser.add_option('--java-resources-jar-path',
+ help='Path to JAR that contains java resources. Everything '
+ 'from this JAR except meta-inf/ content and .class files '
+ 'will be added to the final APK.')
# android library options
parser.add_option('--dex-path', help='Path to target\'s dex output.')
@@ -601,6 +605,20 @@ def main(argv):
config['assets'], config['uncompressed_assets'] = (
_MergeAssets(deps.All('android_assets')))
+ # Collect java resources
+ java_resources_jars = [d['java_resources_jar'] for d in all_library_deps
+ if 'java_resources_jar' in d]
+ if options.tested_apk_config:
+ tested_apk_resource_jars = [d['java_resources_jar']
+ for d in tested_apk_library_deps
+ if 'java_resources_jar' in d]
+ java_resources_jars = [jar for jar in java_resources_jars
+ if jar not in tested_apk_resource_jars]
+ config['java_resources_jars'] = java_resources_jars
+
+ if options.type == 'java_library' and options.java_resources_jar_path:
+ deps_info['java_resources_jar'] = options.java_resources_jar_path
+
build_utils.WriteJson(config, options.build_config, only_if_changed=True)
if options.depfile:
« no previous file with comments | « build/android/gyp/apkbuilder.py ('k') | build/config/android/internal_rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698