diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java b/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java index d76a45ea95..6129c64a90 100644 --- a/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java +++ b/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java @@ -167,6 +167,15 @@ public class SkyQueryEnvironment extends AbstractBlazeQueryEnvironment<Target> { } @Override + public Collection<Target> getFwdDeps(Iterable<Target> targets) { + Set<Target> result = new HashSet<>(); + for (Target target : targets) { + result.addAll(getFwdDeps(target)); + } + return result; + } + + @Override public Collection<Target> getReverseDeps(final Target target) { return Collections2.filter(getRawReverseDeps(target), new Predicate<Target>() { @Override @@ -178,6 +187,15 @@ public class SkyQueryEnvironment extends AbstractBlazeQueryEnvironment<Target> { } @Override + public Collection<Target> getReverseDeps(Iterable<Target> targets) { + Set<Target> result = new HashSet<>(); + for (Target target : targets) { + result.addAll(getReverseDeps(target)); + } + return result; + } + + @Override public Set<Target> getTransitiveClosure(Set<Target> targets) { Set<Target> visited = new HashSet<>(); List<Target> result = new ArrayList<>(targets); |