diff options
author | 2015-04-28 16:42:55 +0000 | |
---|---|---|
committer | 2015-04-28 21:13:32 +0000 | |
commit | 76c6536c40f8149de574e5ec56076a05e2e53087 (patch) | |
tree | 4a6622ce6ac31f38fad698b4ad43643845ba6b86 /src/java_tools/buildjar/java/com/google/devtools/build | |
parent | 67944d866d4b74b9c4af51d5097a51fed5a6c30e (diff) |
JavaBuilder: Remove old logic that tries to parse protos as textfiles.
--
MOS_MIGRATED_REVID=92255081
Diffstat (limited to 'src/java_tools/buildjar/java/com/google/devtools/build')
-rw-r--r-- | src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/DependencyModule.java | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/DependencyModule.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/DependencyModule.java index ab2e87138e..7bf8c518b5 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/DependencyModule.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/DependencyModule.java @@ -21,11 +21,9 @@ import com.google.devtools.build.lib.view.proto.Deps.Dependency.Kind; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; -import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileInputStream; import java.io.FileOutputStream; -import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.Collection; @@ -257,7 +255,8 @@ public final class DependencyModule { * Computes a reduced compile-time classpath from the union of direct dependencies and their * dependencies, as listed in the associated .deps artifacts. */ - public String computeStrictClasspath(String originalClasspath, String classDir) { + public String computeStrictClasspath(String originalClasspath, String classDir) + throws IOException { if (!strictClasspathMode) { return originalClasspath; } @@ -289,33 +288,19 @@ public final class DependencyModule { /** * Updates {@link #requiredClasspath} to include dependencies from the given output artifact. - * - * During the .deps migration from text to proto format, this method will try to handle both. - * Blaze can thus switch the .deps artifacts independently. */ - private void collectDependenciesFromArtifact(String path) { - // Try reading in proto format first + private void collectDependenciesFromArtifact(String path) throws IOException { try (BufferedInputStream bis = new BufferedInputStream(new FileInputStream(path))) { Deps.Dependencies deps = Deps.Dependencies.parseFrom(bis); - // Sanity check to make sure we have a valid proto, not a text file that happened to match. + // Sanity check to make sure we have a valid proto. if (!deps.hasRuleLabel()) { - throw new IOException("Text file"); + throw new IOException("Could not parse Deps.Dependencies message from proto."); } for (Deps.Dependency dep : deps.getDependencyList()) { if (dep.getKind() == Kind.EXPLICIT || dep.getKind() == Kind.IMPLICIT) { requiredClasspath.add(dep.getPath()); } } - } catch (IOException ex) { - // TODO(bazel-team): Remove this fallback to text format when Blaze is ready. - try (BufferedReader reader = new BufferedReader(new FileReader(path))) { - for (String dep = reader.readLine(); dep != null; dep = reader.readLine()) { - requiredClasspath.add(dep); - } - } catch (IOException exc) { - // At this point we can give up altogether - exc.printStackTrace(); - } } } |