Fix jar creation on windows

This commit is contained in:
Mark Harrah 2009-11-03 19:35:56 -05:00
parent d9a89aadeb
commit b9d04c89b9
1 changed files with 6 additions and 1 deletions

View File

@ -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)
{