Changed ikvmstub to use java.util.zip instead of SharpZipLib.

This commit is contained in:
jfrijters 2007-03-30 05:47:46 +00:00
Родитель 96507f1100
Коммит d82d8031f6
3 изменённых файлов: 22 добавлений и 29 удалений

Просмотреть файл

@ -52,10 +52,6 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="ICSharpCode.SharpZipLib">
<Name>ICSharpCode.SharpZipLib</Name>
<HintPath>..\bin\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="IKVM.GNU.Classpath"> <Reference Include="IKVM.GNU.Classpath">
<Name>IKVM.GNU.Classpath</Name> <Name>IKVM.GNU.Classpath</Name>
<HintPath>..\bin\IKVM.GNU.Classpath.dll</HintPath> <HintPath>..\bin\IKVM.GNU.Classpath.dll</HintPath>

Просмотреть файл

@ -1,14 +1,10 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<project name="ikvmstub" default="ikvmstub"> <project name="ikvmstub" default="ikvmstub">
<target name="ikvmstub"> <target name="ikvmstub">
<property overwrite="false" name="generics" value="false" />
<property name="defs" value="TRACE" /> <property name="defs" value="TRACE" />
<if test="${property::exists('signed')}"> <if test="${property::exists('signed')}">
<property name="defs" value="${defs};${signed}" /> <property name="defs" value="${defs};${signed}" />
</if> </if>
<if test="${generics}">
<property name="defs" value="${defs};GENERICS" />
</if>
<if test="${framework::get-target-framework()=='net-2.0'}"> <if test="${framework::get-target-framework()=='net-2.0'}">
<property name="defs" value="${defs};WHIDBEY" /> <property name="defs" value="${defs};WHIDBEY" />
</if> </if>
@ -19,7 +15,6 @@
<references> <references>
<include name="../bin/IKVM.GNU.Classpath.dll" asis="true" /> <include name="../bin/IKVM.GNU.Classpath.dll" asis="true" />
<include name="../bin/IKVM.Runtime.dll" asis="true" /> <include name="../bin/IKVM.Runtime.dll" asis="true" />
<include name="../bin/ICSharpCode.SharpZipLib.dll" asis="true" />
</references> </references>
</csc> </csc>
</target> </target>

Просмотреть файл

@ -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 This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages 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.IO;
using System.Text; using System.Text;
using System.Collections; using System.Collections;
using ICSharpCode.SharpZipLib.Zip;
using IKVM.Attributes; using IKVM.Attributes;
using java.util.zip;
public class NetExp public class NetExp
{ {
@ -93,26 +93,28 @@ public class NetExp
} }
else else
{ {
zipFile = new ZipOutputStream(new FileStream(assembly.GetName().Name + ".jar", FileMode.Create)); using(zipFile = new ZipOutputStream(new java.io.FileOutputStream(assembly.GetName().Name + ".jar")))
try
{ {
ProcessAssembly(assembly); zipFile.setComment(ikvm.runtime.Startup.getVersionAndCopyrightInfo());
} try
catch(ReflectionTypeLoadException x)
{
Console.WriteLine(x);
Console.WriteLine("LoaderExceptions:");
foreach(Exception n in x.LoaderExceptions)
{ {
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, // FXBUG if we run a static initializer that starts a thread, we would never end,
// so we force an exit here // so we force an exit here
@ -149,8 +151,8 @@ public class NetExp
private static void WriteClass(string name, byte[] buf) private static void WriteClass(string name, byte[] buf)
{ {
zipFile.PutNextEntry(new ZipEntry(name)); zipFile.putNextEntry(new ZipEntry(name));
zipFile.Write(buf, 0, buf.Length); zipFile.write(buf, 0, buf.Length);
} }
private static void ProcessAssembly(Assembly assembly) private static void ProcessAssembly(Assembly assembly)