aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java
diff options
context:
space:
mode:
authorGravatar Michajlo Matijkiw <michajlo@google.com>2015-03-13 20:37:00 +0000
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-03-16 17:34:16 +0000
commit94cca5971b51f48e4ab4b81d3520a6655e16cfe0 (patch)
tree0955962931246c3d2c36bf7dcbfe5344bda746ee /src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java
parent0be7e44a9826ca2601a74d90bd32376e0bec8600 (diff)
remove support for supplying relative root for runfiles
SourceManifestAction.Builder#setTopLevel is the only way the relative roots was capable of being supplied. Its documentation states "Most likely, you don't need this". As it is unused removing the extra code and interpreting as "you don't need this". -- MOS_MIGRATED_REVID=88574913
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java b/src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java
index 5c0537c127..f13e35757c 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java
@@ -327,8 +327,6 @@ public final class Runfiles {
/**
* Returns the symlinks as a map from PathFragment to Artifact, with PathFragments relativized
* and rooted at the specified points.
- * @param root The root the PathFragment is computed relative to (before it is
- * rooted again). May be null.
* @param eventHandler Used for throwing an error if we have an obscuring runlink.
* May be null, in which case obscuring symlinks are silently discarded.
* @param location Location for eventHandler warnings. Ignored if eventHandler is null.
@@ -336,12 +334,12 @@ public final class Runfiles {
* entries, the second of any elements that live outside the source tree.
*/
public Pair<Map<PathFragment, Artifact>, Map<PathFragment, Artifact>> getRunfilesInputs(
- PathFragment root, EventHandler eventHandler, Location location)
+ EventHandler eventHandler, Location location)
throws IOException {
Map<PathFragment, Artifact> manifest = getSymlinksAsMap();
// Add unconditional artifacts (committed to inclusion on construction of runfiles).
for (Artifact artifact : getUnconditionalArtifactsWithoutMiddlemen()) {
- addToManifest(manifest, artifact, root);
+ manifest.put(artifact.getRootRelativePath(), artifact);
}
// Add conditional artifacts (only included if they appear in a pruning manifest).
@@ -357,7 +355,7 @@ public final class Runfiles {
while ((line = reader.readLine()) != null) {
Artifact artifact = allowedRunfiles.get(line);
if (artifact != null) {
- addToManifest(manifest, artifact, root);
+ manifest.put(artifact.getRootRelativePath(), artifact);
}
}
}
@@ -372,15 +370,6 @@ public final class Runfiles {
return Pair.of(result, (Map<PathFragment, Artifact>) new HashMap<>(getRootSymlinksAsMap()));
}
- @VisibleForTesting
- protected static void addToManifest(Map<PathFragment, Artifact> manifest, Artifact artifact,
- PathFragment root) {
- PathFragment rootRelativePath = root != null
- ? artifact.getRootRelativePath().relativeTo(root)
- : artifact.getRootRelativePath();
- manifest.put(rootRelativePath, artifact);
- }
-
/**
* Returns the root symlinks.
*/