2006-07-07 07:00:32 -04:00
<project name= "LWJGL" default= "all" basedir= "." >
2002-08-11 19:38:49 -04:00
2010-04-02 14:45:19 -04:00
<property name= "build.sysclasspath" value= "last" />
2008-04-20 14:46:34 -04:00
<import file= "platform_build/build-definitions.xml" />
<import file= "platform_build/build-generator.xml" />
2011-01-28 16:51:29 -05:00
<import file= "platform_build/build-maven.xml" />
2004-10-17 17:16:40 -04:00
<!-- ================================================================== -->
2011-05-17 12:53:57 -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
<!-- ================================================================== -->
<!-- ================================================================== -->
2011-05-17 12:53:57 -04:00
<!-- Initialize build -->
2004-10-17 17:16:40 -04:00
<!-- ================================================================== -->
2004-09-06 12:36:08 -04:00
<target name= "-initialize" >
2022-03-22 21:26:50 -04:00
<mkdir dir= "${lwjgl.target.bundle}" taskname= "initialiazing bundle folder" />
2005-09-29 13:13:38 -04:00
</target>
2010-09-26 19:43:24 -04:00
2005-05-18 16:27:58 -04:00
<!-- Cleans up any files created during the execution of this script -->
2022-03-22 21:26:50 -04:00
<target name= "clean" description= "Cleans all directories controlled by this ant script" >
<delete dir= "${lwjgl.target}" quiet= "true" failonerror= "false" taskname= "cleaning target folder" />
2010-09-28 17:11:35 -04:00
</target>
2005-05-18 16:27:58 -04:00
<!-- Creates a distribution of LWJGL -->
<target name= "release" description= "Creates a distribution of LWJGL using supplied native binaries" >
<!-- Warn user -->
2012-11-19 13:28:28 -05:00
<echo message= "Before running the release target, please manually compile all platforms and place required files in ${lwjgl.lib}/windows, ${lwjgl.lib}/linux, ${lwjgl.lib}/freebsd and ${lwjgl.lib}/macosx${line.separator}Missing files will result in a successfull built, but with incomplete release zips" />
2010-09-28 17:11:35 -04:00
<input
2022-03-22 21:26:50 -04:00
message="All data in the ${lwjgl.target} folder will be deleted. Continue? "
2010-09-28 17:11:35 -04:00
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 -->
2022-03-22 21:26:50 -04:00
<antcall target= "clean" />
2010-09-28 17:11:35 -04:00
<antcall target= "-initialize" />
<!-- compile and create debug jars -->
<antcall target= "generate-debug" />
<antcall target= "compile" />
<antcall target= "-createdebugjars" />
<!-- compile and create jars -->
<antcall target= "generate-all" />
<antcall target= "compile" />
<antcall target= "-createjars" />
<antcall target= "-jars_NoDEP" />
<antcall target= "javadoc" />
<!-- copy resources to res folder -->
2022-03-22 21:26:50 -04:00
<copy todir= "${lwjgl.target.staging}/res" >
2010-09-28 17:11:35 -04:00
<fileset dir= "res" />
</copy>
<!-- copy docs -->
2022-03-22 21:26:50 -04:00
<copy todir= "${lwjgl.target.staging}/doc" >
<fileset dir= "${lwjgl.target.doc}" >
2005-05-18 16:27:58 -04:00
<patternset refid= "lwjgl-docs.fileset" />
</fileset>
2010-09-28 17:11:35 -04:00
</copy>
2010-09-26 19:43:24 -04:00
2005-05-18 16:27:58 -04:00
<!-- 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" >
2010-04-02 14:45:19 -04:00
<antcall target= "-jars_NoDEP" />
</target>
2011-05-17 12:53:57 -04:00
<!-- Create ONLY the jar archives for the ES build -->
<target name= "jars_es" description= "Creates the Java archives ONLY for the ES build and places them in libs/"
depends="-initialize, generate-all, compile, -createjars_es">
<antcall target= "-jars_NoDEP" />
</target>
2010-04-02 14:45:19 -04:00
<target name= "-jars_NoDEP" >
2005-05-19 11:50:47 -04:00
<move todir= "libs/" >
2022-03-22 21:26:50 -04:00
<fileset dir= "${lwjgl.target.staging}/jar" >
2005-05-19 11:50:47 -04:00
<include name= "*.jar" />
</fileset>
</move>
</target>
2010-09-26 19:43:24 -04:00
2009-04-10 10:27:58 -04:00
<!-- Packages the java files -->
<target name= "-createdebugjars" >
<!-- Create lwjgl.jar -->
2022-03-22 21:26:50 -04:00
<jar destfile= "${lwjgl.target.staging}/jar/lwjgl-debug.jar" taskname= "lwjgl-debug.jar" >
2009-04-10 10:27:58 -04:00
<fileset refid= "lwjgl.fileset" />
2011-10-11 12:06:23 -04:00
<fileset refid= "lwjgl.fileset.dependencies" />
2009-04-10 10:27:58 -04:00
<manifest >
<attribute name= "Sealed" value= "true" />
</manifest>
</jar>
2009-04-09 17:18:19 -04:00
</target>
2010-09-26 19:43:24 -04:00
2005-05-18 16:27:58 -04:00
<!-- Packages the java files -->
<target name= "-createjars" >
<!-- Create lwjgl.jar -->
2022-03-22 21:26:50 -04:00
<jar destfile= "${lwjgl.target.staging}/jar/lwjgl.jar" taskname= "lwjgl.jar" >
2005-05-18 16:27:58 -04:00
<fileset refid= "lwjgl.fileset" />
2011-10-11 12:06:23 -04:00
<fileset refid= "lwjgl.fileset.dependencies" />
2006-07-03 07:44:34 -04:00
<manifest >
<attribute name= "Sealed" value= "true" />
</manifest>
2005-05-18 16:27:58 -04:00
</jar>
2010-09-26 19:43:24 -04:00
2005-05-18 16:27:58 -04:00
<!-- Create lwjgl_test.jar -->
2022-03-22 21:26:50 -04:00
<jar destfile= "${lwjgl.target.staging}/jar/lwjgl_test.jar" taskname= "lwjgl_test.jar" >
2005-05-18 16:27:58 -04:00
<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 -->
2022-03-22 21:26:50 -04:00
<jar destfile= "${lwjgl.target.staging}/jar/lwjgl_util.jar" taskname= "lwjgl_util.jar" >
2005-05-18 16:27:58 -04:00
<fileset refid= "lwjgl_util.fileset" />
</jar>
2006-06-27 11:41:53 -04:00
</target>
2002-08-11 19:38:49 -04:00
2011-05-17 12:53:57 -04:00
<!-- Packages the java files for the ES build -->
<target name= "-createjars_es" >
2011-10-11 12:06:23 -04:00
<!-- ================================================================== -->
<!-- Generate a list of the OpenGL extension classes -->
<!-- ================================================================== -->
2022-03-22 21:26:50 -04:00
<fileset id= "opengl-template-fileset" dir= "${lwjgl.target.gen.java}/org/lwjgl/opengl" includes= "${opengl-template-pattern}" />
2011-10-11 12:06:23 -04:00
<property name= "opengl-template-files" refid= "opengl-template-fileset" />
<tempfile property= "temp.file" />
<echo file= "${temp.file}" message= "${opengl-template-files}" taskname= "" />
<loadfile srcfile= "${temp.file}" property= "opengl-template-classes" >
<filterchain >
<tokenfilter delimoutput= "," >
<stringtokenizer delims= ";" />
2012-08-07 11:14:03 -04:00
<replaceregex pattern= "(.+)[.]java"
2011-10-11 12:06:23 -04:00
replace="org/lwjgl/opengl/\1.class"/>
</tokenfilter>
</filterchain>
</loadfile>
<delete file= "${temp.file}" />
2011-05-17 12:53:57 -04:00
<!-- Create lwjgl.jar -->
2022-03-22 21:26:50 -04:00
<jar destfile= "${lwjgl.target.staging}/jar/lwjgl.jar" taskname= "lwjgl.jar" >
2011-10-11 12:06:23 -04:00
<!-- Files to include in the lwjgl.jar file, for the ES build -->
2022-03-22 21:26:50 -04:00
<fileset dir= "${lwjgl.target.gen.classes}" excludes= "${opengl-template-classes}" >
2011-10-11 12:06:23 -04:00
<patternset id= "lwjgl_es.package.pattern" >
<include name= "org/**/*" />
<exclude name= "org/lwjgl/d3d/**" />
<exclude name= "org/lwjgl/test/**" />
<exclude name= "org/lwjgl/util/**" />
<exclude name= "org/lwjgl/examples/**" />
</patternset>
</fileset>
2011-05-17 12:53:57 -04:00
<manifest >
<attribute name= "Sealed" value= "true" />
</manifest>
</jar>
<!-- Create lwjgl_test.jar -->
2022-03-22 21:26:50 -04:00
<jar destfile= "${lwjgl.target.staging}/jar/lwjgl_test.jar" taskname= "lwjgl_test.jar" >
2011-05-17 12:53:57 -04:00
<fileset refid= "lwjgl_test_es.fileset" />
</jar>
</target>
2006-02-21 17:11:49 -05:00
<!-- Distributes files -->
<target name= "-distribute" >
2005-05-18 16:27:58 -04:00
<delete >
2022-03-22 21:26:50 -04:00
<fileset dir= "${lwjgl.target.staging}/native/" includes= "**/*" />
2010-09-26 19:43:24 -04:00
</delete>
2006-11-19 04:04:28 -05:00
2022-03-22 21:26:50 -04:00
<copy todir= "${lwjgl.target.staging}/jar" >
2009-05-31 06:12:19 -04:00
<fileset dir= "${lwjgl.lib}/" includes= "*.jar" />
</copy>
2022-03-22 21:26:50 -04:00
<copy todir= "${lwjgl.target.staging}/native/windows" >
2009-03-17 17:50:09 -04:00
<fileset dir= "${lwjgl.lib}/windows" >
<patternset refid= "lwjgl-windows.fileset" />
2005-05-18 16:27:58 -04:00
</fileset>
</copy>
2022-03-22 21:26:50 -04:00
<copy todir= "${lwjgl.target.staging}/native/linux" >
2005-05-18 16:27:58 -04:00
<fileset dir= "${lwjgl.lib}/linux" >
<patternset refid= "lwjgl-linux.fileset" />
</fileset>
</copy>
2022-03-22 21:26:50 -04:00
<copy todir= "${lwjgl.target.staging}/native/freebsd" failonerror= "false" >
2012-11-19 13:28:28 -05:00
<fileset dir= "${lwjgl.lib}/freebsd" >
<patternset refid= "lwjgl-freebsd.fileset" />
</fileset>
</copy>
2022-03-22 21:26:50 -04:00
<copy todir= "${lwjgl.target.staging}/native/openbsd" failonerror= "false" >
2013-10-22 10:00:50 -04:00
<fileset dir= "${lwjgl.lib}/openbsd" >
<patternset refid= "lwjgl-openbsd.fileset" />
</fileset>
</copy>
2022-03-22 21:26:50 -04:00
<copy todir= "${lwjgl.target.staging}/native/macosx" >
2005-05-18 16:27:58 -04:00
<fileset dir= "${lwjgl.lib}/macosx" >
<patternset refid= "lwjgl-macosx.fileset" />
</fileset>
</copy>
2022-03-22 21:26:50 -04:00
<copy todir= "${lwjgl.target.staging}/native/solaris" >
2008-09-15 14:28:47 -04:00
<fileset dir= "${lwjgl.lib}/solaris" >
<patternset refid= "lwjgl-solaris.fileset" />
</fileset>
2010-09-26 19:43:24 -04:00
</copy>
2006-04-30 17:15:30 -04:00
<!-- create base package -->
2022-03-22 21:26:50 -04:00
<zip destfile= "${lwjgl.target.bundle}/lwjgl-${lwjgl.version}.zip" >
<zipfileset dir= "${lwjgl.target.staging}" prefix= "lwjgl-${lwjgl.version}/" >
2006-04-30 17:15:30 -04:00
<patternset refid= "lwjgl_base" />
2010-09-26 19:43:24 -04:00
</zipfileset>
2005-05-18 16:27:58 -04:00
</zip>
</target>
<!-- Creates a versioned distribution of javadocs -->
<target name= "-distribution_javadoc" >
2022-03-22 21:26:50 -04:00
<zip destfile= "${lwjgl.target.bundle}/lwjgl-docs-${lwjgl.version}.zip" basedir= "${lwjgl.target.doc}" includes= "javadoc/**" />
2005-05-18 16:27:58 -04:00
</target>
2010-09-26 19:43:24 -04:00
2006-11-19 04:04:28 -05:00
<!-- Creates a versioned distribution of the source code -->
<target name= "-distribution_source" >
2022-03-22 21:26:50 -04:00
<zip destfile= "${lwjgl.target.bundle}/lwjgl-source-${lwjgl.version}.zip" >
2006-11-19 04:04:28 -05:00
<fileset refid= "lwjgl.source.fileset" />
</zip>
2010-09-26 19:43:24 -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" >
2022-03-22 21:26:50 -04:00
<javah classpath= "${lwjgl.target.gen.classes}" destdir= "${lwjgl.src.native}/linux" >
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" />
2011-05-17 12:53:57 -04:00
</javah>
2022-03-22 21:26:50 -04:00
<javah classpath= "${lwjgl.target.gen.classes}" destdir= "${lwjgl.src.native}/linux/opengl" >
2011-05-17 12:53:57 -04:00
<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" />
2005-05-18 16:27:58 -04:00
</javah>
2010-09-28 17:11:35 -04:00
2022-03-22 21:26:50 -04:00
<javah classpath= "${lwjgl.target.gen.classes}" destdir= "${lwjgl.src.native}/windows" >
2011-05-17 12:53:57 -04:00
<class name= "org.lwjgl.WindowsSysImplementation" />
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.WindowsRegistry" />
2011-05-17 12:53:57 -04:00
<class name= "org.lwjgl.opengl.WindowsDisplay" />
<class name= "org.lwjgl.opengl.WindowsDisplayPeerInfo" />
<class name= "org.lwjgl.opengl.WindowsAWTGLCanvasPeerInfo" />
</javah>
2022-03-22 21:26:50 -04:00
<javah classpath= "${lwjgl.target.gen.classes}" destdir= "${lwjgl.src.native}/windows/opengl" >
2011-05-17 12:53:57 -04:00
<class name= "org.lwjgl.opengl.WindowsPbufferPeerInfo" />
<class name= "org.lwjgl.opengl.WindowsPeerInfo" />
<class name= "org.lwjgl.opengl.WindowsContextImplementation" />
</javah>
2022-03-22 21:26:50 -04:00
<javah classpath= "${lwjgl.target.gen.classes}" destdir= "${lwjgl.src.native}/windows/opengles" >
2011-05-17 12:53:57 -04:00
<class name= "org.lwjgl.opengl.WindowsPeerInfo" />
2005-05-18 16:27:58 -04:00
</javah>
2010-09-28 17:11:35 -04:00
2022-03-22 21:26:50 -04:00
<javah classpath= "${lwjgl.target.gen.classes}" destdir= "${lwjgl.src.native}/macosx" >
2008-04-30 10:58:47 -04:00
<class name= "org.lwjgl.MacOSXSysImplementation" />
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" />
2012-11-06 16:55:11 -05:00
<class name= "org.lwjgl.opengl.MacOSXNativeKeyboard" />
<class name= "org.lwjgl.opengl.MacOSXNativeMouse" />
2013-01-14 18:35:46 -05:00
<class name= "org.lwjgl.opengl.MacOSXMouseEventQueue" />
2005-05-18 16:27:58 -04:00
</javah>
2010-09-28 17:11:35 -04:00
2022-03-22 21:26:50 -04:00
<javah classpath= "${lwjgl.target.gen.classes}" destdir= "${lwjgl.src.headers}" >
2005-05-18 16:27:58 -04:00
<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" />
2011-05-17 12:53:57 -04:00
<class name= "org.lwjgl.opencl.CL" />
2010-09-26 19:43:24 -04:00
<class name= "org.lwjgl.opencl.CallbackUtil" />
2011-05-17 12:53:57 -04:00
<class name= "org.lwjgl.BufferUtils" />
</javah>
2022-03-22 21:26:50 -04:00
<javah classpath= "${lwjgl.target.gen.classes}" destdir= "${lwjgl.src.headers}/opengl" >
2011-05-17 12:53:57 -04:00
<class name= "org.lwjgl.opengl.GLContext" />
<class name= "org.lwjgl.opengl.Pbuffer" />
<class name= "org.lwjgl.opengl.CallbackUtil" />
2011-05-21 06:48:05 -04:00
<class name= "org.lwjgl.opengl.NVPresentVideoUtil" />
<class name= "org.lwjgl.opengl.NVVideoCaptureUtil" />
2011-05-17 12:53:57 -04:00
</javah>
2022-03-22 21:26:50 -04:00
<javah classpath= "${lwjgl.target.gen.classes}" destdir= "${lwjgl.src.headers}/opengles" >
2011-05-17 12:53:57 -04:00
<class name= "org.lwjgl.opengles.EGL" />
<class name= "org.lwjgl.opengles.EGLKHRFenceSync" />
<class name= "org.lwjgl.opengles.EGLKHRReusableSync" />
<class name= "org.lwjgl.opengles.EGLNVSync" />
<class name= "org.lwjgl.opengles.GLContext" />
2012-08-07 11:14:03 -04:00
<class name= "org.lwjgl.opengles.CallbackUtil" />
2005-05-18 16:27:58 -04:00
</javah>
2003-11-13 18:16:58 -05:00
</target>
2010-09-26 19:43:24 -04:00
2010-04-12 15:04:27 -04:00
<target name= "touch-version" >
<touch file= "${lwjgl.src.native}/windows/org_lwjgl_opengl_Display.c" />
<touch file= "${lwjgl.src.native}/linux/org_lwjgl_opengl_Display.c" />
<touch file= "${lwjgl.src.native}/macosx/org_lwjgl_opengl_Display.m" />
</target>
2010-09-26 19:43:24 -04:00
2010-04-11 04:27:41 -04:00
<target name= "version-mismatch" >
<loadfile srcfile= "${lwjgl.src}/java/org/lwjgl/WindowsSysImplementation.java" property= "lwjgl.java.windows.version" >
<filterchain >
<tokenfilter >
<containsstring contains= "JNI_VERSION =" />
</tokenfilter>
</filterchain>
</loadfile>
<loadfile srcfile= "${lwjgl.src}/java/org/lwjgl/LinuxSysImplementation.java" property= "lwjgl.java.linux.version" >
<filterchain >
<tokenfilter >
<containsstring contains= "JNI_VERSION =" />
</tokenfilter>
</filterchain>
2010-09-26 19:43:24 -04:00
</loadfile>
2010-04-11 04:27:41 -04:00
<loadfile srcfile= "${lwjgl.src}/java/org/lwjgl/MacOSXSysImplementation.java" property= "lwjgl.java.macosx.version" >
<filterchain >
<tokenfilter >
<containsstring contains= "JNI_VERSION =" />
</tokenfilter>
</filterchain>
</loadfile>
<loadfile srcfile= "${lwjgl.src.native}/windows/org_lwjgl_WindowsSysImplementation.h" property= "lwjgl.native.windows.version" >
<filterchain >
<tokenfilter >
<containsstring contains= "#define org_lwjgl_WindowsSysImplementation_JNI_VERSION" />
</tokenfilter>
</filterchain>
</loadfile>
<loadfile srcfile= "${lwjgl.src.native}/linux/org_lwjgl_LinuxSysImplementation.h" property= "lwjgl.native.linux.version" >
<filterchain >
<tokenfilter >
<containsstring contains= "#define org_lwjgl_LinuxSysImplementation_JNI_VERSION" />
</tokenfilter>
</filterchain>
2010-09-26 19:43:24 -04:00
</loadfile>
2010-04-11 04:27:41 -04:00
<loadfile srcfile= "${lwjgl.src.native}/macosx/org_lwjgl_MacOSXSysImplementation.h" property= "lwjgl.native.macosx.version" >
<filterchain >
<tokenfilter >
<containsstring contains= "#define org_lwjgl_MacOSXSysImplementation_JNI_VERSION" />
</tokenfilter>
</filterchain>
</loadfile>
<echo >
lwjgl.java.windows.version = ${lwjgl.java.windows.version}
2010-09-26 19:43:24 -04:00
lwjgl.native.windows.version = ${lwjgl.native.windows.version}
2010-04-11 04:27:41 -04:00
lwjgl.java.linux.version = ${lwjgl.java.linux.version}
2010-09-26 19:43:24 -04:00
lwjgl.native.linux.version = ${lwjgl.native.linux.version}
2012-11-19 13:28:28 -05:00
lwjgl.java.freebsd.version = ${lwjgl.java.linux.version}
lwjgl.native.freebsd.version = ${lwjgl.native.linux.version}
2013-10-22 10:00:50 -04:00
lwjgl.java.openbsd.version = ${lwjgl.java.linux.version}
lwjgl.native.openbsd.version = ${lwjgl.native.linux.version}
2010-04-11 04:27:41 -04:00
lwjgl.java.macosx.version = ${lwjgl.java.macosx.version}
2010-09-26 19:43:24 -04:00
lwjgl.native.macosx.version = ${lwjgl.native.macosx.version}
2010-04-11 04:27:41 -04:00
</echo>
</target>
2010-09-26 19:43:24 -04:00
2010-04-12 19:22:08 -04:00
<macrodef name= "version-check" >
2022-03-22 21:26:50 -04:00
<attribute name= "platform" />
<sequential >
<java classname= "org.lwjgl.test.NativeTest" logError= "true" resultproperty= "nativetest.res" outputproperty= "nativetest.out" errorproperty= "nativetest.err" fork= "true" >
<jvmarg value= "-Djava.library.path=libs/@{platform}" />
2010-10-02 08:19:00 -04:00
<jvmarg value= "-Dorg.lwjgl.util.Debug=true" />
2022-03-22 21:26:50 -04:00
<classpath >
<pathelement path= "${lwjgl.target.gen.classes}" />
<pathelement path= "${java.class.path}" />
</classpath>
</java>
<fail message= "Unable to load native library: ${nativetest.err}" >
<condition > <not > <equals arg1= "OK" arg2= "${nativetest.out}" /> </not> </condition>
</fail>
<echo message= "Successfully executed NativeTest" />
</sequential>
2010-04-12 19:22:08 -04:00
</macrodef>
2010-09-26 19:43:24 -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" >
2022-03-22 21:26:50 -04:00
<javac debug= "yes" destdir= "${lwjgl.target.gen.classes}" source= "1.8" target= "1.8" classpath= "${lwjgl.lib}/jinput.jar:${lwjgl.lib}/AppleJavaExtensions.jar:${lwjgl.lib}/asm-debug-all.jar" taskname= "core" >
2010-09-28 17:11:35 -04:00
<!-- <compilerarg value=" - Xlint:unchecked"/> -->
2008-04-20 14:46:34 -04:00
<src path= "${lwjgl.src}/java/" />
2022-03-22 21:26:50 -04:00
<src path= "${lwjgl.target.gen.java}/" />
2008-04-20 14:46:34 -04:00
<include name= "org/lwjgl/*.java" />
<include name= "org/lwjgl/input/**" />
<include name= "org/lwjgl/opengl/**" />
2011-05-17 12:53:57 -04:00
<include name= "org/lwjgl/opengles/**" />
2008-04-20 14:46:34 -04:00
<include name= "org/lwjgl/openal/**" />
2010-09-26 19:43:24 -04:00
<include name= "org/lwjgl/opencl/**" />
2008-04-20 14:46:34 -04:00
<include name= "org/lwjgl/util/**" />
<exclude name= "org/lwjgl/util/generator/**" />
2005-02-15 06:05:36 -05:00
</javac>
2022-03-22 21:26:50 -04:00
<javac debug= "yes" srcdir= "${lwjgl.src}/java/" destdir= "${lwjgl.target.gen.classes}" includes= "org/lwjgl/test/**" source= "1.8" target= "1.8" taskname= "test" />
<javac debug= "yes" srcdir= "${lwjgl.src}/java/" destdir= "${lwjgl.target.gen.classes}" includes= "org/lwjgl/examples/**" source= "1.8" target= "1.8" taskname= "examples" />
2010-09-26 19:43:24 -04:00
</target>
2010-10-02 08:19:00 -04:00
<target name= "compile_native" depends= "-initialize, headers, touch-version, version-mismatch" description= "Compiles the native files" >
2004-10-17 17:16:40 -04:00
<condition property= "lwjgl.platform.windows" >
<os family= "windows" />
</condition>
<antcall target= "-compile_native_win32" />
<condition property= "lwjgl.platform.linux" >
2009-04-08 17:53:59 -04:00
<os name= "Linux" />
2004-10-17 17:16:40 -04:00
</condition>
<antcall target= "-compile_native_linux" />
2012-11-19 13:28:28 -05:00
<condition property= "lwjgl.platform.freebsd" >
<os name= "FreeBSD" />
</condition>
<antcall target= "-compile_native_freebsd" />
2013-10-22 10:00:50 -04:00
<condition property= "lwjgl.platform.openbsd" >
<os name= "OpenBSD" />
</condition>
<antcall target= "-compile_native_openbsd" />
2009-04-08 17:53:59 -04:00
<condition property= "lwjgl.platform.solaris" >
<os name= "SunOS" />
</condition>
<antcall target= "-compile_native_solaris" />
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" />
2010-09-26 19:43:24 -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" >
2022-03-22 21:26:50 -04:00
<ant antfile= "platform_build/windows_ant/build.xml" />
2009-04-08 16:18:29 -04:00
<copy todir= "${lwjgl.lib}/windows" >
2022-03-22 21:26:50 -04:00
<fileset dir= "${lwjgl.target.gen.classes}/lwjgl" includes= "lwjgl*.dll" />
2009-04-08 16:18:29 -04:00
</copy>
2010-04-12 19:22:08 -04:00
<version-check platform= "windows" />
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" >
2022-03-22 21:26:50 -04:00
<ant antfile= "platform_build/linux_ant/build.xml" />
2006-07-11 16:49:28 -04:00
<copy todir= "${lwjgl.lib}/linux" >
2022-03-22 21:26:50 -04:00
<fileset dir= "${lwjgl.target.gen.classes}/lwjgl" includes= "liblwjgl*.so" />
2006-07-11 16:49:28 -04:00
</copy>
2010-04-13 16:25:29 -04:00
<!-- headless issues <version - check platform="linux"/> -->
2006-07-07 07:00:32 -04:00
</target>
2005-05-18 16:27:58 -04:00
2012-11-19 13:28:28 -05:00
<!-- Compiles LWJGL on FreeBSD platforms -->
<target name= "-compile_native_freebsd" if= "lwjgl.platform.freebsd" >
2022-03-22 21:26:50 -04:00
<ant antfile= "platform_build/bsd_ant/build.xml" />
2012-11-19 13:28:28 -05:00
<copy todir= "${lwjgl.lib}/freebsd" >
2022-03-22 21:26:50 -04:00
<fileset dir= "${lwjgl.target.gen.classes}/lwjgl" includes= "liblwjgl*.so" />
2012-11-19 13:28:28 -05:00
</copy>
</target>
2013-10-22 10:00:50 -04:00
<!-- Compiles LWJGL on OpenBSD platforms -->
<target name= "-compile_native_openbsd" if= "lwjgl.platform.openbsd" >
2022-03-22 21:26:50 -04:00
<ant antfile= "platform_build/bsd_ant/build.xml" />
2013-10-22 10:00:50 -04:00
<copy todir= "${lwjgl.lib}/openbsd" >
2022-03-22 21:26:50 -04:00
<fileset dir= "${lwjgl.target.gen.classes}/lwjgl" includes= "liblwjgl*.so" />
2013-10-22 10:00:50 -04:00
</copy>
</target>
2009-04-08 17:53:59 -04:00
<!-- Compiles LWJGL on solaris platforms -->
<target name= "-compile_native_solaris" if= "lwjgl.platform.solaris" >
<!-- Reusing the linux ant task, but copy the output to solaris -->
2022-03-22 21:26:50 -04:00
<ant antfile= "platform_build/linux_ant/build.xml" />
2009-04-08 17:53:59 -04:00
<copy todir= "${lwjgl.lib}/solaris" >
2022-03-22 21:26:50 -04:00
<fileset dir= "${lwjgl.target.gen.classes}/lwjgl" includes= "liblwjgl*.so" />
2009-04-08 17:53:59 -04:00
</copy>
2010-04-12 19:22:08 -04:00
<version-check platform= "solaris" />
2009-04-08 17:53:59 -04:00
</target>
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" >
2022-03-22 21:26:50 -04:00
<ant antfile= "platform_build/macosx_ant/build.xml" />
<copy file= "${lwjgl.target.bundle}/liblwjgl.dylib" todir= "${lwjgl.lib}/macosx" />
2010-04-12 19:22:08 -04:00
<version-check platform= "macosx" />
2006-07-07 08:41:36 -04:00
</target>
2010-09-26 19:43:24 -04:00
2011-05-17 12:53:57 -04:00
<target name= "compile_native_es" depends= "-initialize, headers, touch-version, version-mismatch" description= "Compiles the native files" >
<condition property= "lwjgl.platform.windows" >
<os family= "windows" />
</condition>
<antcall target= "-compile_native_win32_es" />
<condition property= "lwjgl.platform.linux" >
<os name= "Linux" />
</condition>
<antcall target= "-compile_native_linux_es" />
</target>
<!-- Compiles LWJGL ES on Win32 platforms -->
<target name= "-compile_native_win32_es" if= "lwjgl.platform.windows" >
2022-03-22 21:26:50 -04:00
<ant antfile= "platform_build/windows_ant/build_es.xml" />
2011-05-17 12:53:57 -04:00
<copy todir= "${lwjgl.lib}/windows" >
2022-03-22 21:26:50 -04:00
<fileset dir= "${lwjgl.target.gen.classes}/lwjgles" includes= "lwjgl*.dll" />
2011-05-17 12:53:57 -04:00
</copy>
</target>
<!-- Compiles LWJGL ES on Linux platforms -->
<target name= "-compile_native_linux_es" if= "lwjgl.platform.linux" >
2022-03-22 21:26:50 -04:00
<ant antfile= "platform_build/linux_ant/build_es.xml" />
2011-05-17 12:53:57 -04:00
<copy todir= "${lwjgl.lib}/linux" >
2022-03-22 21:26:50 -04:00
<fileset dir= "${lwjgl.target.gen.classes}/lwjgles" includes= "liblwjgl*.so" />
2011-05-17 12:53:57 -04:00
</copy>
</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>
2010-09-26 19:43:24 -04:00
2008-04-20 16:02:02 -04:00
<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" />
2010-08-28 12:39:16 -04:00
<param name= "output" value= "${outputdir}${jarfile}.jar.pack.lzma" />
2008-04-20 16:02:02 -04:00
</antcall>
2010-08-28 12:39:16 -04:00
<!-- delete file="${dir}${jarfile} - repack.jar"/ -->
2008-04-20 16:02:02 -04:00
<delete file= "${dir}${jarfile}.jar.pack" />
2010-08-28 12:39:16 -04:00
<!-- delete file="${dir}${jarfile}.jar"/ -->
<rename src= "${dir}${jarfile}-repack.jar" dest= "${dir}${jarfile}.jar" replace= "yes" />
2008-04-20 16:02:02 -04:00
</target>
2010-09-26 19:43:24 -04:00
2008-04-20 16:02:02 -04:00
<target name= "compress-resource" >
<antcall target= "lzma" >
<param name= "input" value= "${input}" />
<param name= "output" value= "${output}" />
</antcall>
</target>
2010-09-26 19:43:24 -04:00
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" />
2009-03-17 17:50:09 -04:00
<condition property= "native_path" value= "libs/windows" >
2008-04-20 14:46:34 -04:00
<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}" />
2009-08-12 09:06:11 -04:00
<arg line= "${args}" />
2008-04-20 14:46:34 -04:00
</java>
2010-09-26 19:43:24 -04:00
</target>
2008-04-20 14:46:34 -04:00
<!-- Creates the Javadoc -->
<target name= "javadoc" description= "Creates javadoc from java source code" >
2022-03-22 21:26:50 -04:00
<javadoc destdir= "${lwjgl.target.doc}/javadoc" classpath= "${lwjgl.lib}/jinput.jar" author= "true" version= "true" use= "true" source= "1.8" windowtitle= "LWJGL API" useexternalfile= "true" >
2008-04-20 14:46:34 -04:00
<fileset refid= "lwjgl.javadoc.fileset" />
<doctitle > <![CDATA[<h1>Lightweight Java Game Toolkit</h1>]]> </doctitle>
2009-03-17 17:50:09 -04:00
<bottom > <![CDATA[<i>Copyright © 2002-2009 lwjgl.org. All Rights Reserved.</i>]]> </bottom>
2008-04-20 14:46:34 -04:00
</javadoc>
</target>
2003-12-15 07:18:15 -05:00
</project>