From d82d8031f68b3afc3d5602d869a040d1be2bd69a Mon Sep 17 00:00:00 2001 From: jfrijters Date: Fri, 30 Mar 2007 05:47:46 +0000 Subject: [PATCH] Changed ikvmstub to use java.util.zip instead of SharpZipLib. --- ikvmstub/ikvmstub.8.csproj | 4 ---- ikvmstub/ikvmstub.build | 5 ----- ikvmstub/ikvmstub.cs | 42 ++++++++++++++++++++------------------ 3 files changed, 22 insertions(+), 29 deletions(-) diff --git a/ikvmstub/ikvmstub.8.csproj b/ikvmstub/ikvmstub.8.csproj index 0c30a0f4..cfdbe4e5 100644 --- a/ikvmstub/ikvmstub.8.csproj +++ b/ikvmstub/ikvmstub.8.csproj @@ -52,10 +52,6 @@ prompt - - ICSharpCode.SharpZipLib - ..\bin\ICSharpCode.SharpZipLib.dll - IKVM.GNU.Classpath ..\bin\IKVM.GNU.Classpath.dll diff --git a/ikvmstub/ikvmstub.build b/ikvmstub/ikvmstub.build index ff7e909d..a9307e25 100644 --- a/ikvmstub/ikvmstub.build +++ b/ikvmstub/ikvmstub.build @@ -1,14 +1,10 @@ - - - - @@ -19,7 +15,6 @@ - diff --git a/ikvmstub/ikvmstub.cs b/ikvmstub/ikvmstub.cs index 454a8300..de23fff8 100644 --- a/ikvmstub/ikvmstub.cs +++ b/ikvmstub/ikvmstub.cs @@ -1,5 +1,5 @@ /* - Copyright (C) 2002, 2004, 2005, 2006 Jeroen Frijters + Copyright (C) 2002, 2004, 2005, 2006, 2007 Jeroen Frijters This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,8 +26,8 @@ using System.Reflection; using System.IO; using System.Text; using System.Collections; -using ICSharpCode.SharpZipLib.Zip; using IKVM.Attributes; +using java.util.zip; public class NetExp { @@ -93,26 +93,28 @@ public class NetExp } else { - zipFile = new ZipOutputStream(new FileStream(assembly.GetName().Name + ".jar", FileMode.Create)); - try + using(zipFile = new ZipOutputStream(new java.io.FileOutputStream(assembly.GetName().Name + ".jar"))) { - ProcessAssembly(assembly); - } - catch(ReflectionTypeLoadException x) - { - Console.WriteLine(x); - Console.WriteLine("LoaderExceptions:"); - foreach(Exception n in x.LoaderExceptions) + zipFile.setComment(ikvm.runtime.Startup.getVersionAndCopyrightInfo()); + try { - Console.WriteLine(n); + ProcessAssembly(assembly); + } + catch(ReflectionTypeLoadException x) + { + Console.WriteLine(x); + Console.WriteLine("LoaderExceptions:"); + foreach (Exception n in x.LoaderExceptions) + { + Console.WriteLine(n); + } + } + catch(System.Exception x) + { + java.lang.Throwable.instancehelper_printStackTrace(ikvm.runtime.Util.mapException(x)); + rc = 1; } } - catch(System.Exception x) - { - java.lang.Throwable.instancehelper_printStackTrace(ikvm.runtime.Util.mapException(x)); - rc = 1; - } - zipFile.Close(); } // FXBUG if we run a static initializer that starts a thread, we would never end, // so we force an exit here @@ -149,8 +151,8 @@ public class NetExp private static void WriteClass(string name, byte[] buf) { - zipFile.PutNextEntry(new ZipEntry(name)); - zipFile.Write(buf, 0, buf.Length); + zipFile.putNextEntry(new ZipEntry(name)); + zipFile.write(buf, 0, buf.Length); } private static void ProcessAssembly(Assembly assembly)