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

Side by Side Diff: build/android/gyp/write_build_config.py

Issue 772493003: GN + Android: support standalone .dex.jar output of Android libraries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2014 The Chromium Authors. All rights reserved. 3 # Copyright 2014 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Writes a build_config file. 7 """Writes a build_config file.
8 8
9 The build_config file for a target is a json file containing information about 9 The build_config file for a target is a json file containing information about
10 how to build that target based on the target's dependencies. This includes 10 how to build that target based on the target's dependencies. This includes
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 config['resources'] = {} 206 config['resources'] = {}
207 config['resources']['dependency_zips'] = [ 207 config['resources']['dependency_zips'] = [
208 c['resources_zip'] for c in all_resources_deps] 208 c['resources_zip'] for c in all_resources_deps]
209 config['resources']['extra_package_names'] = [] 209 config['resources']['extra_package_names'] = []
210 210
211 if options.type == 'android_apk': 211 if options.type == 'android_apk':
212 config['resources']['extra_package_names'] = [ 212 config['resources']['extra_package_names'] = [
213 c['package_name'] for c in all_resources_deps if 'package_name' in c] 213 c['package_name'] for c in all_resources_deps if 'package_name' in c]
214 214
215 215
216 if options.type == 'android_apk': 216 # Dependencies for the final dex file of an apk or the standalone .dex.jar
217 config['apk_dex'] = {} 217 # output of a library.
218 dex_config = config['apk_dex'] 218 if options.type in ['java_library', 'android_apk']:
219 config['final_dex'] = {}
220 dex_config = config['final_dex']
219 # TODO(cjhopman): proguard version 221 # TODO(cjhopman): proguard version
220 dex_deps_files = [c['dex_path'] for c in all_library_deps] 222 dex_deps_files = [c['dex_path'] for c in all_library_deps]
221 dex_config['dependency_dex_files'] = dex_deps_files 223 dex_config['dependency_dex_files'] = dex_deps_files
222 224
225 if options.type == 'android_apk':
223 config['dist_jar'] = { 226 config['dist_jar'] = {
224 'dependency_jars': [ 227 'dependency_jars': [
225 c['jar_path'] for c in all_library_deps 228 c['jar_path'] for c in all_library_deps
226 ] 229 ]
227 } 230 }
228 231
229 library_paths = [] 232 library_paths = []
230 java_libraries_list = [] 233 java_libraries_list = []
231 if options.native_libs: 234 if options.native_libs:
232 libraries = build_utils.ParseGypList(options.native_libs) 235 libraries = build_utils.ParseGypList(options.native_libs)
(...skipping 19 matching lines...) Expand all
252 build_utils.WriteJson(config, options.build_config, only_if_changed=True) 255 build_utils.WriteJson(config, options.build_config, only_if_changed=True)
253 256
254 if options.depfile: 257 if options.depfile:
255 build_utils.WriteDepfile( 258 build_utils.WriteDepfile(
256 options.depfile, 259 options.depfile,
257 all_deps_config_paths + build_utils.GetPythonDependencies()) 260 all_deps_config_paths + build_utils.GetPythonDependencies())
258 261
259 262
260 if __name__ == '__main__': 263 if __name__ == '__main__':
261 sys.exit(main(sys.argv[1:])) 264 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | build/config/android/internal_rules.gni » ('j') | build/config/android/internal_rules.gni » ('J')

Powered by Google App Engine
This is Rietveld 408576698