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

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: Fix building java (non-android) libraries. 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
« no previous file with comments | « no previous file | build/config/android/internal_rules.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 == 'android_apk' or (options.type == "java_library"
219 and options.supports_android):
220 config['final_dex'] = {}
221 dex_config = config['final_dex']
219 # TODO(cjhopman): proguard version 222 # TODO(cjhopman): proguard version
220 dex_deps_files = [c['dex_path'] for c in all_library_deps] 223 dex_deps_files = [c['dex_path'] for c in all_library_deps]
221 dex_config['dependency_dex_files'] = dex_deps_files 224 dex_config['dependency_dex_files'] = dex_deps_files
222 225
226 if options.type == 'android_apk':
223 config['dist_jar'] = { 227 config['dist_jar'] = {
224 'dependency_jars': [ 228 'dependency_jars': [
225 c['jar_path'] for c in all_library_deps 229 c['jar_path'] for c in all_library_deps
226 ] 230 ]
227 } 231 }
228 232
229 library_paths = [] 233 library_paths = []
230 java_libraries_list = [] 234 java_libraries_list = []
231 if options.native_libs: 235 if options.native_libs:
232 libraries = build_utils.ParseGypList(options.native_libs) 236 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) 256 build_utils.WriteJson(config, options.build_config, only_if_changed=True)
253 257
254 if options.depfile: 258 if options.depfile:
255 build_utils.WriteDepfile( 259 build_utils.WriteDepfile(
256 options.depfile, 260 options.depfile,
257 all_deps_config_paths + build_utils.GetPythonDependencies()) 261 all_deps_config_paths + build_utils.GetPythonDependencies())
258 262
259 263
260 if __name__ == '__main__': 264 if __name__ == '__main__':
261 sys.exit(main(sys.argv[1:])) 265 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | build/config/android/internal_rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698