aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java
diff options
context:
space:
mode:
authorGravatar Lukacs Berki <lberki@google.com>2015-09-22 07:40:24 +0000
committerGravatar Laszlo Csomor <laszlocsomor@google.com>2015-09-22 17:07:18 +0000
commitd72db8db34ea76a7939138d02c258035699b1f1c (patch)
treeeecae3f2ab5bc5ec73024b68d85c315cd6a1fbc9 /src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java
parentdfd3497c572f8710ad228ac35fda9f8053f004b4 (diff)
Thread the repository name all the way from TargetPatternResolver to RecursivePkgFunction.
This introduces some redundancy with RootedPath, but only in the case of remote repositories. There doesn't seem to be a good way of removing this redundancy. -- MOS_MIGRATED_REVID=103621610
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java
index d0c76333f2..f376a86830 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveDirectoryTraversalFunction.java
@@ -16,6 +16,7 @@ package com.google.devtools.build.lib.skyframe;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.devtools.build.lib.cmdline.PackageIdentifier;
+import com.google.devtools.build.lib.cmdline.PackageIdentifier.RepositoryName;
import com.google.devtools.build.lib.events.Event;
import com.google.devtools.build.lib.events.EventHandler;
import com.google.devtools.build.lib.packages.NoSuchPackageException;
@@ -64,7 +65,8 @@ abstract class RecursiveDirectoryTraversalFunction
* {@code excludedSubdirectoriesBeneathSubdirectory}, all of which must be proper subdirectories
* of {@code subdirectory}.
*/
- protected abstract SkyKey getSkyKeyForSubdirectory(RootedPath subdirectory,
+ protected abstract SkyKey getSkyKeyForSubdirectory(
+ RepositoryName repository, RootedPath subdirectory,
ImmutableSet<PathFragment> excludedSubdirectoriesBeneathSubdirectory);
/**
@@ -134,8 +136,8 @@ abstract class RecursiveDirectoryTraversalFunction
return getEmptyReturn();
}
- PackageIdentifier packageId =
- PackageIdentifier.createInDefaultRepo(rootRelativePath.getPathString());
+ PackageIdentifier packageId = new PackageIdentifier(
+ recursivePkgKey.getRepository(), rootRelativePath);
PackageLookupValue pkgLookupValue;
try {
pkgLookupValue = (PackageLookupValue) env.getValueOrThrow(PackageLookupValue.key(packageId),
@@ -248,8 +250,8 @@ abstract class RecursiveDirectoryTraversalFunction
ImmutableSet<PathFragment> excludedSubdirectoriesBeneathThisSubdirectory =
PathFragment.filterPathsStartingWith(excludedPaths, subdirectory);
RootedPath subdirectoryRootedPath = RootedPath.toRootedPath(root, subdirectory);
- childDeps.add(getSkyKeyForSubdirectory(subdirectoryRootedPath,
- excludedSubdirectoriesBeneathThisSubdirectory));
+ childDeps.add(getSkyKeyForSubdirectory(recursivePkgKey.getRepository(),
+ subdirectoryRootedPath, excludedSubdirectoriesBeneathThisSubdirectory));
if (env.valuesMissing()) {
return null;
}