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

Unified Diff: build/config/android/internal_rules.gni

Issue 2373853002: Allow targets to use BuildConfig by simply depending on base_java (Closed)
Patch Set: fix compile error when interface jar doesn't match proguarded jar Created 4 years, 3 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
« no previous file with comments | « android_webview/glue/BUILD.gn ('k') | chrome/android/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/android/internal_rules.gni
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index 67e84c01735cfb6f4b89230cd5c40f8d3dce4bea..ad42da6e39fb8dd36d86151700cbe8e1f7cf7295 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -1827,11 +1827,23 @@ if (enable_java_templates) {
}
generate_interface_jar(_ijar_target_name) {
- input_jar = _jar_path
+ if (!defined(invoker.proguard_preprocess) ||
+ !invoker.proguard_preprocess) {
+ # Always used the unfiltered .jar to create the interface jar so that
+ # other targets will resolve filtered classes when depending on
+ # BuildConfig, NativeLibraries, etc.
+ input_jar = invoker.jar_path
+ deps = _deps + _jar_deps
+ } else {
+ # However, still apply pre-proguarding, since ignoring that can break
+ # compiles.
+ input_jar = _jar_path
+ deps = [
+ ":$_process_jar_target_name",
+ ]
+ }
+
output_jar = _ijar_path
- deps = [
- ":$_process_jar_target_name",
- ]
}
if (_supports_android) {
@@ -2128,17 +2140,24 @@ if (enable_java_templates) {
}
generate_interface_jar(_ijar_target_name) {
- input_jar = _final_jar_path
- output_jar = _final_ijar_path
- if (_emma_instrument) {
+ if (!defined(invoker.proguard_preprocess) ||
+ !invoker.proguard_preprocess) {
+ # Always used the unfiltered .jar to create the interface jar so that
+ # other targets will resolve filtered classes when depending on
+ # BuildConfig, NativeLibraries, etc.
+ input_jar = _javac_jar_path
deps = [
- ":$_emma_instr_target_name",
+ ":$_javac_target_name",
]
} else {
+ # However, still apply pre-proguarding, since ignoring that can break
+ # compiles.
+ input_jar = _process_prebuilt_jar_path
deps = [
":$_process_prebuilt_target_name",
]
}
+ output_jar = _final_ijar_path
}
group(_final_target_name) {
« no previous file with comments | « android_webview/glue/BUILD.gn ('k') | chrome/android/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698