lwjgl/build.xml

256 lines
12 KiB
XML
Raw Normal View History

2002-12-21 17:52:34 -05:00
<project name="LWJGL" default="compile" basedir=".">
2002-12-21 17:52:34 -05:00
<!-- set global properties for this build -->
2003-02-09 16:14:17 -05:00
<property name="lwjgl.src" value="./src"/>
<property name="lwjgl.bin" value="./bin"/>
<property name="lwjgl.lib" value="./lib"/>
<property name="lwjgl.dist" value="./dist"/>
<property name="lwjgl.docs" value="./doc"/>
<property name="lwjgl.temp" value="./temp"/>
<property name="lwjgl.res" value="./res"/>
2003-03-02 14:27:32 -05:00
<property name="lwjgl.version" value="0.5"/>
2003-02-09 16:14:17 -05:00
<property name="lwjgl.src.headers" value="${lwjgl.src}/native/common"/>
2002-12-21 17:52:34 -05:00
<!-- Creates a splash screen -->
<target name="splash">
<splash imageurl="http://java-game-lib.sourceforge.net/images/logo.png" showduration="0" taskname="progressscreen"/>
</target>
<!-- Initializes whatever needs to be done before any targets are executed -->
<target name="initialize">
<mkdir dir="${lwjgl.bin}" 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"/>
2002-12-21 17:52:34 -05:00
<mkdir dir="${lwjgl.temp}" taskname="initialiazing temp folder"/>
</target>
<target name="all" depends="splash" description="compile. package. javadoc and distribute">
<!--
Though we perform all targets, we do it in somewhat mixed.
This is because we want the 'distribution_application' target to be
executed as soon as possible, since this target is most likely to fail.
That way we don't spend time doing javadocs, if the 'distribution_application'
target is going to fail anyway. However we cannot call the 'distribution' before
the javadoc target, since the 'distribution' target will try to create the javadoc
archive.
-->
<antcall target="clean"/>
<antcall target="compile"/>
<antcall target="package"/>
<antcall target="distribution_application"/>
<antcall target="javadoc"/>
<antcall target="distribution_javadoc"/>
<antcall target="distribution_source"/>
<antcall target="internal_clean"/>
</target>
2002-12-21 17:52:34 -05:00
<target name="clean" description="Cleans the diectories controlled by this ant script (temp, dist, lib, javadoc, class files in bin)">
<delete dir="${lwjgl.temp}" quiet="true" taskname="cleaning temp folder"/>
<delete dir="${lwjgl.dist}" quiet="true" taskname="cleaning dist folder"/>
<delete dir="${lwjgl.docs}/javadoc" quiet="true" taskname="cleaning javadoc folder"/>
<delete dir="${lwjgl.bin}/org" quiet="true" taskname="cleaning bin folder"/>
<delete taskname="cleaning bin folder">
<fileset dir="${lwjgl.bin}" includes="*.class"/>
</delete>
</target>
2002-12-21 17:52:34 -05:00
<target name="compile" depends="initialize" description="Compiles the java source directory">
<javac srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/**.java" source="1.4" taskname="lwjgl"/>
<javac srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/input/**" source="1.4" taskname="input"/>
<javac srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/openal/**" source="1.4" taskname="openal"/>
<javac srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/opengl/**" source="1.4" taskname="opengl"/>
<javac srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/test/**" source="1.4" taskname="test"/>
<javac srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/vector/**" source="1.4" taskname="vector"/>
<javac srcdir="examples/" destdir="${lwjgl.bin}/" includes="**" source="1.4" taskname="examples"/>
</target>
2002-12-21 17:52:34 -05:00
<target name="package" depends="compile" description="packages the java source files">
<!-- Create lwjgl.jar -->
<jar destfile="${lwjgl.lib}/lwjgl.jar" taskname="lwjgl.jar">
<fileset dir="${lwjgl.bin}">
<include name="**"/>
<exclude name="**.*"/>
<exclude name="org/lwjgl/test/**"/>
</fileset>
</jar>
<!-- Create lwjgl_test.jar -->
<jar destfile="${lwjgl.lib}/lwjgl_test.jar" taskname="lwjgl_test.jar">
<fileset dir="${lwjgl.bin}">
<exclude name="**.*"/>
<include name="org/lwjgl/test/**"/>
</fileset>
</jar>
<!-- Create examples.jar -->
<jar destfile="${lwjgl.lib}/examples.jar" taskname="examples.jar">
<fileset dir="${lwjgl.bin}">
<include name="**.class"/>
</fileset>
<fileset dir="${lwjgl.res}">
<include name="data/**"/>
</fileset>
2002-12-21 17:52:34 -05:00
</jar>
<!-- copy dll/so to lib directory -->
<copy todir="${lwjgl.lib}" taskname="libraries">
<fileset dir="${lwjgl.bin}">
2003-03-02 14:27:07 -05:00
<include name="lwjgl.dll"/>
<include name="lwjgl_d.dll"/>
<include name="liblwjgl.so"/>
<include name="liblwjgl_d.so"/>
2002-12-21 17:52:34 -05:00
</fileset>
</copy>
</target>
<target name="javadoc" description="Creates javadoc from java source code">
<javadoc destdir="${lwjgl.docs}/javadoc" author="true" version="true" use="true" source="1.4" windowtitle="LWJGL API">
2002-12-21 17:52:34 -05:00
<fileset dir="${lwjgl.src}/java">
<include name="**" />
<exclude name="org/lwjgl/test/**"/>
</fileset>
2002-12-21 17:52:34 -05:00
<doctitle><![CDATA[<h1>Lightweight Java Game Toolkit</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright &#169; 2002 lwjgl.org. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
<target name="distribution" depends="package" description="Creates a versioned distribution of lwjgl">
<antcall target="distribution_application"/>
<antcall target="distribution_javadoc"/>
<antcall target="distribution_source"/>
<antcall target="internal_clean"/>
</target>
2002-12-21 19:54:00 -05:00
<target name="cvsbuild" description="Builds lwjgl, by exporting files from cvs into a LWJGL folder and executing the package target on that folders build file">
<available file="LWJGL/build.xml" property="lwjgl.preexistingfiles"/>
<available file="${lwjgl.src}/java/org/lwjgl/Sys.java" property="lwjgl.preexistingfiles"/>
<fail if="lwjgl.preexistingfiles" message="Cannot perform webbuild from nonempty folder"/>
<cvs command="export -D 'now'" compressionlevel="3" cvsRoot=":pserver:anonymous@cvs.sf.net:/cvsroot/java-game-lib" package="LWJGL/build.xml" dest="."/>
<cvs command="export -D 'now'" compressionlevel="3" cvsRoot=":pserver:anonymous@cvs.sf.net:/cvsroot/java-game-lib" package="LWJGL/src" dest="."/>
<cvs command="export -D 'now'" compressionlevel="3" cvsRoot=":pserver:anonymous@cvs.sf.net:/cvsroot/java-game-lib" package="LWJGL/examples" dest="."/>
<cvs command="export -D 'now'" compressionlevel="3" cvsRoot=":pserver:anonymous@cvs.sf.net:/cvsroot/java-game-lib" package="LWJGL/doc" dest="."/>
<ant dir="LWJGL" target="package"/>
</target>
2003-02-09 16:14:17 -05:00
<target name="headers" description="invokes javah on java classes, producing the headers needed for native compilation" depends="compile">
<javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}" force="yes">
<class name="org.lwjgl.Display"/>
<class name="org.lwjgl.Sys"/>
<class name="org.lwjgl.input.Controller"/>
<class name="org.lwjgl.input.Keyboard"/>
<class name="org.lwjgl.input.Mouse"/>
<class name="org.lwjgl.Math$MatrixOpAdd$MatrixOpSafe"/>
<class name="org.lwjgl.Math$MatrixOpAdd$MatrixOpDirect"/>
<class name="org.lwjgl.Math$MatrixOpCopy$MatrixOpSafe"/>
<class name="org.lwjgl.Math$MatrixOpCopy$MatrixOpDirect"/>
<class name="org.lwjgl.Math$MatrixOpInvert$MatrixOpSafe"/>
<class name="org.lwjgl.Math$MatrixOpInvert$MatrixOpDirect"/>
<class name="org.lwjgl.Math$MatrixOpMultiply$MatrixOpSafe"/>
<class name="org.lwjgl.Math$MatrixOpMultiply$MatrixOpDirect"/>
<class name="org.lwjgl.Math$MatrixOpNegate$MatrixOpSafe"/>
<class name="org.lwjgl.Math$MatrixOpNegate$MatrixOpDirect"/>
<class name="org.lwjgl.Math$MatrixOpNormalise$MatrixOpSafe"/>
<class name="org.lwjgl.Math$MatrixOpNormalise$MatrixOpDirect"/>
<class name="org.lwjgl.Math$MatrixOpSubtract$MatrixOpSafe"/>
<class name="org.lwjgl.Math$MatrixOpSubtract$MatrixOpDirect"/>
<class name="org.lwjgl.openal.ALC"/>
<class name="org.lwjgl.openal.BaseAL"/>
<class name="org.lwjgl.openal.CoreAL"/>
<class name="org.lwjgl.openal.eax.BaseEAX"/>
<class name="org.lwjgl.openal.eax.CoreEAX"/>
<class name="org.lwjgl.openal.eax.EAXBufferProperties"/>
<class name="org.lwjgl.openal.eax.EAXListenerProperties"/>
<class name="org.lwjgl.opengl.BaseGL"/>
<class name="org.lwjgl.opengl.CoreGL"/>
<class name="org.lwjgl.opengl.GL"/>
<class name="org.lwjgl.opengl.GLU"/>
</javah>
</target>
2002-12-21 17:52:34 -05:00
<!-- Creates a versioned distribution of dll's and jars -->
<target name="distribution_application">
<!-- check for file presence -->
<available file="${lwjgl.lib}/OpenAL32.dll" property="lwjgl.OpenAL32_dll.exists"/>
<fail unless="lwjgl.OpenAL32_dll.exists" message="Missing OpenAL32.dll in lib directory"/>
2002-12-21 18:25:54 -05:00
<available file="${lwjgl.lib}/libopenal.so" property="lwjgl.libopenal_so.exists"/>
<fail unless="lwjgl.libopenal_so.exists" message="Missing libopenal.so in lib directory"/>
2002-12-21 17:52:34 -05:00
<available file="${lwjgl.lib}/lwjgl.dll" property="lwjgl.lwjgl_dll.exists"/>
<fail unless="lwjgl.lwjgl_dll.exists" message="Missing lwjgl.dll in lib directory"/>
2002-12-21 17:52:34 -05:00
<available file="${lwjgl.lib}/lwjgl_d.dll" property="lwjgl.lwjgl_d_dll.exists"/>
<fail unless="lwjgl.lwjgl_d_dll.exists" message="Missing lwjgl_d.dll in lib directory"/>
2002-12-21 18:25:54 -05:00
<available file="${lwjgl.lib}/liblwjgl.so" property="lwjgl.liblwjgl_so.exists"/>
<fail unless="lwjgl.liblwjgl_so.exists" message="Missing liblwjgl.so in lib directory"/>
2002-12-21 18:25:54 -05:00
<available file="${lwjgl.lib}/liblwjgl_d.so" property="lwjgl.liblwjgl_d_so.exists"/>
<fail unless="lwjgl.liblwjgl_d_so.exists" message="Missing liblwjgl_d.so in lib directory"/>
2002-12-21 17:52:34 -05:00
<available file="${lwjgl.lib}/lwjgl.jar" property="lwjgl.lwjgl_jar.exists"/>
<fail unless="lwjgl.lwjgl_jar.exists" message="Missing lwjgl.jar in lib directory"/>
<available file="${lwjgl.lib}/lwjgl_test.jar" property="lwjgl.lwjgl_test_jar.exists"/>
<fail unless="lwjgl.lwjgl_test_jar.exists" message="Missing lwjgl_test.jar in lib directory"/>
2002-12-21 17:52:34 -05:00
<available file="${lwjgl.lib}/examples.jar" property="lwjgl.examples_jar.exists"/>
<fail unless="lwjgl.examples_jar.exists" message="Missing examples.jar in lib directory"/>
<mkdir dir="${lwjgl.temp}/lwjgl-${lwjgl.version}"/>
<!-- copy files to lwjgl directory for proper zipping -->
<copy todir="${lwjgl.temp}/lwjgl-${lwjgl.version}">
<fileset dir="${lwjgl.lib}/">
<include name="lwjgl.dll"/>
<include name="lwjgl_d.dll"/>
<include name="lwjgl.so"/>
<include name="lwjgl_d.so"/>
<include name="lwjgl.jar"/>
<include name="lwjgl_test.jar"/>
<include name="examples.jar"/>
</fileset>
<fileset dir="${lwjgl.docs}">
<include name="CREDITS"/>
<include name="LICENSE"/>
<include name="README"/>
</fileset>
</copy>
<!-- zip 'em up -->
<zip destfile="${lwjgl.dist}/lwjgl-${lwjgl.version}.zip" basedir="${lwjgl.temp}/"/>
</target>
<!-- Creates a versioned distribution of javadocs -->
<target name="distribution_javadoc">
<zip destfile="${lwjgl.dist}/lwjgl-docs-${lwjgl.version}.zip" basedir="${lwjgl.docs}" includes="javadoc/**"/>
</target>
2002-12-21 17:52:34 -05:00
<!-- Creates a versioned distribution of the source code -->
<target name="distribution_source">
<zip destfile="${lwjgl.dist}/lwjgl-source-${lwjgl.version}.zip">
<fileset dir="${lwjgl.src}/">
<patternset>
<include name="**/*.java"/>
<include name="**/*.cpp"/>
<include name="**/*.c"/>
<include name="**/*.h"/>
<include name="**/*.am"/>
<exclude name="**/*CVS*"/>
<exclude name="**/.*"/>
</patternset>
</fileset>
</zip>
</target>
<!-- clean internal temporary directories -->
<target name="internal_clean">
<delete dir="${lwjgl.temp}" taskname="cleanup"/>
</target>
2002-12-21 19:54:00 -05:00
</project>