Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Added (optional) support for building without System.Core.dll depende…
Browse files Browse the repository at this point in the history
…ncy.
  • Loading branch information
jfrijters committed Oct 29, 2012
1 parent 7db5f8a commit 6234480
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 3 deletions.
39 changes: 39 additions & 0 deletions openjdk/ExtensionAttribute.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
Copyright (C) 2012 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
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jeroen Frijters
jeroen@frijters.net
*/
package cli.System.Runtime.CompilerServices;

import java.lang.annotation.*;

//
// This is a dummy ExtensionAttribute class to enable building without
// introducing a dependency on System.Core.dll
//
// To build without System.Core.dll dependency use this:
// nant -t:net-2.0 -D:SkipSystemCoreDependency=true
//
public class ExtensionAttribute
{
@Retention(RetentionPolicy.SOURCE)
public @interface Annotation { }
}
26 changes: 23 additions & 3 deletions openjdk/openjdk.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<include buildfile="../ikvm.include" />
<property name="pathsep" value=":" />
<property overwrite="false" name="signoption" value="" />
<property overwrite="false" name="SkipSystemCoreDependency" value="false" />
<property name="OPENJDK_VERSION" value="OpenJDK 7u6 b24" />
<property name="OpenJDK7.dir" value="${project::get-base-directory()}/../../openjdk-7u6-b24" />
<if test="${platform::is-win32()}">
Expand All @@ -26,7 +27,7 @@
</copy>
</target>

<target name="System.Core">
<target name="System.Core" unless="${SkipSystemCoreDependency}">
<delete file="System.Core.dll" />
<if test="${version::get-major(framework::get-version(framework::get-target-framework() )) &lt; 4}">
<copy file="../bin/IKVM.Reflection.dll" todir="." overwrite="true" />
Expand All @@ -48,6 +49,22 @@
</if>
</target>

<target name="DummySystemCoreJar">
<exec program="javac" commandline="-implicit:none ExtensionAttribute.java" useruntimeengine="false" />
<zip zipfile="System.Core.jar">
<fileset prefix="cli/System/Runtime/CompilerServices">
<include name="ExtensionAttribute.class" />
<include name="ExtensionAttribute$Annotation.class" />
</fileset>
</zip>
<delete>
<fileset basedir=".">
<include name="ExtensionAttribute.class" />
<include name="ExtensionAttribute$Annotation.class" />
</fileset>
</delete>
</target>

<target name="classes" depends="version allsources.gen.lst System.Core">
<delete>
<fileset basedir="../classpath">
Expand All @@ -71,7 +88,10 @@
</delete>
<exec program="${project::get-base-directory()}/../bin/ikvmstub.exe" commandline="-bootstrap mscorlib" useruntimeengine="true" />
<exec program="${project::get-base-directory()}/../bin/ikvmstub.exe" commandline="-bootstrap System" useruntimeengine="true" />
<exec program="${project::get-base-directory()}/../bin/ikvmstub.exe" commandline="-bootstrap System.Core" useruntimeengine="true" />
<exec program="${project::get-base-directory()}/../bin/ikvmstub.exe" commandline="-bootstrap System.Core" useruntimeengine="true" unless="${SkipSystemCoreDependency}" />
<if test="${SkipSystemCoreDependency}">
<call target="DummySystemCoreJar" />
</if>
<exec program="${project::get-base-directory()}/../bin/ikvmstub.exe" commandline="-bootstrap System.Data" useruntimeengine="true" />
<exec program="${project::get-base-directory()}/../bin/ikvmstub.exe" commandline="-bootstrap System.Drawing" useruntimeengine="true" />
<property name="IKVM.Runtime" value="IKVM.Runtime" />
Expand Down Expand Up @@ -185,7 +205,7 @@
<arg value="-sharedclassloader" />
<arg value="-r:mscorlib.dll" />
<arg value="-r:System.dll" />
<arg value="-r:System.Core.dll" />
<arg value="-r:System.Core.dll" unless="${SkipSystemCoreDependency}" />
<arg value="-r:IKVM.Runtime.dll" />
<!-- we already know that the JNI assembly is not available, so suppress the warning -->
<arg value="-nowarn:110" />
Expand Down

0 comments on commit 6234480

Please sign in to comment.