diff options
author | 2018-02-08 07:13:33 -0800 | |
---|---|---|
committer | 2018-02-08 07:15:39 -0800 | |
commit | cfdeb4d4737a73e38aabfbd2fca31f018a2c19e9 (patch) | |
tree | 34583ecf6d27c796b6a0853d12abe03892952a45 /src/main/java/com/google/devtools/build/lib/analysis | |
parent | d855d8133f4efb73ebd5e82c54a9afb4c7565d46 (diff) |
Suppress ThinLTO indexing for testonly targets
Applies ThinLTO scalability fix https://github.com/bazelbuild/bazel/commit/8c5e290dfab3cab378a9ca107ecdd6267403cd4b to targets (e.g. cc_binary) marked
"testonly = 1".
RELNOTES: None
PiperOrigin-RevId: 184991176
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java b/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java index 73fb629874..994ef13fb7 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java @@ -1327,6 +1327,11 @@ public final class RuleContext extends TargetContext return TargetUtils.isTestRule(getTarget()); } + /** Returns true if the testonly attribute is set on this context. */ + public boolean isTestOnlyTarget() { + return attributes().has("testonly", Type.BOOLEAN) && attributes().get("testonly", Type.BOOLEAN); + } + /** * @return true if {@code rule} is visible from {@code prerequisite}. * |