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

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

Issue 2760743002: Add support for robolectric play-services-shadows. (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/android/java_sources.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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 if (options.type in ('java_binary', 'java_library') and 436 if (options.type in ('java_binary', 'java_library') and
437 not options.bypass_platform_checks): 437 not options.bypass_platform_checks):
438 deps_info['requires_android'] = options.requires_android 438 deps_info['requires_android'] = options.requires_android
439 deps_info['supports_android'] = options.supports_android 439 deps_info['supports_android'] = options.supports_android
440 440
441 deps_require_android = (all_resources_deps + 441 deps_require_android = (all_resources_deps +
442 [d['name'] for d in all_library_deps if d['requires_android']]) 442 [d['name'] for d in all_library_deps if d['requires_android']])
443 deps_not_support_android = ( 443 deps_not_support_android = (
444 [d['name'] for d in all_library_deps if not d['supports_android']]) 444 [d['name'] for d in all_library_deps if not d['supports_android']])
445 445
446 if deps_require_android and not options.requires_android: 446 # if deps_require_android and not options.requires_android:
agrieve 2017/03/18 00:39:42 I'd guess for robolectic, the targets themselves s
jbudorick 2017/03/18 00:53:10 This may be a better solution than what I did for
447 raise Exception('Some deps require building for the Android platform: ' + 447 # raise Exception('Some deps require building for the Android platform: ' +
448 str(deps_require_android)) 448 # str(deps_require_android))
449 449
450 if deps_not_support_android and options.supports_android: 450 if deps_not_support_android and options.supports_android:
451 raise Exception('Not all deps support the Android platform: ' + 451 raise Exception('Not all deps support the Android platform: ' +
452 str(deps_not_support_android)) 452 str(deps_not_support_android))
453 453
454 if options.type in ('java_binary', 'java_library', 'android_apk'): 454 if options.type in ('java_binary', 'java_library', 'android_apk'):
455 deps_info['jar_path'] = options.jar_path 455 deps_info['jar_path'] = options.jar_path
456 if options.type == 'android_apk' or options.supports_android: 456 if options.type == 'android_apk' or options.supports_android:
457 deps_info['dex_path'] = options.dex_path 457 deps_info['dex_path'] = options.dex_path
458 if options.type == 'android_apk': 458 if options.type == 'android_apk':
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 deps_info['java_resources_jar'] = options.java_resources_jar_path 709 deps_info['java_resources_jar'] = options.java_resources_jar_path
710 710
711 build_utils.WriteJson(config, options.build_config, only_if_changed=True) 711 build_utils.WriteJson(config, options.build_config, only_if_changed=True)
712 712
713 if options.depfile: 713 if options.depfile:
714 build_utils.WriteDepfile(options.depfile, options.build_config, all_inputs) 714 build_utils.WriteDepfile(options.depfile, options.build_config, all_inputs)
715 715
716 716
717 if __name__ == '__main__': 717 if __name__ == '__main__':
718 sys.exit(main(sys.argv[1:])) 718 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java_sources.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698