aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools
diff options
context:
space:
mode:
authorGravatar Laurent Le Brun <laurentlb@google.com>2016-10-11 12:23:01 +0000
committerGravatar Yue Gan <yueg@google.com>2016-10-11 13:26:55 +0000
commit884ca5ccf3c3241402149a4262d8a71da8e2e70f (patch)
tree3af8ca0b91a323feca69cf1aa91b5303ccd96bc1 /src/main/java/com/google/devtools
parent44ad7fa47e99edbda73484760990980fe99931d9 (diff)
Minor cleanup
- Load prelude_bazel as a .bzl file (to simplify code paths) - Remove a function in BuildFileAST that was used only in tests -- MOS_MIGRATED_REVID=135785708
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/ASTFileLookupFunction.java8
-rw-r--r--src/main/java/com/google/devtools/build/lib/syntax/BuildFileAST.java5
2 files changed, 1 insertions, 12 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ASTFileLookupFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/ASTFileLookupFunction.java
index 7419f31b7e..e6b3a958a3 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ASTFileLookupFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ASTFileLookupFunction.java
@@ -103,12 +103,9 @@ public class ASTFileLookupFunction implements SkyFunction {
//
BuildFileAST ast = null;
Path path = rootedPath.asPath();
- // Skylark files end with bzl
- boolean parseAsSkylark = filePathFragment.getPathString().endsWith(".bzl");
try {
long astFileSize = fileValue.getSize();
- if (parseAsSkylark) {
- try (Mutability mutability = Mutability.create("validate")) {
+ try (Mutability mutability = Mutability.create("validate")) {
ValidationEnvironment validationEnv =
new ValidationEnvironment(
ruleClassProvider
@@ -124,9 +121,6 @@ public class ASTFileLookupFunction implements SkyFunction {
ast = BuildFileAST.parseSkylarkFile(path, astFileSize, env.getListener());
ast = ast.validate(validationEnv, env.getListener());
}
- } else {
- ast = BuildFileAST.parseBuildFile(path, astFileSize, env.getListener());
- }
} catch (IOException e) {
throw new ASTLookupFunctionException(new ErrorReadingSkylarkExtensionException(e),
Transience.TRANSIENT);
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/BuildFileAST.java b/src/main/java/com/google/devtools/build/lib/syntax/BuildFileAST.java
index 497715adeb..934c7f2003 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/BuildFileAST.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/BuildFileAST.java
@@ -234,11 +234,6 @@ public class BuildFileAST extends ASTNode {
*
* @throws IOException if the file cannot not be read.
*/
- public static BuildFileAST parseBuildFile(Path buildFile, EventHandler eventHandler)
- throws IOException {
- return parseBuildFile(buildFile, buildFile.getFileSize(), eventHandler);
- }
-
public static BuildFileAST parseBuildFile(Path buildFile, long fileSize,
EventHandler eventHandler)
throws IOException {