diff options
author | 2017-04-06 18:48:43 +0000 | |
---|---|---|
committer | 2017-04-07 11:17:32 +0200 | |
commit | ed959e2a460e23cb253ce0c5c758e91e0f12e7bd (patch) | |
tree | 4890d5aae235835b3b34c6f9282b3a35886f515b /src | |
parent | 4d2a0a165015684b49267fa3f22e5481a9fcc643 (diff) |
Delete SubincludePreprocessor
RELNOTES: None.
PiperOrigin-RevId: 152408223
Diffstat (limited to 'src')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/packages/util/SubincludePreprocessor.java | 72 | ||||
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/skyframe/PackageFunctionTest.java | 7 |
2 files changed, 0 insertions, 79 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/SubincludePreprocessor.java b/src/test/java/com/google/devtools/build/lib/packages/util/SubincludePreprocessor.java deleted file mode 100644 index 28c0ef972f..0000000000 --- a/src/test/java/com/google/devtools/build/lib/packages/util/SubincludePreprocessor.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2015 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -package com.google.devtools.build.lib.packages.util; - -import com.google.devtools.build.lib.packages.CachingPackageLocator; -import com.google.devtools.build.lib.packages.Globber; -import com.google.devtools.build.lib.packages.Preprocessor; -import com.google.devtools.build.lib.syntax.ParserInputSource; -import com.google.devtools.build.lib.vfs.FileSystem; -import com.google.devtools.build.lib.vfs.FileSystemUtils; -import com.google.devtools.build.lib.vfs.Path; -import java.io.IOException; -import java.util.Set; - -/** - * Expands subinclude() statements, and returns an error if ERROR is - * present in the end-result. It does not run python, and is intended - * for testing - */ -public class SubincludePreprocessor implements Preprocessor { - /** Creates SubincludePreprocessor factories. */ - public static class FactorySupplier implements Preprocessor.Factory.Supplier { - @Override - public Factory getFactory(CachingPackageLocator loc, Path outputBase) { - final SubincludePreprocessor preprocessor = - new SubincludePreprocessor(outputBase.getFileSystem(), loc); - return new Factory() { - @Override - public boolean isStillValid() { - return true; - } - - @Override - public boolean considersGlobs() { - return false; - } - - @Override - public Preprocessor getPreprocessor() { - return preprocessor; - } - }; - } - } - - /** Constructs a SubincludePreprocessor. Arguments are ignored. The class will be removed soon. */ - public SubincludePreprocessor(FileSystem fileSystem, CachingPackageLocator packageLocator) {} - - @Override - public Preprocessor.Result preprocess( - Path buildFilePath, - byte[] buildFileBytes, - String packageName, - Globber globber, - Set<String> ruleNames) - throws IOException, InterruptedException { - char content[] = FileSystemUtils.convertFromLatin1(buildFileBytes); - return Preprocessor.Result.noPreprocessing( - ParserInputSource.create(content, buildFilePath.asFragment())); - } -} diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/PackageFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/PackageFunctionTest.java index b5a6000a43..2a0042665c 100644 --- a/src/test/java/com/google/devtools/build/lib/skyframe/PackageFunctionTest.java +++ b/src/test/java/com/google/devtools/build/lib/skyframe/PackageFunctionTest.java @@ -30,8 +30,6 @@ import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.cmdline.PackageIdentifier; import com.google.devtools.build.lib.packages.ConstantRuleVisibility; import com.google.devtools.build.lib.packages.NoSuchTargetException; -import com.google.devtools.build.lib.packages.Preprocessor; -import com.google.devtools.build.lib.packages.util.SubincludePreprocessor; import com.google.devtools.build.lib.pkgcache.PackageCacheOptions; import com.google.devtools.build.lib.pkgcache.PathPackageLocator; import com.google.devtools.build.lib.skyframe.util.SkyframeExecutorTestUtils; @@ -91,11 +89,6 @@ public class PackageFunctionTest extends BuildViewTestCase { } @Override - protected Preprocessor.Factory.Supplier getPreprocessorFactorySupplier() { - return new SubincludePreprocessor.FactorySupplier(); - } - - @Override protected FileSystem createFileSystem() { return fs; } |