split build file into components

This commit is contained in:
Brian Matzon 2008-04-20 18:46:34 +00:00
parent f256e7fa91
commit 90d03c3df3
5 changed files with 478 additions and 433 deletions

522
build.xml
View File

@ -1,154 +1,10 @@
<project name="LWJGL" default="all" basedir=".">
<!-- ================================================================== -->
<!-- Global properties for build -->
<!-- ================================================================== -->
<property name="lwjgl.src" location="src" />
<property name="lwjgl.src.native" location="${lwjgl.src}/native" />
<property name="lwjgl.src.headers" location="${lwjgl.src.native}/common" />
<property name="lwjgl.src.templates" location="${lwjgl.src}/templates" />
<property name="lwjgl.bin" location="bin" />
<property name="lwjgl.lib" location="libs" />
<property name="lwjgl.dist" location="dist" />
<property name="lwjgl.docs" location="doc" />
<property name="lwjgl.temp" location="temp" />
<property name="lwjgl.res" location="res" />
<property name="lwjgl.version" value="2.0a4" />
<import file="platform_build/build-definitions.xml"/>
<import file="platform_build/build-generator.xml"/>
<import file="platform_build/build-applet.xml"/>
<import file="platform_build/build-webstart.xml"/>
<property name="opengl-template-pattern" value="org/lwjgl/opengl/GL*.java,org/lwjgl/opengl/ARB*.java,org/lwjgl/opengl/ATI*.java,org/lwjgl/opengl/EXT*.java,org/lwjgl/opengl/NV*.java,org/lwjgl/opengl/HP*.java,org/lwjgl/opengl/IBM*.java,org/lwjgl/opengl/SUN*.java,org/lwjgl/opengl/SGIS*.java"/>
<!-- ================================================================== -->
<!-- Filesets used for targets -->
<!-- ================================================================== -->
<!-- Files to include in the lwjgl.jar file -->
<fileset id="lwjgl.fileset" dir="${lwjgl.bin}">
<include name="org/**/*" />
<exclude name="org/lwjgl/d3d/**" />
<exclude name="org/lwjgl/test/**" />
<exclude name="org/lwjgl/util/**" />
<exclude name="org/lwjgl/examples/**" />
</fileset>
<fileset id="lwjgl_util_applet.fileset" dir="${lwjgl.bin}">
<exclude name="**.*"/>
<include name="org/lwjgl/util/applet/**"/>
</fileset>
<!-- Files to include in the lwjgl_test.jar file -->
<fileset id="lwjgl_test.fileset" dir="${lwjgl.bin}">
<exclude name="**.*" />
<include name="org/lwjgl/test/**" />
<include name="org/lwjgl/examples/**" />
</fileset>
<!-- More files to include in the lwjgl_test.jar file -->
<fileset id="lwjgl_test_extra.fileset" dir="${lwjgl.src}/java">
<exclude name="**.*" />
<include name="org/lwjgl/test/opengl/shaders/shaderFP.fp" />
<include name="org/lwjgl/test/opengl/shaders/shaderFP.vp" />
<include name="org/lwjgl/test/opengl/shaders/shaderFSH.fsh" />
<include name="org/lwjgl/test/opengl/shaders/shaderFSH.vsh" />
<include name="org/lwjgl/test/opengl/shaders/shaderVP.vp" />
<include name="org/lwjgl/test/opengl/shaders/shaderVSH.vsh" />
</fileset>
<!-- Files to include in the lwjgl_util.jar file -->
<fileset id="lwjgl_util.fileset" dir="${lwjgl.bin}">
<exclude name="**.*" />
<exclude name="org/lwjgl/util/generator/**" />
<exclude name="org/lwjgl/util/applet/**" />
<include name="org/lwjgl/util/**" />
</fileset>
<!-- Files to include in the lwjgl_applet.jar file -->
<fileset id="lwjgl_applet.fileset" dir="${lwjgl.bin}">
<exclude name="**.*"/>
<include name="org/lwjgl/test/applet/**"/>
<include name="org/lwjgl/test/opengl/awt/AWTGearsCanvas.class"/>
</fileset>
<!-- Files to make Javadoc from -->
<fileset id="lwjgl.javadoc.fileset" dir="${lwjgl.src}">
<include name="**/*.java" />
<exclude name="native/**" />
<exclude name="templates/**" />
<exclude name="java/org/lwjgl/test/**" />
<exclude name="java/org/lwjgl/examples/**" />
<exclude name="java/org/lwjgl/util/generator/**" />
</fileset>
<!-- Files to include in doc package -->
<patternset id="lwjgl-docs.fileset">
<include name="CREDITS" />
<include name="LICENSE" />
<include name="README" />
<include name="lwjgl_hidden_switches.text" />
<include name="3rdparty/*" />
</patternset>
<!-- Files to include in win32 package -->
<patternset id="lwjgl-win32.fileset">
<include name="lwjgl.dll" />
<include name="OpenAL32.dll" />
<include name="jinput-dx8.dll" />
<include name="jinput-raw.dll" />
</patternset>
<!-- Files to include in linux, glibc2.3 package -->
<patternset id="lwjgl-linux.fileset">
<include name="liblwjgl*.so" />
<include name="libopenal.so" />
<include name="libjinput-linux.so" />
<include name="libjinput-linux64.so" />
</patternset>
<!-- Files to include in mac os x package -->
<patternset id="lwjgl-macosx.fileset">
<include name="liblwjgl.jnilib" />
<include name="openal.dylib" />
<include name="libjinput-osx.jnilib" />
<include name="libjinput-osx-legacy.jnilib" />
</patternset>
<!-- Files to include in source distribution -->
<fileset id="lwjgl.source.fileset" dir=".">
<include name="build.xml" />
<include name="src/**" />
<include name="platform_build/**/*" />
</fileset>
<!-- files in the base package -->
<patternset id="lwjgl_base">
<include name="**" />
<exclude name="res/ILtest.*" />
<exclude name="res/Missing_you.mod" />
<exclude name="res/phero*.*" />
</patternset>
<!-- files in the optional package -->
<patternset id="lwjgl_optional">
<include name="res/**" />
<exclude name="res/logo/**" />
<exclude name="res/spaceinvaders/**" />
<exclude name="res/*.wav" />
<exclude name="res/*.xpm" />
<include name="doc/CREDITS" />
<include name="doc/LICENSE" />
<include name="doc/README" />
</patternset>
<!-- files in the lwjgl_applet package -->
<patternset id="lwjgl_applet">
<include name="applet/**" />
<exclude name="applet/appletviewer.policy" />
<exclude name="applet/lwjglkeystore" />
</patternset>
<uptodate property="lwjgl.main.built" targetfile="${lwjgl.lib}/win32/lwjgl.dll" >
<srcfiles dir= "${lwjgl.src.native}/common" includes="*.c*"/>
<srcfiles dir= "${lwjgl.src.native}/windows" includes="*.c"/>
</uptodate>
<!-- ================================================================== -->
<!-- Everything below this line is targets. -->
<!-- Do not modify, unless you know what you're doing -->
@ -158,27 +14,20 @@
<!-- Initialize build -->
<!-- ================================================================== -->
<target name="-initialize">
<mkdir dir="${lwjgl.bin}" taskname="initialiazing bin folder" />
<mkdir dir="${lwjgl.bin}/lwjgl" taskname="initialiazing bin folder" />
<mkdir dir="${lwjgl.lib}" taskname="initialiazing lib folder" />
<mkdir dir="${lwjgl.dist}" taskname="initialiazing dist folder" />
<mkdir dir="${lwjgl.docs}/javadoc" taskname="initialiazing docs folder" />
<mkdir dir="${lwjgl.res}" taskname="initialiazing res folder" />
<mkdir dir="${lwjgl.temp}" taskname="initialiazing temp folder" />
<mkdir dir="${lwjgl.temp}/jar" taskname="initialiazing temp/jar folder" />
<mkdir dir="${lwjgl.temp}/doc" taskname="initialiazing temp/doc folder" />
<mkdir dir="${lwjgl.temp}/res" taskname="initialiazing temp/res folder" />
<mkdir dir="${lwjgl.temp}/native" taskname="initialiazing temp/native folder" />
<mkdir dir="${lwjgl.temp}/native/win32" taskname="initialiazing temp/win32 folder" />
<mkdir dir="${lwjgl.temp}/native/linux" taskname="initialiazing temp/linux folder" />
<mkdir dir="${lwjgl.temp}/native/macosx" taskname="initialiazing temp/macosx folder" />
</target>
<target name="clean-generated" description="Deletes the generated java and native source">
<delete quiet="true" failonerror="false">
<fileset dir="${lwjgl.src}/generated" includes="**"/>
<fileset dir="${lwjgl.src.native}/generated" includes="**"/>
</delete>
<mkdir dir="${lwjgl.bin}" taskname="initialiazing bin folder" />
<mkdir dir="${lwjgl.bin}/lwjgl" taskname="initialiazing bin folder" />
<mkdir dir="${lwjgl.lib}" taskname="initialiazing lib folder" />
<mkdir dir="${lwjgl.dist}" taskname="initialiazing dist folder" />
<mkdir dir="${lwjgl.docs}/javadoc" taskname="initialiazing docs folder" />
<mkdir dir="${lwjgl.res}" taskname="initialiazing res folder" />
<mkdir dir="${lwjgl.temp}" taskname="initialiazing temp folder" />
<mkdir dir="${lwjgl.temp}/jar" taskname="initialiazing temp/jar folder" />
<mkdir dir="${lwjgl.temp}/doc" taskname="initialiazing temp/doc folder" />
<mkdir dir="${lwjgl.temp}/res" taskname="initialiazing temp/res folder" />
<mkdir dir="${lwjgl.temp}/native" taskname="initialiazing temp/native folder" />
<mkdir dir="${lwjgl.temp}/native/win32" taskname="initialiazing temp/win32 folder" />
<mkdir dir="${lwjgl.temp}/native/linux" taskname="initialiazing temp/linux folder" />
<mkdir dir="${lwjgl.temp}/native/macosx" taskname="initialiazing temp/macosx folder" />
</target>
<!-- Cleans up any files created during the execution of this script -->
@ -208,11 +57,11 @@
<antcall target="-initialize" />
<!-- compile and create jars -->
<antcall target="generate-all"/>
<antcall target="generate-all"/>
<antcall target="compile" />
<antcall target="javadoc" />
<antcall target="javadoc" />
<antcall target="-createjars" />
<antcall target="applet-release" />
<antcall target="applet-release" />
<!-- copy resources to res folder -->
<copy todir="${lwjgl.temp}/res">
@ -274,96 +123,6 @@
<fileset refid="lwjgl_util.fileset" />
</jar>
</target>
<target name="applettest" depends="applet">
<exec executable="appletviewer">
<arg value="-J-Djava.security.policy=applet/appletviewer.policy"/>
<arg path="applet/applet.html"/>
</exec>
</target>
<target name="runtest" depends="all">
<fail message="test.mainclass is not set. Use 'ant -Dtest.mainclass=&lt;main-class&gt; runtest'" unless="test.mainclass"/>
<condition property="native_path" value="libs/win32">
<os family="windows" />
</condition>
<condition property="native_path" value="libs/linux">
<os name="Linux" />
</condition>
<condition property="native_path" value="libs/macosx">
<os name="Mac OS X" />
</condition>
<property name="native_path_expanded" location="${native_path}"/>
<java classname="${test.mainclass}" classpath="res:${lwjgl.lib}/lwjgl.jar:${lwjgl.lib}/lwjgl_util.jar:${lwjgl.lib}/lwjgl_test.jar:${lwjgl.lib}/jinput.jar" fork="true">
<sysproperty key="org.lwjgl.util.Debug" value="true"/>
<sysproperty key="java.library.path" value="${native_path_expanded}"/>
</java>
</target>
<target name="applet" depends="all">
<antcall target="-applet">
<param name="keystore" value="applet/lwjglkeystore"/>
<param name="alias" value="lwjgl"/>
<param name="password" value="123456"/>
</antcall>
</target>
<target name="applet-release">
<input message="Please type the password for the keystore" addproperty="sign.pwd"/>
<antcall target="-applet">
<param name="keystore" value="signing/matzon_java_code_signing.keystore"/>
<param name="alias" value="oddlabs_java_code_signing"/>
<param name="password" value="${sign.pwd}"/>
</antcall>
</target>
<target name="-applet">
<!-- Create lwjgl_applet.jar -->
<jar destfile="applet/lwjgl_applet.jar" taskname="lwjgl_applet.jar">
<fileset refid="lwjgl_applet.fileset" />
</jar>
<!-- create each of the native jars -->
<jar destfile="applet/windows_natives.jar" taskname="windows_natives.jar">
<fileset dir="${lwjgl.lib}/win32">
<patternset refid="lwjgl-win32.fileset"/>
</fileset>
</jar>
<signjar jar="applet/windows_natives.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<jar destfile="applet/linux_natives.jar" taskname="linux_natives.jar">
<fileset dir="${lwjgl.lib}/linux">
<patternset refid="lwjgl-linux.fileset"/>
</fileset>
</jar>
<signjar jar="applet/linux_natives.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<jar destfile="applet/macosx_natives.jar" taskname="macosx_natives.jar">
<fileset dir="${lwjgl.lib}/macosx">
<patternset refid="lwjgl-macosx.fileset"/>
</fileset>
</jar>
<signjar jar="applet/macosx_natives.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<jar destfile="${lwjgl.lib}/lwjgl_util_applet.jar" update="true">
<fileset dir="${lwjgl.res}" includes="applet*"/>
</jar>
<copy file="${lwjgl.lib}/lwjgl.jar" todir="applet"/>
<copy file="${lwjgl.lib}/lwjgl_util_applet.jar" todir="applet"/>
<copy file="${lwjgl.lib}/lwjgl_util.jar" todir="applet"/>
<copy file="${lwjgl.lib}/jinput.jar" todir="applet"/>
<zip destfile="applet/res.jar">
<zipfileset dir="${lwjgl.res}" includes="Footsteps.wav, ILtest.tga, Missing_you.mod"/>
</zip>
<signjar jar="applet/lwjgl.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<signjar jar="applet/jinput.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<signjar jar="applet/lwjgl_util_applet.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
</target>
<!-- Distributes files -->
<target name="-distribute">
@ -413,27 +172,10 @@
<zip destfile="${lwjgl.dist}/lwjgl-source-${lwjgl.version}.zip">
<fileset refid="lwjgl.source.fileset" />
</zip>
</target>
<!-- Compiles the Java source code -->
<target name="compile" description="Compiles the java source code" depends="-initialize">
<javac debug="yes" destdir="${lwjgl.bin}" source="1.4" target="1.4" classpath="${lwjgl.lib}/jinput.jar" taskname="core">
<src path="${lwjgl.src}/java/"/>
<src path="${lwjgl.src}/generated/"/>
<include name="org/lwjgl/*.java"/>
<include name="org/lwjgl/input/**"/>
<include name="org/lwjgl/opengl/**"/>
<include name="org/lwjgl/openal/**"/>
<include name="org/lwjgl/util/**"/>
<exclude name="org/lwjgl/util/generator/**"/>
</javac>
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/test/**" source="1.4" target="1.4" taskname="test" />
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/examples/**" source="1.4" target="1.4" taskname="examples" />
</target>
</target>
<!-- Generates the native headers from source files -->
<target name="headers" description="invokes javah on java classes" depends="compile">
<!-- platform specific classes -->
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/linux" force="yes">
<class name="org.lwjgl.opengl.LinuxEvent" />
<class name="org.lwjgl.opengl.LinuxMouse" />
@ -448,7 +190,6 @@
</javah>
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/windows" force="yes">
<!-- OpenGL -->
<class name="org.lwjgl.opengl.WindowsKeyboard" />
<class name="org.lwjgl.opengl.WindowsPbufferPeerInfo" />
<class name="org.lwjgl.opengl.WindowsDisplay" />
@ -469,110 +210,35 @@
<class name="org.lwjgl.opengl.MacOSXContextImplementation" />
</javah>
<!-- lwjgl -->
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}" force="yes">
<class name="org.lwjgl.opengl.AWTSurfaceLock" />
<class name="org.lwjgl.DefaultSysImplementation" />
<class name="org.lwjgl.input.Cursor" />
<class name="org.lwjgl.input.Keyboard" />
<class name="org.lwjgl.input.Mouse" />
<class name="org.lwjgl.openal.AL" />
<class name="org.lwjgl.opengl.GLContext" />
<class name="org.lwjgl.opengl.Pbuffer" />
</javah>
</target>
<!-- Compiles the Java source code -->
<target name="compile" description="Compiles the java source code" depends="-initialize">
<javac debug="yes" destdir="${lwjgl.bin}" source="1.4" target="1.4" classpath="${lwjgl.lib}/jinput.jar" taskname="core">
<src path="${lwjgl.src}/java/"/>
<src path="${lwjgl.src}/generated/"/>
<include name="org/lwjgl/*.java"/>
<include name="org/lwjgl/input/**"/>
<include name="org/lwjgl/opengl/**"/>
<include name="org/lwjgl/openal/**"/>
<include name="org/lwjgl/util/**"/>
<exclude name="org/lwjgl/util/generator/**"/>
</javac>
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/test/**" source="1.4" target="1.4" taskname="test" />
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/examples/**" source="1.4" target="1.4" taskname="examples" />
</target>
<!-- Creates the Javadoc -->
<target name="javadoc" description="Creates javadoc from java source code">
<javadoc destdir="${lwjgl.docs}/javadoc" classpath="${lwjgl.lib}/jinput.jar" author="true" version="true" use="true" source="1.4" windowtitle="LWJGL API">
<fileset refid="lwjgl.javadoc.fileset" />
<doctitle><![CDATA[<h1>Lightweight Java Game Toolkit</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright &#169; 2002-2008 lwjgl.org. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
<!-- Compiles the Java source code -->
<target name="generators" description="Compiles the native method generators">
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/util/generator/**.java" source="1.5" target="1.5" taskname="generator">
<compilerarg value="-Xlint:all"/>
</javac>
</target>
<target name="generate-all" depends="generate-openal, generate-opengl, generate-opengl-capabilities, generate-opengl-references" description="Generates java and native source"/>
<target name="generate-openal" depends="generators" description="Generates java and native source for AL">
<!-- Generate OpenAL -->
<apply executable="apt" parallel="true">
<arg value="-nocompile"/>
<arg value="-factory"/>
<arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/>
<arg value="-cp"/>
<arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
<arg value="-s"/>
<arg path="${lwjgl.src}/generated"/>
<arg value="-d"/>
<arg path="${lwjgl.src.native}/generated"/>
<arg value="-Atypemap=org.lwjgl.util.generator.ALTypeMap"/>
<arg value="-Ageneratechecks"/>
<fileset dir="${lwjgl.src.templates}" includes="org/lwjgl/openal/AL10.java, org/lwjgl/openal/AL11.java"/>
</apply>
</target>
<target name="generate-opengl" depends="generators" description="Generates java and native source for GL">
<!-- there's no apt task in ant yet, so we'll just invoke it manually for now -->
<apply executable="apt" parallel="true">
<arg value="-nocompile"/>
<arg value="-factory"/>
<arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/>
<arg value="-cp"/>
<arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
<arg value="-s"/>
<arg path="${lwjgl.src}/generated"/>
<arg value="-d"/>
<arg path="${lwjgl.src.native}/generated"/>
<!-- <arg value="-Ageneratechecks"/>-->
<arg value="-Acontextspecific"/>
<arg value="-Atypemap=org.lwjgl.util.generator.GLTypeMap"/>
<fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/>
</apply>
</target>
<target name="generate-opengl-references" depends="generators" description="Generates java and native source for GL">
<!-- Generate context capabilities -->
<apply executable="apt" parallel="true">
<arg value="-nocompile"/>
<arg value="-factory"/>
<arg value="org.lwjgl.util.generator.ReferencesGeneratorProcessorFactory"/>
<arg value="-cp"/>
<arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
<arg value="-s"/>
<arg path="${lwjgl.src}/generated"/>
<fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/>
</apply>
</target>
<target name="generate-opengl-capabilities" depends="generators" description="Generates java and native source for GL">
<!-- Generate context capabilities -->
<apply executable="apt" parallel="true">
<arg value="-nocompile"/>
<arg value="-factory"/>
<arg value="org.lwjgl.util.generator.ContextGeneratorProcessorFactory"/>
<arg value="-cp"/>
<arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
<arg value="-s"/>
<arg path="${lwjgl.src}/generated"/>
<arg value="-Acontextspecific"/>
<fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/>
</apply>
</target>
<target name="compile_native_all" depends="compile_native" description="Compiles the native files"/>
<!-- Compiles the native files -->
<target name="compile_native" depends="headers" description="Compiles the native files">
<!-- check each platform, and run their build target -->
<condition property="lwjgl.platform.windows">
<os family="windows" />
</condition>
@ -603,75 +269,65 @@
</copy>
</target>
<!-- Compiles LWJGL on Mac platforms -->
<target name="-compile_native_macosx" if="lwjgl.platform.macosx">
<ant antfile="platform_build/macosx_ant/build.xml" inheritAll="false"/>
<copy file="${lwjgl.bin}/lwjgl/liblwjgl.jnilib" todir="${lwjgl.lib}/macosx"/>
</target>
<target name="webstart_demo" depends="jars">
<antcall target="-webstart_demo">
<param name="keystore" value="applet/lwjglkeystore"/>
<param name="alias" value="lwjgl"/>
<param name="password" value="123456"/>
</antcall>
</target>
<target name="webstart_demo-release" depends="jars">
<input message="Please type the password for the keystore" addproperty="sign.pwd"/>
<target name="repack200" description="Pack200-repack a jar file">
<pack200 src="${input}" destfile="${output}" repack="true"/>
</target>
<antcall target="-webstart_demo">
<param name="keystore" value="signing/matzon_java_code_signing.keystore"/>
<param name="alias" value="oddlabs_java_code_signing"/>
<param name="password" value="${sign.pwd}"/>
</antcall>
<target name="pack200" description="Pack200 a jar file">
<pack200 src="${input}" destfile="${output}"/>
</target>
<target name="lzma" description="LZMA compress a file">
<java fork="true" classname="SevenZip.LzmaAlone">
<classpath>
<pathelement location="platform_build/JLzma.jar"/>
</classpath>
<jvmarg value="-Xmx512m"/>
<arg value="e"/>
<arg value="${input}"/>
<arg value="${output}"/>
</java>
</target>
<!-- -->
<target name="-webstart_demo" description="Using released files, creates the necessary files used for jnlp demos">
<!-- delete existing temp -->
<delete dir="${lwjgl.temp}"/>
<!-- unzip common files -->
<unzip src="${lwjgl.dist}/lwjgl-${lwjgl.version}.zip" dest="${lwjgl.temp}/jnlp/temp" overwrite="true"/>
<!-- move files to unified structure -->
<move todir="${lwjgl.temp}/jnlp/temp">
<fileset dir="${lwjgl.temp}/jnlp/temp/lwjgl-${lwjgl.version}/">
<include name="**"/>
</fileset>
</move>
<!-- move relevant files to root -->
<move todir="${lwjgl.temp}/jnlp/" flatten="true">
<fileset dir="${lwjgl.temp}/jnlp/temp">
<include name="**/**.jar"/>
</fileset>
</move>
<!-- create native jars -->
<jar destfile="${lwjgl.temp}/jnlp/native_win32.jar" basedir="${lwjgl.temp}/jnlp/temp/native/win32"/>
<jar destfile="${lwjgl.temp}/jnlp/native_linux.jar" basedir="${lwjgl.temp}/jnlp/temp/native/linux"/>
<jar destfile="${lwjgl.temp}/jnlp/native_macosx.jar" basedir="${lwjgl.temp}/jnlp/temp/native/macosx"/>
<!-- create media jar -->
<jar destfile="${lwjgl.temp}/jnlp/media.jar" basedir="${lwjgl.res}"/>
<!-- sign 'em -->
<signjar jar="${lwjgl.temp}/jnlp/lwjgl.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<signjar jar="${lwjgl.temp}/jnlp/lwjgl_util.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<signjar jar="${lwjgl.temp}/jnlp/native_linux.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<signjar jar="${lwjgl.temp}/jnlp/native_macosx.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<signjar jar="${lwjgl.temp}/jnlp/native_win32.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<signjar jar="${lwjgl.temp}/jnlp/jinput.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<target name="applettest" depends="applet">
<exec executable="appletviewer">
<arg value="-J-Djava.security.policy=applet/appletviewer.policy"/>
<arg path="applet/applet.html"/>
</exec>
</target>
<target name="runtest" depends="all">
<fail message="test.mainclass is not set. Use 'ant -Dtest.mainclass=&lt;main-class&gt; runtest'" unless="test.mainclass"/>
<condition property="native_path" value="libs/win32">
<os family="windows" />
</condition>
<condition property="native_path" value="libs/linux">
<os name="Linux" />
</condition>
<condition property="native_path" value="libs/macosx">
<os name="Mac OS X" />
</condition>
<property name="native_path_expanded" location="${native_path}"/>
<java classname="${test.mainclass}" classpath="res:${lwjgl.lib}/lwjgl.jar:${lwjgl.lib}/lwjgl_util.jar:${lwjgl.lib}/lwjgl_test.jar:${lwjgl.lib}/jinput.jar" fork="true">
<sysproperty key="org.lwjgl.util.Debug" value="true"/>
<sysproperty key="java.library.path" value="${native_path_expanded}"/>
</java>
</target>
<target name="changelog">
<cvschangelog destfile="changelog.xml"/>
<style in="changelog.xml" out="changelog.html" style="${ant.home}/etc/changelog.xsl">
<param name="title" expression="LWJGL ChangeLog"/>
<param name="module" expression="LWJGL"/>
<param name="cvsweb" expression="http://cvs.sourceforge.net/viewcvs.py/java-game-lib/"/>
</style>
</target>
<!-- Creates the Javadoc -->
<target name="javadoc" description="Creates javadoc from java source code">
<javadoc destdir="${lwjgl.docs}/javadoc" classpath="${lwjgl.lib}/jinput.jar" author="true" version="true" use="true" source="1.4" windowtitle="LWJGL API">
<fileset refid="lwjgl.javadoc.fileset" />
<doctitle><![CDATA[<h1>Lightweight Java Game Toolkit</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright &#169; 2002-2008 lwjgl.org. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
</project>

View File

@ -0,0 +1,94 @@
<project name="applet">
<!-- Create our packer task -->
<taskdef name="pack200" classname="com.sun.tools.apache.ant.pack200.Pack200Task" classpath="platform_build/Pack200Task.jar"/>
<target name="applet" depends="all">
<antcall target="-applet">
<param name="keystore" value="applet/lwjglkeystore"/>
<param name="alias" value="lwjgl"/>
<param name="password" value="123456"/>
</antcall>
</target>
<target name="applet-release">
<input message="Please type the password for the keystore" addproperty="sign.pwd"/>
<antcall target="-applet">
<param name="keystore" value="signing/matzon_java_code_signing.keystore"/>
<param name="alias" value="oddlabs_java_code_signing"/>
<param name="password" value="${sign.pwd}"/>
</antcall>
</target>
<target name="-applet">
<!-- Create lwjgl_applet.jar -->
<jar destfile="applet/lwjgl_applet.jar" taskname="lwjgl_applet.jar">
<fileset refid="lwjgl_applet.fileset" />
</jar>
<!-- create each of the native jars -->
<jar destfile="applet/windows_natives.jar" taskname="windows_natives.jar">
<fileset dir="${lwjgl.lib}/win32">
<patternset refid="lwjgl-win32.fileset"/>
</fileset>
</jar>
<signjar jar="applet/windows_natives.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<jar destfile="applet/linux_natives.jar" taskname="linux_natives.jar">
<fileset dir="${lwjgl.lib}/linux">
<patternset refid="lwjgl-linux.fileset"/>
</fileset>
</jar>
<signjar jar="applet/linux_natives.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<jar destfile="applet/macosx_natives.jar" taskname="macosx_natives.jar">
<fileset dir="${lwjgl.lib}/macosx">
<patternset refid="lwjgl-macosx.fileset"/>
</fileset>
</jar>
<signjar jar="applet/macosx_natives.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<jar destfile="${lwjgl.lib}/lwjgl_util_applet.jar" update="true">
<fileset dir="${lwjgl.res}" includes="applet*"/>
</jar>
<copy file="${lwjgl.lib}/lwjgl.jar" todir="applet"/>
<copy file="${lwjgl.lib}/lwjgl_util_applet.jar" todir="applet"/>
<copy file="${lwjgl.lib}/lwjgl_util.jar" todir="applet"/>
<copy file="${lwjgl.lib}/jinput.jar" todir="applet"/>
<copy file="${lwjgl.lib}/lzma.jar" todir="applet"/>
<zip destfile="applet/res.jar">
<zipfileset dir="${lwjgl.res}" includes="Footsteps.wav, ILtest.tga, Missing_you.mod"/>
</zip>
<!--<antcall target="applet-compress">
<param name="dir" value="applet/"/>
<param name="jarfile" value="lwjgl"/>
</antcall>
<fail/>-->
</target>
<target name="applet-compress">
<antcall target="repack">
<param name="input" value="${dir}${jarfile}.jar"/>
<param name="output" value="${dir}${jarfile}-repack.jar"/>
</antcall>
<signjar jar="${dir}${jarfile}.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<signjar jar="${dir}${jarfile}-repack.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<antcall target="pack">
<param name="input" value="${dir}${jarfile}-repack.jar"/>
<param name="output" value="${dir}${jarfile}.jar.pack"/>
</antcall>
<antcall target="lzma">
<param name="input" value="${dir}${jarfile}.jar.pack"/>
<param name="output" value="${dir}${jarfile}.jar.pack.lzma"/>
</antcall>
<antcall target="lzma">
<param name="input" value="${dir}${jarfile}.jar"/>
<param name="output" value="${dir}${jarfile}.jar.lzma"/>
</antcall>
<delete file="${dir}${jarfile}-repack.jar"/>
</target>
</project>

View File

@ -0,0 +1,150 @@
<project name="definitions">
<!-- ================================================================== -->
<!-- Global properties for build -->
<!-- ================================================================== -->
<property name="lwjgl.src" location="src" />
<property name="lwjgl.src.native" location="${lwjgl.src}/native" />
<property name="lwjgl.src.headers" location="${lwjgl.src.native}/common" />
<property name="lwjgl.src.templates" location="${lwjgl.src}/templates" />
<property name="lwjgl.bin" location="bin" />
<property name="lwjgl.lib" location="libs" />
<property name="lwjgl.dist" location="dist" />
<property name="lwjgl.docs" location="doc" />
<property name="lwjgl.temp" location="temp" />
<property name="lwjgl.res" location="res" />
<property name="lwjgl.version" value="2.0a4" />
<property name="opengl-template-pattern" value="org/lwjgl/opengl/GL*.java,org/lwjgl/opengl/ARB*.java,org/lwjgl/opengl/ATI*.java,org/lwjgl/opengl/EXT*.java,org/lwjgl/opengl/NV*.java,org/lwjgl/opengl/HP*.java,org/lwjgl/opengl/IBM*.java,org/lwjgl/opengl/SUN*.java,org/lwjgl/opengl/SGIS*.java"/>
<!-- ================================================================== -->
<!-- Filesets used for targets -->
<!-- ================================================================== -->
<!-- Files to include in the lwjgl.jar file -->
<fileset id="lwjgl.fileset" dir="${lwjgl.bin}">
<include name="org/**/*" />
<exclude name="org/lwjgl/d3d/**" />
<exclude name="org/lwjgl/test/**" />
<exclude name="org/lwjgl/util/**" />
<exclude name="org/lwjgl/examples/**" />
</fileset>
<fileset id="lwjgl_util_applet.fileset" dir="${lwjgl.bin}">
<exclude name="**.*"/>
<include name="org/lwjgl/util/applet/**"/>
</fileset>
<!-- Files to include in the lwjgl_test.jar file -->
<fileset id="lwjgl_test.fileset" dir="${lwjgl.bin}">
<exclude name="**.*" />
<include name="org/lwjgl/test/**" />
<include name="org/lwjgl/examples/**" />
</fileset>
<!-- More files to include in the lwjgl_test.jar file -->
<fileset id="lwjgl_test_extra.fileset" dir="${lwjgl.src}/java">
<exclude name="**.*" />
<include name="org/lwjgl/test/opengl/shaders/shaderFP.fp" />
<include name="org/lwjgl/test/opengl/shaders/shaderFP.vp" />
<include name="org/lwjgl/test/opengl/shaders/shaderFSH.fsh" />
<include name="org/lwjgl/test/opengl/shaders/shaderFSH.vsh" />
<include name="org/lwjgl/test/opengl/shaders/shaderVP.vp" />
<include name="org/lwjgl/test/opengl/shaders/shaderVSH.vsh" />
</fileset>
<!-- Files to include in the lwjgl_util.jar file -->
<fileset id="lwjgl_util.fileset" dir="${lwjgl.bin}">
<exclude name="**.*" />
<exclude name="org/lwjgl/util/generator/**" />
<exclude name="org/lwjgl/util/applet/**" />
<include name="org/lwjgl/util/**" />
</fileset>
<!-- Files to include in the lwjgl_applet.jar file -->
<fileset id="lwjgl_applet.fileset" dir="${lwjgl.bin}">
<exclude name="**.*"/>
<include name="org/lwjgl/test/applet/**"/>
<include name="org/lwjgl/test/opengl/awt/AWTGearsCanvas.class"/>
</fileset>
<!-- Files to make Javadoc from -->
<fileset id="lwjgl.javadoc.fileset" dir="${lwjgl.src}">
<include name="**/*.java" />
<exclude name="native/**" />
<exclude name="templates/**" />
<exclude name="java/org/lwjgl/test/**" />
<exclude name="java/org/lwjgl/examples/**" />
<exclude name="java/org/lwjgl/util/generator/**" />
</fileset>
<!-- Files to include in doc package -->
<patternset id="lwjgl-docs.fileset">
<include name="CREDITS" />
<include name="LICENSE" />
<include name="README" />
<include name="lwjgl_hidden_switches.text" />
<include name="3rdparty/*" />
</patternset>
<!-- Files to include in win32 package -->
<patternset id="lwjgl-win32.fileset">
<include name="lwjgl.dll" />
<include name="OpenAL32.dll" />
<include name="jinput-dx8.dll" />
<include name="jinput-raw.dll" />
</patternset>
<!-- Files to include in linux, glibc2.3 package -->
<patternset id="lwjgl-linux.fileset">
<include name="liblwjgl*.so" />
<include name="libopenal.so" />
<include name="libjinput-linux.so" />
<include name="libjinput-linux64.so" />
</patternset>
<!-- Files to include in mac os x package -->
<patternset id="lwjgl-macosx.fileset">
<include name="liblwjgl.jnilib" />
<include name="openal.dylib" />
<include name="libjinput-osx.jnilib" />
<include name="libjinput-osx-legacy.jnilib" />
</patternset>
<!-- Files to include in source distribution -->
<fileset id="lwjgl.source.fileset" dir=".">
<include name="build.xml" />
<include name="src/**" />
<include name="platform_build/**/*" />
</fileset>
<!-- files in the base package -->
<patternset id="lwjgl_base">
<include name="**" />
<exclude name="res/ILtest.*" />
<exclude name="res/Missing_you.mod" />
<exclude name="res/phero*.*" />
</patternset>
<!-- files in the optional package -->
<patternset id="lwjgl_optional">
<include name="res/**" />
<exclude name="res/logo/**" />
<exclude name="res/spaceinvaders/**" />
<exclude name="res/*.wav" />
<exclude name="res/*.xpm" />
<include name="doc/CREDITS" />
<include name="doc/LICENSE" />
<include name="doc/README" />
</patternset>
<!-- files in the lwjgl_applet package -->
<patternset id="lwjgl_applet">
<include name="applet/**" />
<exclude name="applet/appletviewer.policy" />
<exclude name="applet/lwjglkeystore" />
</patternset>
<uptodate property="lwjgl.main.built" targetfile="${lwjgl.lib}/win32/lwjgl.dll" >
<srcfiles dir= "${lwjgl.src.native}/common" includes="*.c*"/>
<srcfiles dir= "${lwjgl.src.native}/windows" includes="*.c"/>
</uptodate>
</project>

View File

@ -0,0 +1,86 @@
<project name="generator">
<!-- clean the generated files -->
<target name="clean-generated" description="Deletes the generated java and native source">
<delete quiet="true" failonerror="false">
<fileset dir="${lwjgl.src}/generated" includes="**"/>
<fileset dir="${lwjgl.src.native}/generated" includes="**"/>
</delete>
</target>
<!-- Compiles the Java generator source code -->
<target name="generators" description="Compiles the native method generators">
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/util/generator/**.java" source="1.5" target="1.5" taskname="generator">
<compilerarg value="-Xlint:all"/>
</javac>
</target>
<!-- Proxy target to generate it all -->
<target name="generate-all" depends="generate-openal, generate-opengl, generate-opengl-capabilities, generate-opengl-references" description="Generates java and native source"/>
<!-- Generate OpenAL -->
<target name="generate-openal" depends="generators" description="Generates java and native source for AL">
<apply executable="apt" parallel="true">
<arg value="-nocompile"/>
<arg value="-factory"/>
<arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/>
<arg value="-cp"/>
<arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
<arg value="-s"/>
<arg path="${lwjgl.src}/generated"/>
<arg value="-d"/>
<arg path="${lwjgl.src.native}/generated"/>
<arg value="-Atypemap=org.lwjgl.util.generator.ALTypeMap"/>
<arg value="-Ageneratechecks"/>
<fileset dir="${lwjgl.src.templates}" includes="org/lwjgl/openal/AL10.java, org/lwjgl/openal/AL11.java"/>
</apply>
</target>
<!-- Generate OpenGL -->
<target name="generate-opengl" depends="generators" description="Generates java and native source for GL">
<apply executable="apt" parallel="true">
<arg value="-nocompile"/>
<arg value="-factory"/>
<arg value="org.lwjgl.util.generator.GeneratorProcessorFactory"/>
<arg value="-cp"/>
<arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
<arg value="-s"/>
<arg path="${lwjgl.src}/generated"/>
<arg value="-d"/>
<arg path="${lwjgl.src.native}/generated"/>
<!-- <arg value="-Ageneratechecks"/>-->
<arg value="-Acontextspecific"/>
<arg value="-Atypemap=org.lwjgl.util.generator.GLTypeMap"/>
<fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/>
</apply>
</target>
<!-- Generate context capabilities -->
<target name="generate-opengl-references" depends="generators" description="Generates java and native source for GL">
<apply executable="apt" parallel="true">
<arg value="-nocompile"/>
<arg value="-factory"/>
<arg value="org.lwjgl.util.generator.ReferencesGeneratorProcessorFactory"/>
<arg value="-cp"/>
<arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
<arg value="-s"/>
<arg path="${lwjgl.src}/generated"/>
<fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/>
</apply>
</target>
<!-- Generate context capabilities -->
<target name="generate-opengl-capabilities" depends="generators" description="Generates java and native source for GL">
<apply executable="apt" parallel="true">
<arg value="-nocompile"/>
<arg value="-factory"/>
<arg value="org.lwjgl.util.generator.ContextGeneratorProcessorFactory"/>
<arg value="-cp"/>
<arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/>
<arg value="-s"/>
<arg path="${lwjgl.src}/generated"/>
<arg value="-Acontextspecific"/>
<fileset dir="${lwjgl.src.templates}" includes="${opengl-template-pattern}"/>
</apply>
</target>
</project>

View File

@ -0,0 +1,59 @@
<project name="webstart">
<target name="webstart_demo" depends="jars">
<antcall target="-webstart_demo">
<param name="keystore" value="applet/lwjglkeystore"/>
<param name="alias" value="lwjgl"/>
<param name="password" value="123456"/>
</antcall>
</target>
<target name="webstart_demo-release" depends="jars">
<input message="Please type the password for the keystore" addproperty="sign.pwd"/>
<antcall target="-webstart_demo">
<param name="keystore" value="signing/matzon_java_code_signing.keystore"/>
<param name="alias" value="oddlabs_java_code_signing"/>
<param name="password" value="${sign.pwd}"/>
</antcall>
</target>
<!-- -->
<target name="-webstart_demo" description="Using released files, creates the necessary files used for jnlp demos">
<!-- delete existing temp -->
<delete dir="${lwjgl.temp}"/>
<!-- unzip common files -->
<unzip src="${lwjgl.dist}/lwjgl-${lwjgl.version}.zip" dest="${lwjgl.temp}/jnlp/temp" overwrite="true"/>
<!-- move files to unified structure -->
<move todir="${lwjgl.temp}/jnlp/temp">
<fileset dir="${lwjgl.temp}/jnlp/temp/lwjgl-${lwjgl.version}/">
<include name="**"/>
</fileset>
</move>
<!-- move relevant files to root -->
<move todir="${lwjgl.temp}/jnlp/" flatten="true">
<fileset dir="${lwjgl.temp}/jnlp/temp">
<include name="**/**.jar"/>
</fileset>
</move>
<!-- create native jars -->
<jar destfile="${lwjgl.temp}/jnlp/native_win32.jar" basedir="${lwjgl.temp}/jnlp/temp/native/win32"/>
<jar destfile="${lwjgl.temp}/jnlp/native_linux.jar" basedir="${lwjgl.temp}/jnlp/temp/native/linux"/>
<jar destfile="${lwjgl.temp}/jnlp/native_macosx.jar" basedir="${lwjgl.temp}/jnlp/temp/native/macosx"/>
<!-- create media jar -->
<jar destfile="${lwjgl.temp}/jnlp/media.jar" basedir="${lwjgl.res}"/>
<!-- sign 'em -->
<signjar jar="${lwjgl.temp}/jnlp/lwjgl.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<signjar jar="${lwjgl.temp}/jnlp/lwjgl_util.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<signjar jar="${lwjgl.temp}/jnlp/native_linux.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<signjar jar="${lwjgl.temp}/jnlp/native_macosx.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<signjar jar="${lwjgl.temp}/jnlp/native_win32.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
<signjar jar="${lwjgl.temp}/jnlp/jinput.jar" alias="${alias}" keystore="${keystore}" storepass="${password}"/>
</target>
</project>