diff options
author | cushon <cushon@google.com> | 2018-05-25 15:12:27 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-05-25 15:14:14 -0700 |
commit | 10141a3a351dd49376fc3e891634c5d91328a462 (patch) | |
tree | aa52e30af4bf43a2db39b9bd5727e99dd3bd267b /src/java_tools/buildjar | |
parent | e29c1830c88822639b32a13bac659eea9e4587ac (diff) |
Always use `/` as the path separator for jar entries
Fixes #5260
PiperOrigin-RevId: 198110476
Diffstat (limited to 'src/java_tools/buildjar')
-rw-r--r-- | src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/javac/JavacTurbineCompiler.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/javac/JavacTurbineCompiler.java b/src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/javac/JavacTurbineCompiler.java index 1a3b32f669..2db21b92db 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/javac/JavacTurbineCompiler.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/java/turbine/javac/JavacTurbineCompiler.java @@ -16,6 +16,7 @@ package com.google.devtools.build.java.turbine.javac; import static java.nio.charset.StandardCharsets.UTF_8; +import com.google.common.base.Joiner; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.jimfs.Configuration; @@ -105,7 +106,9 @@ public class JavacTurbineCompiler { @Override public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) throws IOException { - files.put(classes.relativize(path).toString(), Files.readAllBytes(path)); + // use `/` as the directory separator for jar paths, even on Windows + String name = Joiner.on('/').join(classes.relativize(path)); + files.put(name, Files.readAllBytes(path)); return FileVisitResult.CONTINUE; } }); |