diff options
author | 2015-08-24 08:35:26 +0000 | |
---|---|---|
committer | 2015-08-24 14:02:49 +0000 | |
commit | 11f5587e6140fc6a805444e45f644c76f10b9a03 (patch) | |
tree | 5bd00ddac86e2deb783379fe1cd757deb103fc83 /src/main/java/com/google/devtools/build/lib/analysis | |
parent | c3151a31cb6aa40e0a7ea792a5d17b5f8ec01768 (diff) |
Remove the some calls to AnalysisEnvironment.getDerivedArtifact() and add a big fat warning that that
method shouldn't be used anymore.
Ideally, I'd mark it as deprecated, but it's legitimately used by RuleContext. I could just forbid access to AnalysisEnvironment to rule implementations, but, sadly, almost every method on it is called at a few oddball places in implementations of various rules, so we can't do it just yet.
--
MOS_MIGRATED_REVID=101345484
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/AnalysisEnvironment.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/AnalysisEnvironment.java b/src/main/java/com/google/devtools/build/lib/analysis/AnalysisEnvironment.java index 07f7a02190..7429bd95d0 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/AnalysisEnvironment.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/AnalysisEnvironment.java @@ -44,12 +44,16 @@ public interface AnalysisEnvironment extends ActionRegistry { /** * Returns the artifact for the derived file {@code rootRelativePath}. * + * <p><b>DO NOT USE</b> in rule implementations. Use + * {@link RuleContext#getPackageRelativeArtifact(PathFragment, Root)} or + * {@link RuleContext#getUniqueDirectoryArtifact(String, PathFragment, Root)}, or, if there is + * really no other way, {@link RuleContext#getShareableArtifact(PathFragment, Root)} instead. + * * <p>Creates the artifact if necessary and sets the root of that artifact to {@code root}. * * <p>This method can create artifacts anywhere in the output tree, thus making it possible for - * artifacts generated by two different rules to clash. To avoid this, use the methods - * {@code getUniqueDirectoryArtifact} and {@code getPackageRelativeArtifact} on - * {@link RuleContext}. + * artifacts generated by two different rules to clash. To avoid this, use the artifact creation + * method on {@link RuleContext} mentioned above. */ Artifact getDerivedArtifact(PathFragment rootRelativePath, Root root); |