Chromium Code Reviews| 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 70bc6d08104a0a6e08165a6b5daa52ce3be97fcb..85db81ad96de935becaa047afd5a1c5dd232e249 100755 |
| --- a/build/android/gyp/write_build_config.py |
| +++ b/build/android/gyp/write_build_config.py |
| @@ -518,14 +518,21 @@ def main(argv): |
| javac_classpath = [c['jar_path'] for c in direct_library_deps] |
| java_full_classpath = [c['jar_path'] for c in all_library_deps] |
| - # An instrumentation test apk should exclude the dex files that are in the apk |
| - # under test. |
| + # An instrumentation test apk should include the java that is in the apk under |
|
jbudorick
2016/07/28 16:56:00
Why should we do this two different ways rather th
smaier
2016/07/28 18:09:51
ProGuard is the tool which does the merging. Thus,
jbudorick
2016/07/28 18:18:22
I seem to have entirely misunderstood what you mea
|
| + # test if ProGuard is enabled, but exclude that java if ProGuard is disabled. |
| if options.type == 'android_apk' and options.tested_apk_config: |
| tested_apk_config = GetDepConfig(options.tested_apk_config) |
| expected_tested_package = tested_apk_config['package_name'] |
| AndroidManifest(options.android_manifest).CheckInstrumentation( |
| expected_tested_package) |
| + if options.proguard_enabled: |
| + # Add all tested classes to the test's classpath to ensure that the test's |
| + # java code is a superset of the tested apk's java code |
| + java_full_classpath += [ |
| + jar for jar in tested_apk_config['java']['full_classpath'] |
| + if jar not in java_full_classpath] |
| + |
| if tested_apk_config['proguard_enabled']: |
| assert options.proguard_enabled, ('proguard must be enabled for ' |
| 'instrumentation apks if it\'s enabled for the tested apk.') |
| @@ -561,7 +568,7 @@ def main(argv): |
| config['javac']['classpath'] = javac_classpath |
| config['javac']['interface_classpath'] = [ |
| _AsInterfaceJar(p) for p in javac_classpath] |
| - config['java'] = { |
| + deps_info['java'] = { |
| 'full_classpath': java_full_classpath |
| } |