aboutsummaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorLiam Miller-Cushon <cushon@google.com>2021-08-05 15:05:16 -0700
committerJavac Team <javac-team+copybara@google.com>2021-08-05 15:05:50 -0700
commit7ee2bdb29f763bdff523affaa3ff30edcd999b70 (patch)
tree56a671555a6f0d9e1a96bab5c3780103cf1d80ce /java
parent1426ef4f83b595946798865863f3a66bb7c912bd (diff)
downloadturbine-7ee2bdb29f763bdff523affaa3ff30edcd999b70.tar.gz
Create the output directory for jdeps if it doesn't already exist
PiperOrigin-RevId: 389033443
Diffstat (limited to 'java')
-rw-r--r--java/com/google/turbine/main/Main.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/java/com/google/turbine/main/Main.java b/java/com/google/turbine/main/Main.java
index f287267..0dc38e3 100644
--- a/java/com/google/turbine/main/Main.java
+++ b/java/com/google/turbine/main/Main.java
@@ -198,9 +198,9 @@ public final class Main {
if (options.outputDeps().isPresent()) {
DepsProto.Dependencies deps =
Dependencies.collectDeps(options.targetLabel(), bootclasspath, bound, lowered);
- try (OutputStream os =
- new BufferedOutputStream(
- Files.newOutputStream(Paths.get(options.outputDeps().get())))) {
+ Path path = Paths.get(options.outputDeps().get());
+ Files.createDirectories(path.getParent());
+ try (OutputStream os = new BufferedOutputStream(Files.newOutputStream(path))) {
deps.writeTo(os);
}
}