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

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

Issue 386473002: Add dexing for libraries and apks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-apk-first
Patch Set: Created 6 years, 5 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/dex.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 67e4a58aee9426590fc196553ebddb6d04316074..b8363138567c9f01746931b0a384f007e03f3491 100755
--- a/build/android/gyp/write_build_config.py
+++ b/build/android/gyp/write_build_config.py
@@ -72,6 +72,7 @@ def main(argv):
# android_library/apk options
parser.add_option('--jar-path', help='Path to target\'s jar output.')
+ parser.add_option('--dex-path', help='Path to target\'s dex output.')
options, args = parser.parse_args(argv)
@@ -85,9 +86,9 @@ def main(argv):
required_options = ['build_config'] + {
- 'android_library': ['jar_path'],
+ 'android_library': ['jar_path', 'dex_path'],
'android_resources': ['resources_zip'],
- 'android_apk': ['jar_path', 'resources_zip']
+ 'android_apk': ['jar_path', 'dex_path', 'resources_zip']
}[options.type]
build_utils.CheckOptions(options, parser, required_options)
@@ -113,6 +114,7 @@ def main(argv):
direct_library_deps = DepsOfType('android_library', direct_deps_configs)
all_resources_deps = DepsOfType('android_resources', all_deps_configs)
+ all_library_deps = DepsOfType('android_library', all_deps_configs)
# Initialize some common config.
config = {
@@ -128,6 +130,7 @@ def main(argv):
javac_classpath = [c['jar_path'] for c in direct_library_deps]
deps_info['resources_deps'] = [c['path'] for c in all_resources_deps]
deps_info['jar_path'] = options.jar_path
+ deps_info['dex_path'] = options.dex_path
config['javac'] = {
'classpath': javac_classpath,
}
@@ -147,6 +150,13 @@ def main(argv):
config['resources']['dependency_zips'] = [
c['resources_zip'] for c in all_resources_deps]
+ if options.type == 'android_apk':
+ config['apk_dex'] = {}
+ dex_config = config['apk_dex']
+ # TODO(cjhopman): proguard version
+ dex_deps_files = [c['dex_path'] for c in all_library_deps]
+ dex_config['dependency_dex_files'] = dex_deps_files
+
build_utils.WriteJson(config, options.build_config, only_if_changed=True)
if options.depfile:
« no previous file with comments | « build/android/gyp/dex.py ('k') | build/config/android/internal_rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698