diff options
author | Lukacs Berki <lberki@google.com> | 2015-06-12 11:37:46 +0000 |
---|---|---|
committer | Philipp Wollermann <philwo@google.com> | 2015-06-12 11:52:48 +0000 |
commit | 4833822ced449008ffc57d217334edac3122ef7e (patch) | |
tree | d85e6abf853d68568d47051c2f56eb605a561f71 /src/main/java/com/google/devtools/build/lib/packages/Preprocessor.java | |
parent | 19f3413dbc4bda45df09ddfbe882c41fc81350d8 (diff) |
Remove Path from Location, ParserInputSource and bunch of other low-level classes.
This makes the code cleaner because a lot of places never read the file and thus never needed a Path in the first place. I got to this change in a bit convoluted way:
- I wanted the default tools in Android rules to point to //external:
- I wanted to make sure that that doesn't cause an error is no Android rules are built, thus I had to add some binding for them in the default WORKSPACE file
- I wanted the Android rules not to depend on Bazel core with an eye towards eventually moving them to a separate jar / Skylark code
- The default WORKSPACE file is currently composed from files extracted by the Bazel launcher which would make the Android rules depend on a very core mechanism
- I couldn't simply pass in jdk.WORKSPACE as a String because Location, ParserInputSource and a bunch of other things needed a Path, which a simple string doesn't have.
Thus, this change.
--
MOS_MIGRATED_REVID=95828839
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/packages/Preprocessor.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/packages/Preprocessor.java | 6 |
1 files changed, 3 insertions, 3 deletions
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 8eda1e9dec..834fcaef36 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 @@ -17,7 +17,7 @@ import com.google.devtools.build.lib.events.EventHandler; import com.google.devtools.build.lib.packages.PackageFactory.Globber; import com.google.devtools.build.lib.syntax.Environment; import com.google.devtools.build.lib.syntax.ParserInputSource; -import com.google.devtools.build.lib.vfs.Path; +import com.google.devtools.build.lib.vfs.PathFragment; import java.io.IOException; import java.util.Set; @@ -119,12 +119,12 @@ public interface Preprocessor { /*containsTransientErrors=*/false); } - public static Result invalidSyntax(Path buildFile) { + public static Result invalidSyntax(PathFragment buildFile) { return new Result(ParserInputSource.create("", buildFile), /*preprocessed=*/true, /*containsPersistentErrors=*/true, /*containsTransientErrors=*/false); } - public static Result transientError(Path buildFile) { + public static Result transientError(PathFragment buildFile) { return new Result(ParserInputSource.create("", buildFile), /*preprocessed=*/false, /*containsPersistentErrors=*/false, /*containsTransientErrors=*/true); } |