diff options
author | 2015-08-20 13:31:24 +0000 | |
---|---|---|
committer | 2015-08-20 14:50:31 +0000 | |
commit | 21a04f2fe2364fcae13d3e7783c5b390438a05f6 (patch) | |
tree | 4eb23b2f1679b345ce41017e3685c5e167912b20 /src/main/java/com/google/devtools/build/lib/analysis | |
parent | b24b1c491456980d2cd7e505204be1816d83bbea (diff) |
Replace AnalysisEnvironment.getDerivedArtifact() calls with RuleContext.getShareableArtifact() calls where the former method is used to create the outputs of shared actions.
--
MOS_MIGRATED_REVID=101116694
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 | 12 |
1 files changed, 12 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 bddb2c2bb5..0f07e39036 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 @@ -467,6 +467,18 @@ public final class RuleContext extends TargetContext } /** + * Returns an artifact that can be an output of shared actions. Only use when there is no other + * option. + * + * <p>This artifact can be created anywhere in the output tree, which, in addition to making + * sharing possible, opens up the possibility of action conflicts and makes it impossible to + * infer the label of the rule creating the artifact from the path of the artifact. + */ + public Artifact getShareableArtifact(PathFragment rootRelativePath, Root root) { + return getAnalysisEnvironment().getDerivedArtifact(rootRelativePath, root); + } + + /** * Creates an artifact in a directory that is unique to the package that contains the rule, * thus guaranteeing that it never clashes with artifacts created by rules in other packages. */ |