Skip to content

Commit

Permalink
Allow executing input files in addition to output ones
Browse files Browse the repository at this point in the history
With remote repositories, it is useful to do this to execute an input
file which isn't actually part of the source tree.

Closes bazelbuild#984

--
Change-Id: Ic986ea9bbe88e0edb933939ce1d7a8b6ea9d6e88
Reviewed-on: https://bazel-review.googlesource.com/#/c/3030/
MOS_MIGRATED_REVID=120248102
  • Loading branch information
bsilver8192 authored and damienmg committed Apr 20, 2016
1 parent 8616949 commit 32d2ffe
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.google.devtools.build.lib.events.Event;
import com.google.devtools.build.lib.events.Reporter;
import com.google.devtools.build.lib.exec.SymlinkTreeHelper;
import com.google.devtools.build.lib.packages.InputFile;
import com.google.devtools.build.lib.packages.NonconfigurableAttributeMapper;
import com.google.devtools.build.lib.packages.OutputFile;
import com.google.devtools.build.lib.packages.Rule;
Expand Down Expand Up @@ -493,11 +494,10 @@ private ExitCode fullyValidateTarget(CommandEnvironment env, ConfiguredTarget ta

/**
* Return true iff {@code target} is a rule that has an executable file. This includes
* *_test rules, *_binary rules, and generated outputs.
* *_test rules, *_binary rules, generated outputs, and inputs.
*/
private static boolean isExecutable(Target target) {
return isOutputFile(target) || isExecutableNonTestRule(target)
|| TargetUtils.isTestRule(target);
return isPlainFile(target) || isExecutableNonTestRule(target) || TargetUtils.isTestRule(target);
}

/**
Expand All @@ -515,7 +515,7 @@ private static boolean isExecutableNonTestRule(Target target) {
return false;
}

private static boolean isOutputFile(Target target) {
return (target instanceof OutputFile);
private static boolean isPlainFile(Target target) {
return (target instanceof OutputFile) || (target instanceof InputFile);
}
}

0 comments on commit 32d2ffe

Please sign in to comment.