aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/AnalysisPhaseStartedEvent.java
diff options
context:
space:
mode:
authorGravatar kchodorow <kchodorow@google.com>2017-03-30 16:45:03 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2017-03-31 17:09:07 +0200
commit1d9e1ac90197b1d3d7b137ba3c1ada67bb9ba31b (patch)
treee1fd678b5e641169c50762929b7641a17b4e147f /src/main/java/com/google/devtools/build/lib/analysis/AnalysisPhaseStartedEvent.java
parentea6f209f88e4292f0af5b75ef6872e1902eaeccd (diff)
Symlink output directories to the correct directory name
If the workspace directory is /path/to/my/proj and the name in the WORKSPACE file is "floop", this will symlink the output directories to output_base/execroot/floop instead of output_base/execroot/proj. More prep for #1262, fixes #1681. PiperOrigin-RevId: 151712384
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/AnalysisPhaseStartedEvent.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/AnalysisPhaseStartedEvent.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/AnalysisPhaseStartedEvent.java b/src/main/java/com/google/devtools/build/lib/analysis/AnalysisPhaseStartedEvent.java
index 48b746c655..25e95947e0 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/AnalysisPhaseStartedEvent.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/AnalysisPhaseStartedEvent.java
@@ -15,6 +15,7 @@
package com.google.devtools.build.lib.analysis;
import com.google.common.base.Function;
+import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.packages.Target;
@@ -26,19 +27,14 @@ import java.util.Collection;
*/
public class AnalysisPhaseStartedEvent {
- private final Iterable<Label> labels;
+ private final ImmutableSet<Target> targets;
/**
* Construct the event.
* @param targets The set of active targets that remain.
*/
public AnalysisPhaseStartedEvent(Collection<Target> targets) {
- this.labels = Iterables.transform(targets, new Function<Target, Label>() {
- @Override
- public Label apply(Target input) {
- return input.getLabel();
- }
- });
+ this.targets = ImmutableSet.copyOf(targets);
}
/**
@@ -46,6 +42,15 @@ public class AnalysisPhaseStartedEvent {
* of the targets we attempted to load.
*/
public Iterable<Label> getLabels() {
- return labels;
+ return Iterables.transform(targets, new Function<Target, Label>() {
+ @Override
+ public Label apply(Target input) {
+ return input.getLabel();
+ }
+ });
+ }
+
+ public ImmutableSet<Target> getTargets() {
+ return targets;
}
}