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

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

Issue 2182303002: Merging under test java into instrumentation test java. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@runtimelibrary
Patch Set: Addressing agrieve's comments Created 4 years, 5 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 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
}

Powered by Google App Engine
This is Rietveld 408576698