From b9d04c89b9ffbd8acfd3c59cc49574fae678d972 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Tue, 3 Nov 2009 19:35:56 -0500 Subject: [PATCH] Fix jar creation on windows --- util/io/FileUtilities.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/io/FileUtilities.scala b/util/io/FileUtilities.scala index 83563740f..14a91c90d 100644 --- a/util/io/FileUtilities.scala +++ b/util/io/FileUtilities.scala @@ -247,7 +247,7 @@ object FileUtilities () else if(sourceFile.exists) { - val nextEntry = createEntry(name) + val nextEntry = createEntry(normalizeName(name)) nextEntry.setTime(sourceFile.lastModified) output.putNextEntry(nextEntry) transferAndClose(new FileInputStream(sourceFile), output) @@ -258,6 +258,11 @@ object FileUtilities sources.foreach(tupled(add)) output.closeEntry() } + private def normalizeName(name: String) = + { + val sep = File.separatorChar + if(sep == '/') name else name.replace(sep, '/') + } private def withZipOutput(file: File, manifest: Option[Manifest])(f: ZipOutputStream => Unit) {