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

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

Issue 2767613002: Expose resources in Robolectric/JUnit tests. (Closed)
Patch Set: GN generate resource dirs. Created 3 years, 8 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
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 2303dc54afc8fc539038103ecd5313bbfd5e71e2..1c1560a46f0a202431699a1aaffe12b8dfda429f 100755
--- a/build/android/gyp/write_build_config.py
+++ b/build/android/gyp/write_build_config.py
@@ -344,6 +344,7 @@ def main(argv):
'dist_jar': ['build_config'],
'resource_rewriter': ['build_config'],
'group': ['build_config'],
+ 'junit_binary': ['build_config'],
}
required_options = required_options_map.get(options.type)
if not required_options:
@@ -540,10 +541,20 @@ def main(argv):
deps_info['owned_resources_dirs'] = list(owned_resource_dirs)
deps_info['owned_resources_zips'] = list(owned_resource_zips)
- if options.type in ('android_resources','android_apk', 'resource_rewriter'):
+ if options.type == 'junit_binary':
+ config['test_info'] = {}
+ config['test_info']['resource_packages'] = list({
+ c['package_name'] for c in all_resources_deps if 'package_name' in c})
+ config['test_info']['resources_dirs'] = list({
+ d for c in all_resources_deps if 'resources_dirs' in c
+ for d in c['resources_dirs']})
+
+ if options.type in ('android_resources', 'android_apk', 'resource_rewriter'):
config['resources'] = {}
config['resources']['dependency_zips'] = [
c['resources_zip'] for c in all_resources_deps]
+ config['resources']['dependency_dirs'] = [
+ c['resources_dirs'] for c in all_resources_deps]
config['resources']['extra_package_names'] = []
config['resources']['extra_r_text_files'] = []

Powered by Google App Engine
This is Rietveld 408576698