Skip to content

Commit

Permalink
Fixed that windows has an issue for generating a jar file
Browse files Browse the repository at this point in the history
  • Loading branch information
HongKee Moon committed Jun 17, 2022
1 parent fbe3b98 commit d032218
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/spim/plugin/compile/IOUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static void createJar(String inputDir, String output) throws IOException {
Manifest manifest = new Manifest();
manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0");
JarOutputStream target = new JarOutputStream(new FileOutputStream(output), manifest);
addFileJar(inputDir, new File(inputDir), target);
addFileJar(inputDir.replace("\\", "/"), new File(inputDir), target);
target.close();
}

Expand All @@ -167,7 +167,7 @@ private static void addFileJar(String root, File source, JarOutputStream target)
{
if (source.isDirectory())
{
String name = source.getPath().replace(root, "").replace("\\", "/");
String name = source.getPath().replace("\\", "/").replace(root, "");
if (!name.isEmpty())
{
if (!name.endsWith("/"))
Expand All @@ -182,7 +182,7 @@ private static void addFileJar(String root, File source, JarOutputStream target)
return;
}

JarEntry entry = new JarEntry(source.getPath().replace(root, "").replace("\\", "/"));
JarEntry entry = new JarEntry(source.getPath().replace("\\", "/").replace(root, ""));
entry.setTime(source.lastModified());
target.putNextEntry(entry);
in = new BufferedInputStream(new FileInputStream(source));
Expand Down

0 comments on commit d032218

Please sign in to comment.