diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/packages')
4 files changed, 4 insertions, 41 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/Globber.java b/src/main/java/com/google/devtools/build/lib/packages/Globber.java index d3e3f135f2..cd337a1f27 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/Globber.java +++ b/src/main/java/com/google/devtools/build/lib/packages/Globber.java @@ -13,11 +13,8 @@ // limitations under the License. package com.google.devtools.build.lib.packages; -import com.google.devtools.build.lib.util.Pair; - import java.io.IOException; import java.util.List; -import java.util.Set; /** Interface for evaluating globs during package loading. */ public interface Globber { @@ -49,7 +46,4 @@ public interface Globber { /** Should be called when the globber is no longer needed. */ void onCompletion(); - - /** Returns all the glob computations requested before {@link #onCompletion} was called. */ - Set<Pair<String, Boolean>> getGlobPatterns(); } diff --git a/src/main/java/com/google/devtools/build/lib/packages/Package.java b/src/main/java/com/google/devtools/build/lib/packages/Package.java index 1201d72442..e01787adbb 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/Package.java +++ b/src/main/java/com/google/devtools/build/lib/packages/Package.java @@ -33,7 +33,6 @@ import com.google.devtools.build.lib.events.EventHandler; import com.google.devtools.build.lib.events.Location; import com.google.devtools.build.lib.packages.AttributeMap.AcceptsLabelAttribute; import com.google.devtools.build.lib.packages.License.DistributionType; -import com.google.devtools.build.lib.util.Pair; import com.google.devtools.build.lib.util.Preconditions; import com.google.devtools.build.lib.vfs.Canonicalizer; import com.google.devtools.build.lib.vfs.Path; @@ -672,9 +671,8 @@ public class Package { * * <p>Despite its name, this is the normal builder used when parsing BUILD files. */ + // TODO(bazel-team): This class is no longer needed and can be removed. public static class LegacyBuilder extends Builder { - private Globber globber = null; - LegacyBuilder(PackageIdentifier packageId, String runfilesPrefix) { super(packageId, runfilesPrefix); } @@ -690,14 +688,6 @@ public class Package { } /** - * Sets the globber used for this package's glob expansions. - */ - LegacyBuilder setGlobber(Globber globber) { - this.globber = globber; - return this; - } - - /** * Removes a target from the {@link Package} under construction. Intended to be used only by * {@link com.google.devtools.build.lib.skyframe.PackageFunction} to remove targets whose * labels cross subpackage boundaries. @@ -707,16 +697,6 @@ public class Package { this.targets.remove(target.getName()); } } - - /** - * Returns the glob patterns requested by {@link PackageFactory} during evaluation of this - * package's BUILD file. Intended to be used only by - * {@link com.google.devtools.build.lib.skyframe.PackageFunction} to mark the appropriate - * Skyframe dependencies after the fact. - */ - public Set<Pair<String, Boolean>> getGlobPatterns() { - return globber.getGlobPatterns(); - } } public static LegacyBuilder newExternalPackageBuilder(Path workspacePath, String runfilesPrefix) { diff --git a/src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java b/src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java index c1f30df5bf..22b14b4d49 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java +++ b/src/main/java/com/google/devtools/build/lib/packages/PackageFactory.java @@ -60,7 +60,6 @@ import com.google.devtools.build.lib.syntax.SkylarkSignatureProcessor; import com.google.devtools.build.lib.syntax.Statement; import com.google.devtools.build.lib.syntax.Type; import com.google.devtools.build.lib.syntax.Type.ConversionException; -import com.google.devtools.build.lib.util.Pair; import com.google.devtools.build.lib.util.Preconditions; import com.google.devtools.build.lib.vfs.FileSystemUtils; import com.google.devtools.build.lib.vfs.Path; @@ -262,7 +261,6 @@ public final class PackageFactory { // Used outside of Bazel! /** {@link Globber} that uses the legacy GlobCache. */ public static class LegacyGlobber implements Globber { - private final GlobCache globCache; public LegacyGlobber(GlobCache globCache) { @@ -282,11 +280,6 @@ public final class PackageFactory { } @Override - public Set<Pair<String, Boolean>> getGlobPatterns() { - return globCache.getKeySet(); - } - - @Override public Token runAsync(List<String> includes, List<String> excludes, boolean excludeDirs) throws BadGlobException { for (String pattern : Iterables.concat(includes, excludes)) { @@ -1185,7 +1178,7 @@ public final class PackageFactory { BuildFileAST buildFileAST = parseBuildFile(packageId, preprocessingResult.result, preludeStatements, localReporterForParsing); AstAfterPreprocessing astAfterPreprocessing = new AstAfterPreprocessing(preprocessingResult, - buildFileAST, localReporterForParsing, /*globber=*/null); + buildFileAST, localReporterForParsing); return createPackageFromPreprocessingAst( externalPkg, packageId, @@ -1500,8 +1493,7 @@ public final class PackageFactory { .setLoadingPhase() .build(); - pkgBuilder.setGlobber(globber) - .setFilename(buildFilePath) + pkgBuilder.setFilename(buildFilePath) .setMakeEnv(pkgMakeEnv) .setDefaultVisibility(defaultVisibility) // "defaultVisibility" comes from the command line. Let's give the BUILD file a chance to diff --git a/src/main/java/com/google/devtools/build/lib/packages/Preprocessor.java b/src/main/java/com/google/devtools/build/lib/packages/Preprocessor.java index 1cca195e3f..7a1f753678 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/Preprocessor.java +++ b/src/main/java/com/google/devtools/build/lib/packages/Preprocessor.java @@ -193,18 +193,15 @@ public interface Preprocessor { public final BuildFileAST ast; public final boolean containsAstParsingErrors; public final Iterable<Event> allEvents; - @Nullable - public final Globber globber; public AstAfterPreprocessing(Result preprocessingResult, BuildFileAST ast, - StoredEventHandler astParsingEventHandler, @Nullable Globber globber) { + StoredEventHandler astParsingEventHandler) { this.ast = ast; this.preprocessed = preprocessingResult.preprocessed; this.containsPreprocessingErrors = preprocessingResult.containsErrors; this.containsAstParsingErrors = astParsingEventHandler.hasErrors(); this.allEvents = Iterables.concat( preprocessingResult.events, astParsingEventHandler.getEvents()); - this.globber = globber; } } } |