Add a small helper method to ActionInputHelper
This is part of a series of changes to clean up the test strategies; this
specific change is a Google-internal refactoring. I'm planning to also update
the external test strategies subsequently.
--
PiperOrigin-RevId: 144184752
MOS_MIGRATED_REVID=144184752
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionInputHelper.java b/src/main/java/com/google/devtools/build/lib/actions/ActionInputHelper.java
index 26bbb6d..4ca4a1b 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/ActionInputHelper.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/ActionInputHelper.java
@@ -24,7 +24,6 @@
import com.google.devtools.build.lib.actions.Artifact.TreeFileArtifact;
import com.google.devtools.build.lib.util.Preconditions;
import com.google.devtools.build.lib.vfs.PathFragment;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -114,6 +113,16 @@
return new BasicActionInput(path);
}
+ /**
+ * Creates an ActionInput with just the given relative path and no digest.
+ *
+ * @param path the relative path of the input.
+ * @return a ActionInput.
+ */
+ public static ActionInput fromPath(PathFragment path) {
+ return fromPath(path.getPathString());
+ }
+
private static final Function<String, ActionInput> FROM_PATH =
new Function<String, ActionInput>() {
@Override