@@ -9,6 +9,27 @@ Defines global properties and useful macros.
99This script is included in /build.xml and /config/update-dependencies.xml.
1010-->
1111<project name =" definitions" basedir =" ../" xmlns : if =" ant:if" xmlns : unless =" ant:unless" >
12+ <property name =" bin.ant" location =" bin/classes/ant" relative =" true" />
13+
14+ <!-- Compile custom Ant tasks -->
15+ <mkdir dir =" bin/classes/ant" />
16+ <javac
17+ sourcepath =" " debug =" yes" source =" 8" target =" 8" encoding =" UTF-8" includeantruntime =" false" nowarn =" true"
18+
19+ destdir =" bin/classes/ant"
20+ classpath =" ${ant.core.lib}"
21+
22+ srcdir =" modules/ant/src/main/java"
23+ includes =" org/lwjgl/**"
24+
25+ taskname =" javac: Custom Ant Tasks"
26+ />
27+
28+ <!-- Define custom Ant tasks -->
29+ <taskdef name =" logLevel" classname =" org.lwjgl.SetLogLevel" classpath =" ${bin.ant}" />
30+ <taskdef name =" bindingConfig" classname =" org.lwjgl.BindingConfig" classpath =" ${bin.ant}" />
31+ <taskdef name =" detectJDKVersion" classname =" org.lwjgl.DetectJDKVersion" classpath =" ${bin.ant}" />
32+
1233 <property environment =" env" />
1334
1435 <!--
@@ -82,13 +103,11 @@ This script is included in /build.xml and /config/update-dependencies.xml.
82103
83104 <property name =" module.lwjgl" location =" modules/lwjgl" relative =" true" />
84105
85- <property name =" src.ant" location =" modules/ant/src/main" relative =" true" />
86106 <property name =" src.extract" location =" modules/extract/src/main" relative =" true" />
87107 <property name =" src.generator" location =" modules/generator/src/main" relative =" true" />
88108
89109 <property name =" test.resources" location =" modules/samples/src/test/resources" relative =" true" />
90110
91- <property name =" bin.ant" location =" bin/classes/ant" relative =" true" />
92111 <property name =" bin.extract" location =" bin/classes/extract" relative =" true" />
93112 <property name =" bin.generator" location =" bin/classes/generator" relative =" true" />
94113 <property name =" bin.javadoc" location =" bin/javadoc" relative =" true" />
@@ -134,29 +153,7 @@ This script is included in /build.xml and /config/update-dependencies.xml.
134153
135154 <property name =" lib.native" location =" ${lib}/native/${platform}/${build.arch}" relative =" true" />
136155
137- <!--
138- Detect version of JDK running the Ant build.
139-
140- VNUM = [1-9][0-9]*((\.0)*\.[1-9][0-9]*)*
141- PRE = [a-zA-Z0-9]+
142- java.version = $VNUM(\-$PRE)?
143- -->
144- <local name =" java.version.regex" />
145- <property name =" java.version.regex" value =" ((\.0)*\.[1-9][0-9]*)*(-[a-zA-Z0-9]+)?" /> <!-- without the major number -->
146-
147- <condition property =" jdk21" > <matches string =" ${java.version}" pattern =" ^21${java.version.regex}$" /> </condition >
148- <condition property =" jdk20" ><or ><isset property =" jdk21" /><matches string =" ${java.version}" pattern =" ^20${java.version.regex}$" /></or ></condition >
149- <condition property =" jdk19" ><or ><isset property =" jdk20" /><matches string =" ${java.version}" pattern =" ^19${java.version.regex}$" /></or ></condition >
150- <condition property =" jdk18" ><or ><isset property =" jdk19" /><matches string =" ${java.version}" pattern =" ^18${java.version.regex}$" /></or ></condition >
151- <condition property =" jdk17" ><or ><isset property =" jdk18" /><matches string =" ${java.version}" pattern =" ^17${java.version.regex}$" /></or ></condition >
152- <condition property =" jdk16" ><or ><isset property =" jdk17" /><matches string =" ${java.version}" pattern =" ^16${java.version.regex}$" /></or ></condition >
153- <condition property =" jdk15" ><or ><isset property =" jdk16" /><matches string =" ${java.version}" pattern =" ^15${java.version.regex}$" /></or ></condition >
154- <condition property =" jdk14" ><or ><isset property =" jdk15" /><matches string =" ${java.version}" pattern =" ^14${java.version.regex}$" /></or ></condition >
155- <condition property =" jdk13" ><or ><isset property =" jdk14" /><matches string =" ${java.version}" pattern =" ^13${java.version.regex}$" /></or ></condition >
156- <condition property =" jdk12" ><or ><isset property =" jdk13" /><matches string =" ${java.version}" pattern =" ^12${java.version.regex}$" /></or ></condition >
157- <condition property =" jdk11" ><or ><isset property =" jdk12" /><matches string =" ${java.version}" pattern =" ^11${java.version.regex}$" /></or ></condition >
158- <condition property =" jdk10" ><or ><isset property =" jdk11" /><matches string =" ${java.version}" pattern =" ^10${java.version.regex}$" /></or ></condition >
159- <condition property = " jdk9" ><or ><isset property =" jdk10" /><matches string =" ${java.version}" pattern = " ^9${java.version.regex}$" /></or ></condition >
156+ <detectJDKVersion />
160157
161158 <!-- May be set in the ant command line to test multi-release implementations. -->
162159 <condition property =" core.java20" ><isset property =" core.java21" /></condition >
@@ -185,33 +182,34 @@ This script is included in /build.xml and /config/update-dependencies.xml.
185182 <property name =" bin.native" location =" bin/${platform}/${build.arch}" relative =" true" />
186183
187184 <import file =" build-bindings.xml" />
185+ <bindingConfig />
188186
189187 <presetdef name =" lwjgl.javac" >
190- <javac sourcepath =" " debug =" yes" source =" 8" target =" 8" encoding =" UTF-8" >
188+ <javac sourcepath =" " debug =" yes" source =" 8" target =" 8" encoding =" UTF-8" includeantruntime = " false " >
191189 <compilerarg line =' --boot-class-path "${env.JAVA8_HOME}/jre/lib/rt.jar"' if : set =" set-boot-class-path" />
192190 <compilerarg value =" -Xlint:all" />
193191 <compilerarg value =" -XDignore.symbol.file" /> <!-- Suppresses internal API (e.g. Unsafe) usage warnings -->
194192 </javac >
195193 </presetdef >
196194
197195 <presetdef name =" lwjgl.javac9" >
198- <javac sourcepath =" " debug =" yes" encoding =" UTF-8" >
196+ <javac sourcepath =" " debug =" yes" encoding =" UTF-8" includeantruntime = " false " >
199197 <compilerarg line =" --release 9" />
200198 <compilerarg value =" -Xlint:all" />
201199 <compilerarg value =" -XDignore.symbol.file" />
202200 </javac >
203201 </presetdef >
204202
205203 <presetdef name =" lwjgl.javac10" >
206- <javac sourcepath =" " debug =" yes" encoding =" UTF-8" >
204+ <javac sourcepath =" " debug =" yes" encoding =" UTF-8" includeantruntime = " false " >
207205 <compilerarg line =" --release 10" />
208206 <compilerarg value =" -Xlint:all" />
209207 <compilerarg value =" -XDignore.symbol.file" />
210208 </javac >
211209 </presetdef >
212210
213211 <presetdef name =" lwjgl.javac16" >
214- <javac sourcepath =" " debug =" yes" encoding =" UTF-8" >
212+ <javac sourcepath =" " debug =" yes" encoding =" UTF-8" includeantruntime = " false " >
215213 <compilerarg line =" --release 16" />
216214 <compilerarg value =" -Xlint:all" />
217215 <compilerarg value =" -XDignore.symbol.file" />
0 commit comments