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

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

Issue 2632283002: Use more generic approach to pack java resources into final APK. (Closed)
Patch Set: GypList->GnList Created 3 years, 11 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 6c29b8957c6fc89a79138c48acae32e04e9e0e96..3a529afaa4fe00ff6ce9c54dca3941473b0246f4 100755
--- a/build/android/gyp/write_build_config.py
+++ b/build/android/gyp/write_build_config.py
@@ -291,6 +291,10 @@ def main(argv):
help='Whether this library should be treated as a prebuilt library by '
'generate_gradle.py.')
parser.add_option('--main-class', help='Java class for java_binary targets.')
+ 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.')
@@ -677,6 +681,20 @@ def main(argv):
config['uncompressed_locales_java_list'] = (
_CreateLocalePaksAssetJavaList(config['uncompressed_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