2006-07-07 07:00:32 -04:00
<project name= "LWJGL" default= "all" basedir= "." >
2002-08-11 19:38:49 -04:00
2008-04-20 14:46:34 -04:00
<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" />
2004-10-17 17:16:40 -04:00
<!-- ================================================================== -->
2005-05-18 16:27:58 -04:00
<!-- Everything below this line is targets. -->
<!-- Do not modify, unless you know what you're doing -->
2004-10-17 17:16:40 -04:00
<!-- ================================================================== -->
<!-- ================================================================== -->
2005-05-18 16:27:58 -04:00
<!-- Initialize build -->
2004-10-17 17:16:40 -04:00
<!-- ================================================================== -->
2004-09-06 12:36:08 -04:00
<target name= "-initialize" >
2008-04-20 14:46:34 -04:00
<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" />
2008-09-15 14:28:47 -04:00
<mkdir dir= "${lwjgl.temp}/native/solaris" taskname= "initialiazing temp/solaris folder" />
2005-09-29 13:13:38 -04:00
</target>
2005-05-18 16:27:58 -04:00
<!-- Cleans up any files created during the execution of this script -->
2007-04-03 06:06:12 -04:00
<target name= "clean" description= "Cleans the diectories controlled by this ant script" depends= "clean-generated" >
2005-05-18 16:27:58 -04:00
<delete dir= "${lwjgl.temp}" quiet= "true" failonerror= "false" taskname= "cleaning temp folder" />
<delete dir= "${lwjgl.docs}/javadoc" quiet= "true" failonerror= "false" taskname= "cleaning javadoc folder" />
2006-07-07 07:00:32 -04:00
<delete dir= "${lwjgl.bin}" quiet= "true" failonerror= "false" taskname= "cleaning bin folder" />
2005-05-18 16:27:58 -04:00
</target>
<!-- Creates a distribution of LWJGL -->
<target name= "release" description= "Creates a distribution of LWJGL using supplied native binaries" >
<!-- Warn user -->
<echo message= "Before running the release target, please manually compile all platforms and place required files in ${lwjgl.lib}/win32, ${lwjgl.lib}/linux and ${lwjgl.lib}/macosx${line.separator}Missing files will result in a successfull built, but with incomplete release zips" />
<input
message="All data in the ${lwjgl.dist} folder will be deleted. Continue? "
validargs="yes,no"
addproperty="do.delete"
/>
<condition property= "do.abort" >
<equals arg1= "no" arg2= "${do.delete}" />
</condition>
<fail if= "do.abort" > Build aborted by user.</fail>
<!-- prepare -->
<delete dir= "${lwjgl.dist}" quiet= "true" failonerror= "false" />
<antcall target= "clean" />
<antcall target= "-initialize" />
<!-- compile and create jars -->
2008-04-20 14:46:34 -04:00
<antcall target= "generate-all" />
2005-05-18 16:27:58 -04:00
<antcall target= "compile" />
2008-04-20 14:46:34 -04:00
<antcall target= "javadoc" />
2005-05-18 16:27:58 -04:00
<antcall target= "-createjars" />
2008-04-20 14:46:34 -04:00
<antcall target= "applet-release" />
2005-05-18 16:27:58 -04:00
<!-- copy resources to res folder -->
<copy todir= "${lwjgl.temp}/res" >
<fileset dir= "res" />
</copy>
<!-- copy docs -->
<copy todir= "${lwjgl.temp}/doc" >
<fileset dir= "${lwjgl.docs}" >
<patternset refid= "lwjgl-docs.fileset" />
</fileset>
</copy>
<!-- create distribution from files in libs/ and temp/ -->
2004-10-17 17:16:40 -04:00
<antcall target= "-distribution_javadoc" />
2006-11-19 04:04:28 -05:00
<antcall target= "-distribution_source" />
2006-02-21 17:11:49 -05:00
<antcall target= "-distribute" />
2005-05-19 11:50:47 -04:00
</target>
2006-07-07 07:00:32 -04:00
<target name= "all" description= "Creates the Java archives and the natives for the current platform" depends= "jars, compile_native" />
2005-05-19 11:50:47 -04:00
<!-- Create ONLY the jar archives -->
2007-06-20 04:58:26 -04:00
<target name= "jars" description= "Creates the Java archives ONLY and places them in libs/" depends= "-initialize, generate-all, compile, -createjars" >
2008-01-21 16:38:29 -05:00
<!-- <target name="jars" description="Creates the Java archives ONLY and places them in libs/" depends=" - initialize, compile, - createjars"> -->
2007-08-25 10:47:24 -04:00
<!-- <target name="jars" description="Creates the Java archives ONLY and places them in libs/" depends=" - initialize, compile, - createjars"> -->
2005-05-19 11:50:47 -04:00
<move todir= "libs/" >
<fileset dir= "${lwjgl.temp}/jar" >
<include name= "*.jar" />
</fileset>
</move>
</target>
2005-05-18 16:27:58 -04:00
<!-- Packages the java files -->
<target name= "-createjars" >
<!-- Create lwjgl.jar -->
<jar destfile= "${lwjgl.temp}/jar/lwjgl.jar" taskname= "lwjgl.jar" >
<fileset refid= "lwjgl.fileset" />
2006-07-03 07:44:34 -04:00
<manifest >
<attribute name= "Sealed" value= "true" />
</manifest>
2005-05-18 16:27:58 -04:00
</jar>
2006-07-03 07:30:30 -04:00
<!-- Create lwjgl_util_applet.jar -->
<jar destfile= "${lwjgl.temp}/jar/lwjgl_util_applet.jar" taskname= "lwjgl_util_applet.jar" >
<fileset refid= "lwjgl_util_applet.fileset" />
2006-07-03 07:44:34 -04:00
<manifest >
<attribute name= "Sealed" value= "true" />
</manifest>
2006-07-03 07:30:30 -04:00
</jar>
2005-05-18 16:27:58 -04:00
<!-- Create lwjgl_test.jar -->
<jar destfile= "${lwjgl.temp}/jar/lwjgl_test.jar" taskname= "lwjgl_test.jar" >
<fileset refid= "lwjgl_test.fileset" />
2006-07-03 19:26:54 -04:00
<fileset refid= "lwjgl_test_extra.fileset" />
2005-05-18 16:27:58 -04:00
</jar>
<!-- Create lwjgl_util.jar -->
<jar destfile= "${lwjgl.temp}/jar/lwjgl_util.jar" taskname= "lwjgl_util.jar" >
<fileset refid= "lwjgl_util.fileset" />
</jar>
2006-06-27 11:41:53 -04:00
</target>
2002-08-11 19:38:49 -04:00
2006-02-21 17:11:49 -05:00
<!-- Distributes files -->
<target name= "-distribute" >
2005-05-18 16:27:58 -04:00
<delete >
<fileset dir= "${lwjgl.temp}/native/" includes= "**/*" />
</delete>
2006-11-19 04:04:28 -05:00
<copy file= "${lwjgl.lib}/jinput.jar" todir= "${lwjgl.temp}/jar" />
2006-02-21 17:11:49 -05:00
<copy todir= "${lwjgl.temp}/native/win32" >
2005-05-18 16:27:58 -04:00
<fileset dir= "${lwjgl.lib}/win32" >
<patternset refid= "lwjgl-win32.fileset" />
</fileset>
</copy>
2006-02-21 17:11:49 -05:00
<copy todir= "${lwjgl.temp}/native/linux" >
2005-05-18 16:27:58 -04:00
<fileset dir= "${lwjgl.lib}/linux" >
<patternset refid= "lwjgl-linux.fileset" />
</fileset>
</copy>
2006-02-21 17:11:49 -05:00
<copy todir= "${lwjgl.temp}/native/macosx" >
2005-05-18 16:27:58 -04:00
<fileset dir= "${lwjgl.lib}/macosx" >
<patternset refid= "lwjgl-macosx.fileset" />
</fileset>
</copy>
2008-09-15 14:28:47 -04:00
<copy todir= "${lwjgl.temp}/native/solaris" >
<fileset dir= "${lwjgl.lib}/solaris" >
<patternset refid= "lwjgl-solaris.fileset" />
</fileset>
</copy>
2006-02-21 17:11:49 -05:00
2006-04-30 17:15:30 -04:00
<!-- create base package -->
2006-02-21 17:11:49 -05:00
<zip destfile= "${lwjgl.dist}/lwjgl-${lwjgl.version}.zip" >
2006-04-30 17:15:30 -04:00
<zipfileset dir= "${lwjgl.temp}" prefix= "lwjgl-${lwjgl.version}/" >
<patternset refid= "lwjgl_base" />
</zipfileset>
2005-05-18 16:27:58 -04:00
</zip>
2006-04-30 17:15:30 -04:00
2006-11-19 04:04:28 -05:00
<!-- create applet package -->
<zip destfile= "${lwjgl.dist}/lwjgl_applet-${lwjgl.version}.zip" >
<zipfileset dir= "." prefix= "lwjgl_applet-${lwjgl.version}/" >
<patternset refid= "lwjgl_applet" />
</zipfileset>
</zip>
2005-05-18 16:27:58 -04:00
</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>
2006-11-19 04:04:28 -05:00
<!-- Creates a versioned distribution of the source code -->
<target name= "-distribution_source" >
<zip destfile= "${lwjgl.dist}/lwjgl-source-${lwjgl.version}.zip" >
<fileset refid= "lwjgl.source.fileset" />
</zip>
2008-04-20 14:46:34 -04:00
</target>
2005-05-18 16:27:58 -04:00
<!-- Generates the native headers from source files -->
<target name= "headers" description= "invokes javah on java classes" depends= "compile" >
<javah classpath= "${lwjgl.bin}" destdir= "${lwjgl.src.native}/linux" force= "yes" >
2008-04-30 10:58:47 -04:00
<class name= "org.lwjgl.LinuxSysImplementation" />
2006-10-24 05:52:12 -04:00
<class name= "org.lwjgl.opengl.LinuxEvent" />
2006-07-03 14:07:44 -04:00
<class name= "org.lwjgl.opengl.LinuxMouse" />
2006-07-03 07:30:30 -04:00
<class name= "org.lwjgl.opengl.LinuxKeyboard" />
2005-05-18 16:27:58 -04:00
<class name= "org.lwjgl.opengl.LinuxDisplay" />
<class name= "org.lwjgl.opengl.LinuxPeerInfo" />
<class name= "org.lwjgl.opengl.LinuxPbufferPeerInfo" />
<class name= "org.lwjgl.opengl.LinuxDisplayPeerInfo" />
<class name= "org.lwjgl.opengl.LinuxAWTGLCanvasPeerInfo" />
<class name= "org.lwjgl.opengl.LinuxContextImplementation" />
<class name= "org.lwjgl.opengl.LinuxCanvasImplementation" />
</javah>
2006-05-14 17:55:57 -04:00
2006-07-12 14:09:11 -04:00
<javah classpath= "${lwjgl.bin}" destdir= "${lwjgl.src.native}/windows" force= "yes" >
2006-06-26 09:50:48 -04:00
<class name= "org.lwjgl.opengl.WindowsKeyboard" />
2006-07-12 14:32:58 -04:00
<class name= "org.lwjgl.opengl.WindowsPbufferPeerInfo" />
<class name= "org.lwjgl.opengl.WindowsDisplay" />
<class name= "org.lwjgl.opengl.WindowsRegistry" />
2006-07-15 15:45:36 -04:00
<class name= "org.lwjgl.WindowsSysImplementation" />
2006-07-12 14:32:58 -04:00
<class name= "org.lwjgl.opengl.WindowsAWTGLCanvasPeerInfo" />
<class name= "org.lwjgl.opengl.WindowsPeerInfo" />
<class name= "org.lwjgl.opengl.WindowsDisplayPeerInfo" />
<class name= "org.lwjgl.opengl.WindowsContextImplementation" />
2005-05-18 16:27:58 -04:00
</javah>
2006-05-14 17:55:57 -04:00
2005-05-18 16:27:58 -04:00
<javah classpath= "${lwjgl.bin}" destdir= "${lwjgl.src.native}/macosx" force= "yes" >
2008-04-30 10:58:47 -04:00
<class name= "org.lwjgl.MacOSXSysImplementation" />
2006-10-26 16:49:07 -04:00
<class name= "org.lwjgl.opengl.MacOSXMouseEventQueue" />
2005-05-18 16:27:58 -04:00
<class name= "org.lwjgl.opengl.MacOSXCanvasPeerInfo" />
<class name= "org.lwjgl.opengl.MacOSXPeerInfo" />
<class name= "org.lwjgl.opengl.MacOSXPbufferPeerInfo" />
<class name= "org.lwjgl.opengl.MacOSXDisplay" />
<class name= "org.lwjgl.opengl.MacOSXContextImplementation" />
</javah>
2006-05-14 17:55:57 -04:00
2005-05-18 16:27:58 -04:00
<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>
2003-11-13 18:16:58 -05:00
</target>
2008-04-20 14:46:34 -04:00
2005-02-15 06:05:36 -05:00
<!-- Compiles the Java source code -->
2008-04-20 14:46:34 -04:00
<target name= "compile" description= "Compiles the java source code" depends= "-initialize" >
2008-04-22 12:52:16 -04:00
<javac debug= "yes" destdir= "${lwjgl.bin}" source= "1.4" target= "1.4" classpath= "${lwjgl.lib}/jinput.jar:${lwjgl.lib}/AppleJavaExtensions.jar" taskname= "core" >
2008-04-20 14:46:34 -04:00
<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/**" />
2005-02-15 06:05:36 -05:00
</javac>
2008-04-20 14:46:34 -04:00
<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>
2005-03-21 03:27:45 -05:00
2004-10-17 17:16:40 -04:00
<target name= "compile_native" depends= "headers" description= "Compiles the native files" >
<condition property= "lwjgl.platform.windows" >
<os family= "windows" />
</condition>
<antcall target= "-compile_native_win32" />
<condition property= "lwjgl.platform.linux" >
2008-08-12 07:54:09 -04:00
<or >
<os name= "Linux" />
<os name= "SunOS" />
</or>
2004-10-17 17:16:40 -04:00
</condition>
<antcall target= "-compile_native_linux" />
2006-07-07 08:41:36 -04:00
<condition property= "lwjgl.platform.macosx" >
2004-10-17 17:16:40 -04:00
<os name= "Mac OS X" />
</condition>
2006-07-07 08:41:36 -04:00
<antcall target= "-compile_native_macosx" />
2005-05-18 16:27:58 -04:00
</target>
2006-07-07 07:00:32 -04:00
2003-11-13 18:16:58 -05:00
<!-- Compiles LWJGL on Win32 platforms -->
2004-09-06 12:36:08 -04:00
<target name= "-compile_native_win32" if= "lwjgl.platform.windows" >
2006-07-08 13:20:18 -04:00
<ant antfile= "platform_build/windows_ant/build.xml" inheritAll= "false" />
2006-07-11 17:43:43 -04:00
<copy file= "${lwjgl.bin}/lwjgl/lwjgl.dll" todir= "${lwjgl.lib}/win32" />
2006-07-08 13:20:18 -04:00
</target>
2004-09-06 12:36:08 -04:00
<!-- Compiles LWJGL on Linux platforms -->
<target name= "-compile_native_linux" if= "lwjgl.platform.linux" >
2006-07-07 07:00:32 -04:00
<ant antfile= "platform_build/linux_ant/build.xml" inheritAll= "false" />
2006-07-11 16:49:28 -04:00
<copy todir= "${lwjgl.lib}/linux" >
2006-07-11 17:43:43 -04:00
<fileset dir= "${lwjgl.bin}/lwjgl" includes= "liblwjgl*.so" />
2006-07-11 16:49:28 -04:00
</copy>
2006-07-07 07:00:32 -04:00
</target>
2005-05-18 16:27:58 -04:00
2008-04-20 14:46:34 -04:00
<!-- Compiles LWJGL on Mac platforms -->
2006-07-07 08:41:36 -04:00
<target name= "-compile_native_macosx" if= "lwjgl.platform.macosx" >
<ant antfile= "platform_build/macosx_ant/build.xml" inheritAll= "false" />
2006-08-01 10:10:17 -04:00
<copy file= "${lwjgl.bin}/lwjgl/liblwjgl.jnilib" todir= "${lwjgl.lib}/macosx" />
2006-07-07 08:41:36 -04:00
</target>
2008-04-20 14:46:34 -04:00
<target name= "repack200" description= "Pack200-repack a jar file" >
<pack200 src= "${input}" destfile= "${output}" repack= "true" />
</target>
2006-07-07 08:41:36 -04:00
2008-04-20 14:46:34 -04:00
<target name= "pack200" description= "Pack200 a jar file" >
<pack200 src= "${input}" destfile= "${output}" />
2006-11-09 16:41:58 -05:00
</target>
2008-04-20 14:46:34 -04:00
<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>
2008-04-20 16:02:02 -04:00
</target>
<target name= "compress-sign-class" >
<antcall target= "repack200" >
<param name= "input" value= "${dir}${jarfile}.jar" />
<param name= "output" value= "${dir}${jarfile}-repack.jar" />
</antcall>
<signjar jar= "${dir}${jarfile}-repack.jar" alias= "${alias}" keystore= "${keystore}" storepass= "${password}" />
<antcall target= "pack200" >
<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>
<delete file= "${dir}${jarfile}-repack.jar" />
<delete file= "${dir}${jarfile}.jar.pack" />
<delete file= "${dir}${jarfile}.jar" />
</target>
<target name= "compress-resource" >
<antcall target= "lzma" >
<param name= "input" value= "${input}" />
<param name= "output" value= "${output}" />
</antcall>
</target>
2006-11-09 16:41:58 -05:00
2008-04-20 14:46:34 -04:00
<target name= "applettest" depends= "applet" >
<exec executable= "appletviewer" >
<arg value= "-J-Djava.security.policy=applet/appletviewer.policy" />
<arg path= "applet/applet.html" />
</exec>
2005-05-19 18:30:35 -04:00
</target>
2008-04-20 14:46:34 -04:00
<target name= "runtest" depends= "all" >
<fail message= "test.mainclass is not set. Use 'ant -Dtest.mainclass=<main-class> runtest'" unless= "test.mainclass" />
<condition property= "native_path" value= "libs/win32" >
<os family= "windows" />
</condition>
<condition property= "native_path" value= "libs/linux" >
2008-08-12 14:03:10 -04:00
<or >
<os name= "Linux" />
<os name= "SunOS" />
</or>
2008-04-20 14:46:34 -04:00
</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>
2005-06-05 08:12:34 -04:00
2008-04-20 14:46:34 -04:00
<!-- 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 © 2002-2008 lwjgl.org. All Rights Reserved.</i>]]> </bottom>
</javadoc>
</target>
2003-12-15 07:18:15 -05:00
</project>