aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/extra
diff options
context:
space:
mode:
authorGravatar Brian Silverman <bsilver16384@gmail.com>2015-08-28 09:17:14 +0000
committerGravatar Lukacs Berki <lberki@google.com>2015-08-28 09:23:31 +0000
commit53c3ce10fb891fedb1c199dc6b90048a84b9fa8a (patch)
tree259c0205e33403b947c77ba3557afc59198e9cc0 /src/main/java/com/google/devtools/build/lib/rules/extra
parent2ef4ef41a1f38df3204f02f7f8742fa39daeccce (diff)
Fix $(location //external:some_tool) expansion for genrules.
Previously, targets in "tools" of genrules could only be expanded in $(location)s as the target of the bind. This is another part of fully fixing #90. -- Change-Id: I91444fbfe551b651c46811014639f08f779c70aa Reviewed-on: https://bazel-review.googlesource.com/#/c/1750/ MOS_MIGRATED_REVID=101760690
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/extra')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionFactory.java10
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionSpec.java10
2 files changed, 11 insertions, 9 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionFactory.java b/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionFactory.java
index e3d9adf4bc..d7f856e54d 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionFactory.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionFactory.java
@@ -19,13 +19,13 @@ import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.analysis.CommandHelper;
import com.google.devtools.build.lib.analysis.ConfigurationMakeVariableContext;
import com.google.devtools.build.lib.analysis.ConfiguredTarget;
-import com.google.devtools.build.lib.analysis.FilesToRunProvider;
import com.google.devtools.build.lib.analysis.MakeVariableExpander;
import com.google.devtools.build.lib.analysis.RuleConfiguredTarget.Mode;
import com.google.devtools.build.lib.analysis.RuleConfiguredTargetBuilder;
import com.google.devtools.build.lib.analysis.RuleContext;
import com.google.devtools.build.lib.analysis.Runfiles;
import com.google.devtools.build.lib.analysis.RunfilesProvider;
+import com.google.devtools.build.lib.analysis.TransitiveInfoCollection;
import com.google.devtools.build.lib.packages.TargetUtils;
import com.google.devtools.build.lib.packages.Type;
import com.google.devtools.build.lib.rules.RuleConfiguredTargetFactory;
@@ -44,10 +44,10 @@ public final class ExtraActionFactory implements RuleConfiguredTargetFactory {
// this rule instructs the build system to add additional outputs.
List<Artifact> resolvedData = Lists.newArrayList();
- Iterable<FilesToRunProvider> tools =
- context.getPrerequisites("tools", Mode.HOST, FilesToRunProvider.class);
- CommandHelper commandHelper = new CommandHelper(
- context, tools, ImmutableMap.<Label, Iterable<Artifact>>of());
+ Iterable<? extends TransitiveInfoCollection> tools =
+ context.getPrerequisites("tools", Mode.HOST);
+ CommandHelper commandHelper =
+ new CommandHelper(context, tools, ImmutableMap.<Label, Iterable<Artifact>>of());
resolvedData.addAll(context.getPrerequisiteArtifacts("data", Mode.DATA).list());
List<String>outputTemplates =
diff --git a/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionSpec.java b/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionSpec.java
index 0856345807..d3df3b4f2b 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionSpec.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionSpec.java
@@ -20,8 +20,8 @@ import com.google.common.collect.ImmutableSet;
import com.google.devtools.build.lib.actions.Action;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.analysis.CommandHelper;
-import com.google.devtools.build.lib.analysis.FilesToRunProvider;
import com.google.devtools.build.lib.analysis.RuleContext;
+import com.google.devtools.build.lib.analysis.TransitiveInfoCollection;
import com.google.devtools.build.lib.analysis.TransitiveInfoProvider;
import com.google.devtools.build.lib.analysis.actions.CommandLine;
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
@@ -118,9 +118,11 @@ public final class ExtraActionSpec implements TransitiveInfoProvider {
Map<String, String> env = owningRule.getConfiguration().getDefaultShellEnvironment();
- CommandHelper commandHelper = new CommandHelper(owningRule,
- ImmutableList.<FilesToRunProvider>of(),
- ImmutableMap.<Label, Iterable<Artifact>>of());
+ CommandHelper commandHelper =
+ new CommandHelper(
+ owningRule,
+ ImmutableList.<TransitiveInfoCollection>of(),
+ ImmutableMap.<Label, Iterable<Artifact>>of());
// Multiple actions in the same configured target need to have different names for the artifact
// that might be created here, so we append something that should be unique for each action.