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

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

Issue 2103273002: 🎐 Default chromium_code = false for Android targets within third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | third_party/custom_tabs_client/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 661ed253a3ad83bcb163df9d8264cb151896854c..e5760b6177c787496cb9305cddd57741f466ea56 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -1985,9 +1985,25 @@ if (enable_java_templates) {
# Don't enable coverage, lint, findbugs unless the target has some
# non-generated files.
- _chromium_code = defined(invoker.java_files) && invoker.java_files != []
if (defined(invoker.chromium_code)) {
_chromium_code = invoker.chromium_code
+ } else {
+ _chromium_code = defined(invoker.java_files) && invoker.java_files != []
+ if (_chromium_code) {
+ # Make chromium_code = false be the default for targets within
+ # third_party which contain no chromium-namespaced java files.
+ set_sources_assignment_filter([ "*\bthird_party\b*" ])
+ sources = [
Yaron 2016/06/29 15:29:20 Is this a local variable? Prefix with "_" or are y
agrieve 2016/06/29 17:47:42 This is currently the only way to do filtering in
Yaron 2016/06/29 18:16:22 So there's no need to cache and restore it after?
agrieve 2016/06/29 18:46:40 It's restored (back to []) on line 2004. GN also r
Yaron 2016/06/29 18:48:49 Ya, I getcha. I was wondering if sources could be
+ get_label_info(":$target_name", "dir"),
+ ]
+ if (sources == []) {
+ set_sources_assignment_filter([ "*\bchromium\b*" ])
+ sources = invoker.java_files
+ _chromium_code = invoker.java_files != sources
+ }
+ set_sources_assignment_filter([])
+ sources = []
+ }
}
_emma_never_instrument = !_chromium_code
« no previous file with comments | « no previous file | third_party/custom_tabs_client/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698