diff options
author | nharmata <nharmata@google.com> | 2017-07-25 17:39:09 +0200 |
---|---|---|
committer | Jakob Buchgraber <buchgr@google.com> | 2017-07-26 10:34:53 +0200 |
commit | de0c535f123acd5344723ca128ead5d4491aed9c (patch) | |
tree | 327e964f18d2c7b9eab765b94b2f30eafd1ab4c1 /src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternFunction.java | |
parent | e24c97e4fd999ebf566fe30f614c569856a999b2 (diff) |
Generalize some of methods in TargetPattern, PrepareDepsOfPatternValue, and RecursivePackageProvider dealing with the concept of "excluded directories".
RELNOTES: None
PiperOrigin-RevId: 163074794
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternFunction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternFunction.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternFunction.java index a4a3b1bda8..b2ce5b6469 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternFunction.java @@ -84,15 +84,22 @@ public class PrepareDepsOfPatternFunction implements SkyFunction { if (blacklist == null) { return null; } - ImmutableSet<PathFragment> subdirectoriesToExclude = + // This SkyFunction is used to load the universe, so we want both the blacklisted directories + // from the global blacklist and the excluded directories from the TargetPatternKey itself to be + // embedded in the SkyKeys created and used by the DepsOfPatternPreparer. The + // DepsOfPatternPreparer ignores excludedSubdirectories and embeds blacklistedSubdirectories in + // the SkyKeys it creates and uses. + ImmutableSet<PathFragment> blacklistedSubdirectories = patternKey.getAllSubdirectoriesToExclude(blacklist.getPatterns()); + ImmutableSet<PathFragment> excludedSubdirectories = ImmutableSet.of(); DepsOfPatternPreparer preparer = new DepsOfPatternPreparer(env, pkgPath.get()); try { parsedPattern.eval( preparer, - subdirectoriesToExclude, + blacklistedSubdirectories, + excludedSubdirectories, NullCallback.<Void>instance(), RuntimeException.class); } catch (TargetParsingException e) { @@ -227,10 +234,12 @@ public class PrepareDepsOfPatternFunction implements SkyFunction { String originalPattern, String directory, boolean rulesOnly, + ImmutableSet<PathFragment> blacklistedSubdirectories, ImmutableSet<PathFragment> excludedSubdirectories, BatchCallback<Void, E> callback, Class<E> exceptionClass) throws TargetParsingException, E, InterruptedException { + Preconditions.checkArgument(excludedSubdirectories.isEmpty(), excludedSubdirectories); FilteringPolicy policy = rulesOnly ? FilteringPolicies.RULES_ONLY : FilteringPolicies.NO_FILTER; PathFragment pathFragment = TargetPatternResolverUtil.getPathFragment(directory); @@ -257,9 +266,9 @@ public class PrepareDepsOfPatternFunction implements SkyFunction { env.getValues( ImmutableList.of( PrepareDepsOfTargetsUnderDirectoryValue.key( - repository, rootedPath, excludedSubdirectories, policy), + repository, rootedPath, blacklistedSubdirectories, policy), CollectPackagesUnderDirectoryValue.key( - repository, rootedPath, excludedSubdirectories))); + repository, rootedPath, blacklistedSubdirectories))); if (env.valuesMissing()) { throw new MissingDepException(); } |