aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/SourceManifestAction.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/SourceManifestAction.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/SourceManifestAction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/SourceManifestAction.java40
1 files changed, 8 insertions, 32 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/SourceManifestAction.java b/src/main/java/com/google/devtools/build/lib/analysis/SourceManifestAction.java
index 20b13b8f83..7929dbc0b2 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/SourceManifestAction.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/SourceManifestAction.java
@@ -93,11 +93,6 @@ public class SourceManifestAction extends AbstractFileWriteAction {
private final Runfiles runfiles;
/**
- * If non-null, the paths should be computed relative to this path fragment.
- */
- private final PathFragment root;
-
- /**
* Creates a new AbstractSourceManifestAction instance using latin1 encoding
* to write the manifest file and with a specified root path for manifest entries.
*
@@ -105,27 +100,25 @@ public class SourceManifestAction extends AbstractFileWriteAction {
* @param owner the action owner
* @param output the file to which to write the manifest
* @param runfiles runfiles
- * @param root the artifacts' root-relative path is relativized to this before writing it out
*/
private SourceManifestAction(ManifestWriter manifestWriter, ActionOwner owner, Artifact output,
- Runfiles runfiles, PathFragment root) {
+ Runfiles runfiles) {
super(owner, getDependencies(runfiles), output, false);
this.manifestWriter = manifestWriter;
this.runfiles = runfiles;
- this.root = root;
}
@VisibleForTesting
public void writeOutputFile(OutputStream out, EventHandler eventHandler)
throws IOException {
- writeFile(out, runfiles.getRunfilesInputs(root, eventHandler, getOwner().getLocation()));
+ writeFile(out, runfiles.getRunfilesInputs(eventHandler, getOwner().getLocation()));
}
@Override
public DeterministicWriter newDeterministicWriter(EventHandler eventHandler, Executor executor)
throws IOException {
final Pair<Map<PathFragment, Artifact>, Map<PathFragment, Artifact>> runfilesInputs =
- runfiles.getRunfilesInputs(root, eventHandler, getOwner().getLocation());
+ runfiles.getRunfilesInputs(eventHandler, getOwner().getLocation());
return new DeterministicWriter() {
@Override
public void writeOutputFile(OutputStream out) throws IOException {
@@ -215,16 +208,9 @@ public class SourceManifestAction extends AbstractFileWriteAction {
f.addPath(rootSymlink.getValue().getPath());
}
- if (root != null) {
- for (Artifact artifact : runfiles.getArtifactsWithoutMiddlemen()) {
- f.addPath(artifact.getRootRelativePath().relativeTo(root));
- f.addPath(artifact.getPath());
- }
- } else {
- for (Artifact artifact : runfiles.getArtifactsWithoutMiddlemen()) {
- f.addPath(artifact.getRootRelativePath());
- f.addPath(artifact.getPath());
- }
+ for (Artifact artifact : runfiles.getArtifactsWithoutMiddlemen()) {
+ f.addPath(artifact.getRootRelativePath());
+ f.addPath(artifact.getPath());
}
return f.hexDigestAndReset();
}
@@ -299,7 +285,7 @@ public class SourceManifestAction extends AbstractFileWriteAction {
/** Creates an action for the given runfiles. */
public static SourceManifestAction forRunfiles(ManifestType manifestType, ActionOwner owner,
Artifact output, Runfiles runfiles) {
- return new SourceManifestAction(manifestType, owner, output, runfiles, null);
+ return new SourceManifestAction(manifestType, owner, output, runfiles);
}
/**
@@ -309,7 +295,6 @@ public class SourceManifestAction extends AbstractFileWriteAction {
private final ManifestWriter manifestWriter;
private final ActionOwner owner;
private final Artifact output;
- private PathFragment top;
private final Runfiles.Builder runfilesBuilder = new Runfiles.Builder();
public Builder(ManifestType manifestType, ActionOwner owner, Artifact output) {
@@ -326,16 +311,7 @@ public class SourceManifestAction extends AbstractFileWriteAction {
}
public SourceManifestAction build() {
- return new SourceManifestAction(manifestWriter, owner, output, runfilesBuilder.build(), top);
- }
-
- /**
- * Sets the path fragment which is used to relativize the artifacts' root
- * relative paths further. Most likely, you don't need this.
- */
- public Builder setTopLevel(PathFragment top) {
- this.top = top;
- return this;
+ return new SourceManifestAction(manifestWriter, owner, output, runfilesBuilder.build());
}
/**