forked from LWJGL-CI/lwjgl3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
594 lines (492 loc) · 23.6 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
<!--
Copyright LWJGL. All rights reserved.
License terms: http://lwjgl.org/license.php
-->
<project name="LWJGL" basedir="." default="all" xmlns:if="ant:if" xmlns:unless="ant:unless">
<property name="build.sysclasspath" value="ignore"/>
<property name="config" location="config" relative="true"/>
<import file="${config}/build-definitions.xml"/>
<import file="${config}/build-assets.xml"/>
<import file="${config}/${platform}/build.xml"/>
<!-- Initialize build -->
<target name="init" description="Initializes the directories required by the build process">
<fail message="LWJGL requires Ant version 1.9.3 or higher.">
<condition>
<not>
<antversion atleast="1.9.3"/>
</not>
</condition>
</fail>
<echo taskname="override" message="Build type: ${build.type}" if:set="env.LWJGL_BUILD_TYPE"/>
<echo taskname="override" message="Build output: ${build.output}" if:set="env.LWJGL_BUILD_OUTPUT"/>
<echo taskname="override" message="Build architecture: ${build.arch}" if:set="env.LWJGL_BUILD_ARCH"/>
<echo taskname="override" message="Build offline: ${build.offline}" if:set="env.LWJGL_BUILD_OFFLINE"/>
<!-- These depend on LWJGL_BUILD_OUTPUT and may be symlinks -->
<mkdir-symlink dir="bin"/>
<mkdir-symlink dir="${src.generated}"/>
<mkdir dir="${bin.core}"/>
<mkdir dir="${bin.templates}"/>
<mkdir dir="${bin.tests}"/>
<mkdir dir="${bin.native}"/>
<ant antfile="update-dependencies.xml" target="check-dependencies" inheritAll="false"/>
<!--<taskdef resource="org/jetbrains/kotlin/buildtools/ant/antlib.xml" classpath="${kotlinc}/lib/kotlin-ant.jar"/>-->
<taskdef resource="testngtasks" classpath="libs/testng.jar"/>
</target>
<target name="init-generated" description="Initializes the lwjgl3-generated git repository in /generated. [Optional]">
<confirm-replace dir="${src.generated}" msg="The ${src.generated} directory contents will be replaced with a fresh clone of the lwjgl3-generated repository. Continue?"/>
<!-- Purge /generated contents -->
<delete-symlink dir="${src.generated}"/>
<mkdir-symlink dir="${src.generated}"/>
<!-- Clone repo -->
<exec executable="git" failonerror="true">
<arg value="clone"/>
<arg value="https://github.com/LWJGL/lwjgl3-generated.git"/>
<arg value="${src.generated}"/>
</exec>
</target>
<target name="init-wiki" description="Initializes the lwjgl3-wiki git repository in /wiki. [Optional]">
<confirm-replace dir="${wiki}" msg="The ${wiki} directory contents will be replaced with a fresh clone of the lwjgl3-wiki repository. Continue?"/>
<delete dir="${wiki}"/>
<exec executable="git" failonerror="true">
<arg value="clone"/>
<arg value="https://github.com/LWJGL/lwjgl3-wiki.wiki.git"/>
<arg value="${wiki}"/>
</exec>
</target>
<target name="reset" description="Resets the repository to its initial state.">
<local name="reset.input"/>
<input
message="This action will clean everything and also remove libraries and sub-repositories. Continue?"
validargs="y,n"
defaultvalue="n"
addproperty="reset.input"
/>
<condition property="do.reset">
<equals arg1="y" arg2="${reset.input}"/>
</condition>
<fail unless="do.reset">Cancelled</fail>
<antcall target="clean"/>
<delete-symlink dir="${src.generated}"/>
<delete dir="${wiki}"/>
<delete dir="${lib}"/>
<echo message="Reset successful."/>
</target>
<target name="clean" description="Cleans all directories controlled by this script" depends="clean-java, clean-native, clean-templates, clean-generated">
<delete-symlink dir="bin"/>
<!-- Do not delete /generated, it may contain the lwjgl3-generated git repo -->
<!-- Do not delete /wiki, it may contain the lwjgl3-wiki git repo -->
<echo message="Cleanup successful."/>
</target>
<target name="clean-java" description="Deletes Java binary files produced by this script">
<delete dir="${bin.core}"/>
<delete dir="${bin.tests}"/>
</target>
<target name="clean-native" description="Deletes native binary files produced by this script">
<delete dir="${bin.native}"/>
</target>
<target name="clean-templates" description="Deletes template binary files produced by this script">
<delete dir="${bin.templates}"/>
</target>
<target name="clean-generated" description="Deletes sources, test results and documentation generated by this script" depends="clean-generated-java,clean-generated-native">
<delete dir="${bin.html.tests}"/>
<delete dir="${bin.html.javadoc}"/>
</target>
<target name="clean-generated-java" description="Deletes Java sources generated by this script">
<delete file="${src.generated}/touch.txt" quiet="true"/>
<delete dir="${src.generated.java}"/>
</target>
<target name="clean-generated-native" description="Deletes native sources generated by this script">
<delete file="${src.generated}/touch.txt" quiet="true"/>
<delete dir="${src.generated.native}"/>
</target>
<target name="all" description="Build LWJGL and runs the tests" depends="compile-templates,tests"/>
<target name="compile-templates" description="Compiles the Templates module" depends="init">
<uptodate targetfile="${bin.templates}/org/lwjgl/generator/Generator.class" property="templates-uptodate">
<srcfiles dir="${config}" includes="build-bindings.xml"/>
<srcfiles dir="${src.templates}" includes="**"/>
</uptodate>
<antcall target="-compile-templates"/>
</target>
<target name="-compile-templates" description="Compiles the Templates module" depends="bindings" unless="templates-uptodate">
<!-- Compile Java dependencies -->
<lwjgl.javac destdir="${bin}/Templates" taskname="Java dependencies">
<src path="${src.templates}/java"/>
<include name="org/lwjgl/*.java"/>
</lwjgl.javac>
<!-- Compile Kotlin code -->
<echo message="Compiling Kotlin templates. This will take 1-2 minutes..." level="info" taskname="Templates"/>
<java
classpath="${kotlinc}/lib/kotlin-preloader.jar"
classname="org.jetbrains.kotlin.preloading.Preloader"
fork="true" failonerror="true" taskname="Templates"
>
<jvmarg value="-server"/>
<jvmarg value="-Xms1024m"/>
<jvmarg value="-Xverify:none"/>
<arg value="-measure"/>
<arg value="-classpath"/>
<arg path="${kotlinc}/lib/kotlin-compiler.jar:${kotlinc}/lib/kotlin-runtime.jar:${kotlinc}/lib/kotlin-reflect.jar"/>
<arg line="org.jetbrains.kotlin.cli.jvm.K2JVMCompiler"/>
<arg line="-kotlin-home ${kotlinc}"/>
<arg line="-d ${bin.templates}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/generator"/>
<arg value="${src.templates.kotlin}/org/lwjgl/egl" if:true="${binding.egl}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/egl/EGLTypes.kt" unless:true="${binding.egl}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/glfw" if:true="${binding.glfw}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/nanovg" if:true="${binding.nanovg}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/openal" if:true="${binding.openal}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/opencl" if:true="${binding.opencl}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/opencl/CLTypes.kt" unless:true="${binding.opencl}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/opengl" if:true="${binding.opengl}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/opengl/GLTypes.kt" unless:true="${binding.opengl}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/opengles" if:true="${binding.opengles}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/ovr" if:true="${binding.ovr}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/stb" if:true="${binding.stb}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/vulkan" if:true="${binding.vulkan}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/vulkan/VKypes.kt" unless:true="${binding.vulkan}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/vulkan/ExtensionTypes.kt" unless:true="${binding.vulkan}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/system/jawt" if:true="${binding.jawt}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/system/jemalloc"/>
<arg value="${src.templates.kotlin}/org/lwjgl/system/libc"/>
<arg value="${src.templates.kotlin}/org/lwjgl/system/libffi"/>
<arg value="${src.templates.kotlin}/org/lwjgl/system/linux"/>
<arg value="${src.templates.kotlin}/org/lwjgl/system/macosx"/>
<arg value="${src.templates.kotlin}/org/lwjgl/system/windows"/>
<arg value="${src.templates.kotlin}/org/lwjgl/util/nfd" if:true="${binding.nfd}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/util/par" if:true="${binding.par}"/>
<arg value="${src.templates.kotlin}/org/lwjgl/util/simd"/>
<arg value="${src.templates.kotlin}/org/lwjgl/util/xxhash"/>
<!--
<arg value="-Xno-call-assertions"/>
<arg value="-Xno-param-assertions"/>
-->
</java>
</target>
<target name="formatter" description="Runs the template formatter tool" depends="init"> <!-- Removed "compile-templates" until Kotlin adds support for incremental compilation -->
<lwjgl.javac destdir="${bin.templates}" taskname="Compile formatter">
<src path="${src.templates}/java"/>
<include name="org/lwjgl/generator/util/**"/>
</lwjgl.javac>
<java
classname="org.lwjgl.generator.util.TemplateFormatter"
fork="true"
spawn="true"
>
<classpath>
<pathelement path="${bin.templates}"/>
<pathelement path="${test.resources}"/>
</classpath>
</java>
</target>
<target name="generate" description="Runs the bindings Generator" depends="init">
<available file="${bin.templates}/org/lwjgl/generator/Generator.class" property="has-compiled-templates"/>
<fail unless="has-compiled-templates" message="Please invoke the compile-templates target first."/>
<uptodate property="generated-uptodate" targetfile="${src.generated}/touch.txt">
<srcfiles dir="${config}" includes="build-bindings.xml"/>
<srcfiles dir="${bin.templates}" includes="**/*.class"/>
</uptodate>
<antcall target="-generate"/>
</target>
<target name="-generate" description="Runs the code Generator" depends="bindings" unless="generated-uptodate">
<java
classname="org.lwjgl.generator.GeneratorKt"
fork="true"
failonerror="true"
taskname="Generator"
>
<classpath>
<pathelement path="${bin.templates}"/>
<pathelement path="${kotlinc}/lib/kotlin-runtime.jar"/>
</classpath>
<jvmarg value="-server"/>
<jvmarg line="${bindings}"/>
<arg value="${src.templates}/kotlin"/>
<arg value="${src.generated}"/>
</java>
<touch file="${src.generated}/touch.txt" verbose="false"/>
</target>
<target name="-init-compile" description="Initializes properties required for compilation" depends="bindings">
<patternset id="core.main.files">
<include name="org/lwjgl/*.java"/>
<include name="org/lwjgl/system/**"/>
<include name="org/lwjgl/egl/**" if:true="${binding.egl}"/>
<include name="org/lwjgl/glfw/**" if:true="${binding.glfw}"/>
<include name="org/lwjgl/nanovg/**" if:true="${binding.nanovg}"/>
<include name="org/lwjgl/openal/**" if:true="${binding.openal}"/>
<include name="org/lwjgl/opencl/**" if:true="${binding.opencl}"/>
<include name="org/lwjgl/opengl/**" if:true="${binding.opengl}"/>
<include name="org/lwjgl/opengles/**" if:true="${binding.opengles}"/>
<include name="org/lwjgl/vulkan/**" if:true="${binding.vulkan}"/>
</patternset>
<patternset id="core.generated.files">
<include name="org/lwjgl/egl/**" if:true="${binding.egl}"/>
<include name="org/lwjgl/glfw/**" if:true="${binding.glfw}"/>
<include name="org/lwjgl/nanovg/**" if:true="${binding.nanovg}"/>
<include name="org/lwjgl/openal/**" if:true="${binding.openal}"/>
<include name="org/lwjgl/opencl/**" if:true="${binding.opencl}"/>
<include name="org/lwjgl/opengl/**" if:true="${binding.opengl}"/>
<include name="org/lwjgl/opengles/**" if:true="${binding.opengles}"/>
<include name="org/lwjgl/ovr/**" if:true="${binding.ovr}"/>
<include name="org/lwjgl/stb/**" if:true="${binding.stb}"/>
<include name="org/lwjgl/vulkan/**" if:true="${binding.vulkan}"/>
<include name="org/lwjgl/system/JNI.*"/>
<include name="org/lwjgl/system/jemalloc/**"/>
<include name="org/lwjgl/system/libc/**"/>
<include name="org/lwjgl/system/libffi/**"/>
<include name="org/lwjgl/system/linux/**"/>
<include name="org/lwjgl/system/macosx/**"/>
<include name="org/lwjgl/system/windows/**"/>
<include name="org/lwjgl/system/jawt/**" if:true="${binding.jawt}"/>
<include name="org/lwjgl/util/nfd/**" if:true="${binding.nfd}"/>
<include name="org/lwjgl/util/par/**" if:true="${binding.par}"/>
<include name="org/lwjgl/util/simd/**"/>
<include name="org/lwjgl/util/xxhash/**"/>
</patternset>
</target>
<target name="compile" description="Compiles the Java source code" depends="generate, -init-compile">
<lwjgl.javac destdir="${bin.core}" taskname="Core">
<src>
<pathelement path="${src.core}"/>
<pathelement path="${src.generated.java}"/>
</src>
<patternset refid="core.main.files"/>
<patternset refid="core.generated.files"/>
<patternset excludes="**/package-info.java"/>
<!-- Supresses internal API (e.g. Unsafe) usage warnings -->
<compilerarg value="-XDignore.symbol.file=true"/>
</lwjgl.javac>
</target>
<target name="compile-native" description="Compiles the native source code" depends="init, compile">
<antcall target="compile-native-platform"/>
</target>
<target name="compile-tests" description="Compiles the LWJGL test suite" depends="compile">
<local name="openal_stb"/>
<condition property="openal_stb" value="true" else="false">
<and>
<istrue value="${binding.openal}"/>
<istrue value="${binding.stb}"/>
</and>
</condition>
<local name="opencl_glfw"/>
<condition property="opencl_glfw" value="true" else="false">
<and>
<istrue value="${binding.opencl}"/>
<istrue value="${binding.glfw}"/>
</and>
</condition>
<local name="stb_glfw"/>
<condition property="stb_glfw" value="true" else="false">
<and>
<istrue value="${binding.stb}"/>
<istrue value="${binding.glfw}"/>
</and>
</condition>
<local name="nanovg"/>
<condition property="nanovg" value="true" else="false">
<and>
<istrue value="${binding.nanovg}"/>
<istrue value="${binding.glfw}"/>
<istrue value="${binding.opengl}"/>
</and>
</condition>
<local name="nfd"/>
<condition property="nfd" value="true" else="false">
<and>
<istrue value="${binding.nfd}"/>
<istrue value="${binding.glfw}"/>
<istrue value="${binding.opengl}"/>
</and>
</condition>
<lwjgl.javac destdir="${bin.tests}" taskname="Tests">
<classpath>
<pathelement path="${bin.core}"/>
<pathelement path="${lib}/testng.jar"/>
</classpath>
<src path="${src.tests}/"/>
<!-- Demos -->
<include name="org/lwjgl/demo/egl/**" if:true="${binding.egl}"/>
<include name="org/lwjgl/demo/glfw/**" if:true="${binding.glfw}"/>
<include name="org/lwjgl/demo/nanovg/**" if:true="${nanovg}"/>
<include name="org/lwjgl/demo/openal/**" if:true="${binding.openal}"/>
<exclude name="org/lwjgl/demo/openal/ALCDemo.java" unless:true="${openal_stb}"/>
<exclude name="org/lwjgl/demo/openal/EFXTest.java" unless:true="${openal_stb}"/>
<include name="org/lwjgl/demo/opencl/**" if:true="${opencl_glfw}"/>
<include name="org/lwjgl/demo/opencl/CLDemo.java" if:true="${binding.opencl}"/>
<include name="org/lwjgl/demo/opengl/**" if:true="${binding.glfw}"/>
<include name="org/lwjgl/demo/ovr/**" if:true="${binding.ovr}"/>
<include name="org/lwjgl/demo/stb/**" if:true="${stb_glfw}"/>
<include name="org/lwjgl/demo/system/jawt/**" if:true="${binding.jawt}"/>
<include name="org/lwjgl/demo/util/*.java"/>
<include name="org/lwjgl/demo/util/nfd/**" if:true="${nfd}"/>
<include name="org/lwjgl/demo/util/par/**" if:true="${binding.par}"/>
<include name="org/lwjgl/demo/util/xxhash/**"/>
<include name="org/lwjgl/demo/vulkan/**" if:true="${binding.vulkan}"/>
<!-- Tests -->
<include name="org/lwjgl/opencl/**" if:true="${binding.opencl}"/>
<include name="org/lwjgl/system/**"/>
<include name="org/lwjgl/util/**"/>
</lwjgl.javac>
</target>
<target name="-init-runtime" description="Initializes properties required for running demos and tests">
<path id="runtime.classpath">
<pathelement path="${bin.core}"/>
<pathelement path="${test.resources}"/>
<pathelement path="${bin.tests}"/>
</path>
</target>
<target name="tests" description="Runs the LWJGL test suite" depends="compile-tests, compile-native, -init-runtime">
<testng outputDir="${bin.html.tests}" classpathref="runtime.classpath" taskname="Tests">
<classpath>
<pathelement path="${lib}/jcommander.jar"/>
</classpath>
<!--<jvmarg value="-Xcheck:jni"/>--> <!-- SIMD fails with this (see -XX:+RestoreMXCSROnJNICall) -->
<jvmarg value="-ea"/>
<jvmarg value="-Dorg.lwjgl.util.Debug=true"/>
<jvmarg value="-Djava.library.path=${lib}"/>
<jvmarg value="-XstartOnFirstThread" if:set="platform.macosx"/>
<jvmarg line="${jvmargs}" if:set="jvmargs"/>
<xmlfileset dir="${config}" includes="tests.xml,tests_${platform}.xml"/>
</testng>
</target>
<target name="demo" description="Runs an LWJGL demo" depends="compile-tests, compile-native, -init-runtime, -update-assets">
<fail message="Please use -Dclass=<class> to specify the demo main class to run." unless="class"/>
<java classname="${class}" classpathref="runtime.classpath" fork="true" failonerror="true" taskname="Demo">
<classpath>
<pathelement path="${lib}/testng.jar"/>
</classpath>
<jvmarg value="-Djava.library.path=${lib}"/>
<jvmarg value="-XstartOnFirstThread" if:set="platform.macosx"/>
<jvmarg line="${jvmargs}" if:set="jvmargs"/>
<arg line="${args}" if:set="args"/>
</java>
</target>
<target name="-build-version" description="Retrieves the LWJGL version from org.lwjgl.Version">
<java classname="org.lwjgl.Version" fork="true" failonerror="true" outputproperty="build.version">
<classpath path="${bin.core}"/>
<jvmarg value="-Djava.library.path=${lib}"/>
</java>
</target>
<target name="javadoc" description="Generates the LWJGL JavaDoc" depends="generate">
<uptodate targetfile="${bin.html.javadoc}/index.html" property="javadoc-uptodate">
<srcfiles dir="${src.core}" includes="**"/>
<srcfiles dir="${src.templates}/java" includes="org/lwjgl/system/**"/>
<srcfiles dir="${src.generated.java}" includes="**"/>
</uptodate>
<antcall target="-javadoc"/>
</target>
<target name="-javadoc" description="Generates the LWJGL JavaDoc" depends="-init-compile,-build-version" unless="javadoc-uptodate">
<lwjgl.javac destdir="${bin.templates}" taskname="Compile doclets">
<src path="${src.templates}/java"/>
<include name="org/lwjgl/system/**"/>
<classpath>
<pathelement location="${env.JAVA_HOME}/lib/tools.jar" unless:set="jdk.apple"/>
</classpath>
</lwjgl.javac>
<delete dir="${bin.html.javadoc}"/>
<javadoc
destdir="${bin.html.javadoc}"
source="1.6"
windowtitle="LWJGL ${build.version}"
encoding="UTF-8"
docencoding="UTF-8"
charset="UTF-8"
useexternalfile="true"
nohelp="true"
notree="true"
public="true"
doclet="org.lwjgl.system.ExcludeDoclet"
docletpath="${bin.templates}"
maxmemory="1G"
failonerror="true"
>
<doctitle><![CDATA[<h1>Lightweight Java Game Library</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright LWJGL. All Rights Reserved. <a href="http://lwjgl.org/license.php">License terms</a>.</i>]]></bottom>
<classpath>
<pathelement path="${src.core}"/>
<pathelement path="${src.generated.java}"/>
</classpath>
<fileset dir="${src.core}">
<patternset refid="core.main.files"/>
</fileset>
<fileset dir="${src.generated.java}">
<patternset refid="core.generated.files"/>
</fileset>
<arg value="-XDignore.symbol.file=true"/> <!-- Supresses internal API (e.g. Unsafe) usage warnings -->
<arg value="-Xdoclint" if:set="jdk8"/>
<arg value="-html5" if:set="jdk9"/>
<arg value="-stylesheetfile ${config}/javadoc.css" if:set="jdk9"/>
</javadoc>
<get-quiet name="favicon" url="http://s3.amazonaws.com/cdn.lwjgl.org/favicon.ico" dest="${bin.html.javadoc}"/>
<java classname="org.lwjgl.system.JavadocPostProcess" fork="true" failonerror="true">
<classpath path="${bin.templates}"/>
<arg value="${bin.html.javadoc}/org/lwjgl"/>
</java>
</target>
<target name="release" description="Creates the LWJGL binary redistributable" depends="compile,javadoc,-build-version">
<!-- Bundle classes -->
<mkdir dir="${release.jar}"/>
<jar destfile="${release.jar}/lwjgl.jar" basedir="${bin.core}" includes="**" level="9" index="true">
<manifest>
<section name="org/lwjgl/">
<attribute name="Specification-Title" value="Lightweight Java Game Library"/>
<attribute name="Specification-Version" value="${build.version}"/>
<attribute name="Specification-Vendor" value="lwjgl.org"/>
<attribute name="Implementation-Title" value="lwjgl"/>
<attribute name="Implementation-Version" value="build ${build.revision}" if:set="build.revision"/>
<attribute name="Implementation-Version" value="SNAPSHOT" unless:set="build.revision"/>
<attribute name="Implementation-Vendor" value="lwjgl.org"/>
</section>
</manifest>
</jar>
<!-- Download binaries from build.lwjgl.org -->
<mkdir dir="${release.native}"/>
<get dest="${release.native}" verbose="false" usetimestamp="true">
<!-- Linux -->
<url url="http://build.lwjgl.org/${build.type}/linux/x64/liblwjgl.so"/>
<url url="http://build.lwjgl.org/${build.type}/linux/x64/libjemalloc.so"/>
<url url="http://build.lwjgl.org/${build.type}/linux/x64/libglfw.so"/>
<url url="http://build.lwjgl.org/${build.type}/linux/x64/libopenal.so"/>
<!--<url url="http://build.lwjgl.org/${build.type}/linux/x86/liblwjgl.so"/>
<url url="http://build.lwjgl.org/${build.type}/linux/x86/libjemalloc.so"/>
<url url="http://build.lwjgl.org/${build.type}/linux/x86/libglfw.so"/>
<url url="http://build.lwjgl.org/${build.type}/linux/x86/libopenal.so"/>-->
<!-- Mac OS X -->
<url url="http://build.lwjgl.org/${build.type}/macosx/x64/liblwjgl.dylib"/>
<url url="http://build.lwjgl.org/${build.type}/macosx/x64/libjemalloc.dylib"/>
<url url="http://build.lwjgl.org/${build.type}/macosx/x64/libglfw.dylib"/>
<url url="http://build.lwjgl.org/${build.type}/macosx/x64/libopenal.dylib"/>
<!-- Windows -->
<url url="http://build.lwjgl.org/${build.type}/windows/x64/lwjgl.dll"/>
<url url="http://build.lwjgl.org/${build.type}/windows/x64/jemalloc.dll"/>
<url url="http://build.lwjgl.org/${build.type}/windows/x64/glfw.dll"/>
<url url="http://build.lwjgl.org/${build.type}/windows/x86/lwjgl.dll"/>
<url url="http://build.lwjgl.org/${build.type}/windows/x86/jemalloc.dll"/>
<url url="http://build.lwjgl.org/${build.type}/windows/x86/glfw.dll"/>
<firstmatchmapper>
<regexpmapper from="x86/(\w+)[.](\w+)" to="\132.\2"/> <!-- Append "32" -->
<flattenmapper/>
</firstmatchmapper>
</get>
<!-- Windows OpenAL -->
<get src="http://build.lwjgl.org/${build.type}/windows/x64/OpenAL32.dll" dest="${release.native}/OpenAL.dll" verbose="false" usetimestamp="true"/>
<get src="http://build.lwjgl.org/${build.type}/windows/x86/OpenAL32.dll" dest="${release.native}" verbose="false" usetimestamp="true"/>
<!-- Bundle javadoc -->
<mkdir dir="${release.doc}"/>
<zip destfile="${release.doc}/javadoc.zip" basedir="${bin.html.javadoc}" includes="**" level="9"/>
<!-- Copy license files -->
<copy todir="${release.doc}">
<fileset dir="${doc}" includes="LICENSE.txt"/>
<fileset dir="${doc}" includes="3rdparty/**"/>
</copy>
<!-- Bundle source -->
<zip destfile="${release}/src.zip" level="9">
<fileset dir="${src.core}">
<patternset refid="core.main.files"/>
</fileset>
<fileset dir="${src.generated.java}">
<patternset refid="core.generated.files"/>
</fileset>
</zip>
<echo file="${release}/build.txt" if:set="build.revision">LWJGL ${build.version} build ${build.revision}</echo>
</target>
</project>