diff options
Diffstat (limited to 'src/main/java')
5 files changed, 9 insertions, 5 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 dc6f2dabe1..8e30ff47e2 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 @@ -33,6 +33,7 @@ import com.google.devtools.build.lib.actions.Root; import com.google.devtools.build.lib.analysis.ConfiguredRuleClassProvider.PrerequisiteValidator; import com.google.devtools.build.lib.analysis.RuleConfiguredTarget.Mode; import com.google.devtools.build.lib.analysis.actions.ActionConstructionContext; +import com.google.devtools.build.lib.analysis.buildinfo.BuildInfoFactory.BuildInfoKey; import com.google.devtools.build.lib.analysis.config.BuildConfiguration; import com.google.devtools.build.lib.analysis.config.BuildConfiguration.Fragment; import com.google.devtools.build.lib.analysis.config.ConfigMatchingProvider; @@ -237,6 +238,10 @@ public final class RuleContext extends TargetContext return getAnalysisEnvironment().getOwner(); } + public ImmutableList<Artifact> getBuildInfo(BuildInfoKey key) { + return getAnalysisEnvironment().getBuildInfo(this, key); + } + // TODO(bazel-team): This class could be simpler if Rule and BuildConfiguration classes // were immutable. Then we would need to store only references those two. @Immutable diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java index 36ad55f3b3..97db66e25b 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java @@ -616,7 +616,7 @@ public final class CppLinkAction extends AbstractAction { : null; final ImmutableList<Artifact> buildInfoHeaderArtifacts = !linkstamps.isEmpty() - ? ruleContext.getAnalysisEnvironment().getBuildInfo(ruleContext, CppBuildInfo.KEY) + ? ruleContext.getBuildInfo(CppBuildInfo.KEY) : ImmutableList.<Artifact>of(); final Artifact symbolCountOutput = enableSymbolsCounts(cppConfiguration, fake, linkType) diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/DeployArchiveBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/java/DeployArchiveBuilder.java index 9af470e649..08be5e94c4 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/DeployArchiveBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/DeployArchiveBuilder.java @@ -218,8 +218,7 @@ public class DeployArchiveBuilder { inputs.addElement(runfilesMiddleman); } - final ImmutableList<Artifact> buildInfoArtifacts = - ruleContext.getAnalysisEnvironment().getBuildInfo(ruleContext, JavaBuildInfoFactory.KEY); + ImmutableList<Artifact> buildInfoArtifacts = ruleContext.getBuildInfo(JavaBuildInfoFactory.KEY); inputs.add(buildInfoArtifacts); Iterable<Artifact> runtimeClasspath = Iterables.concat( diff --git a/src/main/java/com/google/devtools/build/lib/rules/nativedeps/NativeDepsHelper.java b/src/main/java/com/google/devtools/build/lib/rules/nativedeps/NativeDepsHelper.java index d90357963a..2318a2a9f9 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/nativedeps/NativeDepsHelper.java +++ b/src/main/java/com/google/devtools/build/lib/rules/nativedeps/NativeDepsHelper.java @@ -142,7 +142,7 @@ public abstract class NativeDepsHelper { CppHelper.resolveLinkstamps(ruleContext, linkParams); List<Artifact> buildInfoArtifacts = linkstamps.isEmpty() ? ImmutableList.<Artifact>of() - : ruleContext.getAnalysisEnvironment().getBuildInfo(ruleContext, CppBuildInfo.KEY); + : ruleContext.getBuildInfo(CppBuildInfo.KEY); boolean shareNativeDeps = configuration.getFragment(CppConfiguration.class).shareNativeDeps(); NestedSet<LibraryToLink> linkerInputs = linkParams.getLibraries(); diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java index 56567e5e65..56f65d3bed 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java @@ -246,7 +246,7 @@ public final class ReleaseBundlingSupport { private void registerEmbedLabelPlistAction() { Artifact buildInfo = Iterables.getOnlyElement( - ruleContext.getAnalysisEnvironment().getBuildInfo(ruleContext, ObjcBuildInfoFactory.KEY)); + ruleContext.getBuildInfo(ObjcBuildInfoFactory.KEY)); ruleContext.registerAction(new SpawnAction.Builder() .setMnemonic("ObjcVersionPlist") .setExecutable(new PathFragment("/bin/bash")) |