-
Notifications
You must be signed in to change notification settings - Fork 30
/
build.xml
705 lines (628 loc) · 29.8 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
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
<!--
The Slick2D Build file. It has the following capabilities:
dist - Build the complete distribution
build-key-store - Build a valid key store for distributing your game
sign-a-jar - Sign a JAR file for distribution using a key store generated here
javadoc - generate the javadoc for Slick
-->
<project name="slick" default="dist" basedir="." xmlns:artifact="urn:maven-artifact-ant">
<taskdef name="pack200" classname="com.sun.tools.apache.ant.pack200.Pack200Task" classpath="Pack200Task.jar"/>
<path id="maven-ant-tasks.classpath" path="maven/maven-ant-tasks-2.0.9.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="urn:maven-artifact-ant"
classpathref="maven-ant-tasks.classpath" />
<!--
Initialise the build script
-->
<target name="init">
<property name="username" value="kevin"/>
<property name="host" value="bob.newdawnsoftware.com"/>
<property name="dir" value="/home/kevin/public_html/slick"/>
<!-- Need to add versioning stuff here! -->
<property name="mode" value="demos"/>
<property name="demos" value="/home/kevin/public_html/slick/${mode}"/>
<property name="demoscodebase" value="http:https://slick.cokeandcode.com/${mode}"/>
<property name="build.dir" value="target"/>
<property name="dist" value="dist"/>
<delete dir="${build.dir}"/>
<mkdir dir="${build.dir}/classes"/>
<mkdir dir="${build.dir}/example-classes"/>
<delete dir="${dist}"/>
<mkdir dir="${dist}"/>
<delete dir="webstart"/>
<mkdir dir="webstart"/>
<delete dir="lzma"/>
<mkdir dir="lzma"/>
</target>
<!--
Build the java source to the Slick Library
-->
<target name="build-slick" depends="init">
<propertyfile file="src/version">
<entry key="build" type="int" operation="+" value="1"/>
</propertyfile>
<property file="src/version" prefix="version"/>
<delete dir="lib/slick.jar"/>
<javac includes="org/newdawn/slick/**" debug="true" srcdir="src" destdir="${build.dir}/classes" target="1.4" source="1.4">
<classpath>
<pathelement path="lib/lwjgl.jar"/>
<pathelement path="lib/lwjgl_util_applet.jar"/>
<pathelement path="lib/ibxm.jar"/>
<pathelement path="lib/jnlp.jar"/>
<pathelement path="lib/jogg-0.0.7.jar"/>
<pathelement path="lib/jorbis-0.0.15.jar"/>
</classpath>
</javac>
<jar destfile="lib/slick.jar"
basedir="${build.dir}/classes" includes="org/newdawn/slick/**"/>
<jar update="true" destfile="lib/slick.jar"
basedir="src" includes="org/newdawn/slick/data/*"/>
<jar update="true" destfile="lib/slick.jar"
basedir="src" includes="version"/>
</target>
<target name="build-slick-source" depends="init">
<delete file="lib/slick-sources.jar"/>
<jar destfile="lib/slick-sources.jar"
basedir="src" includes="org/newdawn/slick/**" excludes="org/newdawn/slick/data/*"/>
</target>
<target name="deploy-maven" depends="build-slick, build-slick-source">
<input message="Maven Username" addproperty="maven.username"/>
<input message="Maven Password:" addproperty="maven.password"/>
<copy file="lib/slick.jar" toFile="maven/slick-${version.build}.jar"/>
<copy file="lib/slick-sources.jar" toFile="maven/slick-${version.build}-sources.jar"/>
<copy file="maven/slick.pom.template" toFile="maven/slick-${version.build}.pom">
<filterset>
<filter token="VERSION" value="${version.build}"/>
</filterset>
</copy>
<artifact:install-provider artifactId="wagon-ssh" version="1.0-beta-2"/>
<artifact:deploy file="maven/slick-${version.build}.jar">
<artifact:pom file="maven/slick-${version.build}.pom" id="slick"/>
<artifact:attach file="maven/slick-${version.build}-sources.jar" classifier="sources"/>
<artifact:remoteRepository url="scp:https://bob.newdawnsoftware.com:122/home/kevin/public_html/slick/mavenrepo">
<authentication username="${maven.username}" password="${maven.password}" />
</artifact:remoteRepository>
</artifact:deploy>
</target>
<target name="slick-util" depends="build-slick">
<jar destfile="lib/slick-util.jar">
<fileset dir="${build.dir}/classes">
<include name="org/newdawn/slick/opengl/*.class"/>
<include name="org/newdawn/slick/opengl/renderer/*.class"/>
<include name="org/newdawn/slick/openal/*.class"/>
<include name="org/newdawn/slick/util/ResourceLoader.class"/>
<include name="org/newdawn/slick/util/*Location.class"/>
<include name="org/newdawn/slick/util/Log.class"/>
<include name="org/newdawn/slick/loading/*.class"/>
<include name="org/newdawn/slick/SlickException.class"/>
<include name="org/newdawn/slick/tests/TestUtils.class"/>
<include name="org/newdawn/slick/Font.class"/>
<include name="org/newdawn/slick/Color.class"/>
<include name="org/newdawn/slick/TrueTypeFont*.class"/>
<include name="org/newdawn/slick/util/BufferedImageUtil.class"/>
<include name="org/newdawn/slick/util/LogSystem.class"/>
<include name="org/newdawn/slick/util/DefaultLogSystem.class"/>
</fileset>
</jar>
<zip destfile="lib/slick-util-src.zip">
<fileset dir="src">
<include name="org/newdawn/slick/opengl/*.java"/>
<include name="org/newdawn/slick/opengl/renderer/*.java"/>
<include name="org/newdawn/slick/openal/*.java"/>
<include name="org/newdawn/slick/util/ResourceLoader.java"/>
<include name="org/newdawn/slick/util/*Location.java"/>
<include name="org/newdawn/slick/util/Log.java"/>
<include name="org/newdawn/slick/loading/*.java"/>
<include name="org/newdawn/slick/SlickException.java"/>
<include name="org/newdawn/slick/tests/TestUtils.java"/>
<include name="org/newdawn/slick/Font.java"/>
<include name="org/newdawn/slick/Color.java"/>
<include name="org/newdawn/slick/TrueTypeFont.java"/>
<include name="org/newdawn/slick/util/BufferedImageUtil.java"/>
<include name="org/newdawn/slick/util/LogSystem.class"/>
<include name="org/newdawn/slick/util/DefaultLogSystem.class"/>
</fileset>
</zip>
<zip destfile="${dist}/slick-util.zip">
<fileset dir="." includes="lib/slick-util.jar"/>
<fileset dir="." includes="lib/slick-util-src.zip"/>
<fileset dir="." includes="lib/ibxm.jar"/>
<fileset dir="." includes="lib/jorbis*.jar"/>
<fileset dir="." includes="lib/jogg*.jar"/>
<fileset dir="." includes="lib/lwjgl*.jar"/>
</zip>
<delete dir="javadoc-util"/>
<mkdir dir="javadoc-util"/>
<javadoc sourcepath="src"
defaultexcludes="yes"
destdir="javadoc-util"
author="true"
version="true"
use="true"
windowtitle="Slick Util - LWJGL Utilities extracted from Slick">
<fileset dir="src" defaultexcludes="yes">
<include name="org/newdawn/slick/opengl/*.java"/>
<include name="org/newdawn/slick/opengl/renderer/*.java"/>
<include name="org/newdawn/slick/openal/*.java"/>
<include name="org/newdawn/slick/util/ResourceLoader.java"/>
<include name="org/newdawn/slick/util/*Location.java"/>
<include name="org/newdawn/slick/util/Log.java"/>
<include name="org/newdawn/slick/loading/*.java"/>
<include name="org/newdawn/slick/SlickException.java"/>
<include name="org/newdawn/slick/tests/TestUtils.java"/>
<include name="org/newdawn/slick/tests/TestUtils.java"/>
<include name="org/newdawn/slick/Font.java"/>
<include name="org/newdawn/slick/Color.java"/>
<include name="org/newdawn/slick/TrueTypeFont.java"/>
<include name="org/newdawn/slick/util/BufferedImageUtil.java"/>
</fileset>
<classpath>
<pathelement path="lib/slick.jar"/>
<pathelement path="lib/lwjgl.jar"/>
<pathelement path="lib/ibxm.jar"/>
<pathelement path="lib/jogg-0.0.7.jar"/>
<pathelement path="lib/jorbis-0.0.15.jar"/>
</classpath>
<doctitle><![CDATA[<h1>Slick</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2006 New Dawn Software. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
<!-- build the pedigree tool -->
<target name="build-pedigree" depends="build-slick">
<delete file="lib/pedigree.jar"/>
<javac includes="org/newdawn/slick/tools/peditor/**" debug="true" srcdir="tools" destdir="${build.dir}/classes" target="1.4" source="1.4">
<classpath>
<pathelement path="lib/slick.jar"/>
<pathelement path="lib/lwjgl.jar"/>
</classpath>
</javac>
<jar destfile="lib/pedigree.jar"
basedir="${build.dir}/classes" includes="org/newdawn/slick/tools/peditor/**">
<manifest>
<attribute name="Main-Class" value="org.newdawn.slick.tools.peditor.ParticleEditor"/>
<attribute name="Class-Path" value="slick.jar lwjgl.jar"/>
</manifest>
</jar>
<jar update="true" destfile="lib/pedigree.jar"
basedir="tools" includes="org/newdawn/slick/tools/peditor/data/*"/>
</target>
<!-- build the hiero tool -->
<target name="build-hiero" depends="init">
<delete file="lib/hiero.jar"/>
<javac includes="org/newdawn/slick/tools/hiero/**" debug="true" srcdir="tools" destdir="${build.dir}/classes" target="1.4" source="1.4">
</javac>
<jar destfile="lib/hiero.jar"
basedir="${build.dir}/classes" includes="org/newdawn/slick/tools/hiero/**">
<manifest>
<attribute name="Main-Class" value="org.newdawn.slick.tools.hiero.Hiero"/>
</manifest>
</jar>
<jar update="true" destfile="lib/hiero.jar"
basedir="tools" includes="org/newdawn/slick/tools/hiero/resources/*"/>
<jar update="true" destfile="lib/hiero.jar"
basedir="tools" includes="org/newdawn/slick/tools/hiero/*.jpg"/>
</target>
<!-- build the scalar tool -->
<target name="build-scalar" depends="init">
<delete file="lib/scalar.jar"/>
<javac includes="org/newdawn/slick/tools/scalar/**" debug="true" srcdir="tools" destdir="${build.dir}/classes" target="1.4" source="1.4">
</javac>
<jar destfile="lib/scalar.jar"
basedir="${build.dir}/classes" includes="org/newdawn/slick/tools/scalar/**">
<manifest>
<attribute name="Main-Class" value="org.newdawn.slick.tools.scalar.Scalar"/>
</manifest>
</jar>
</target>
<!-- build the sprite packer tool -->
<target name="build-packer" depends="init">
<delete dir="lib/scalar.jar"/>
<javac includes="org/newdawn/slick/tools/packulike/**" debug="true" srcdir="tools" destdir="${build.dir}/classes" target="1.4" source="1.4">
</javac>
<jar destfile="lib/packulike.jar"
basedir="${build.dir}/classes" includes="org/newdawn/slick/tools/packulike/**">
<manifest>
<attribute name="Main-Class" value="org.newdawn.slick.tools.packulike.Packer"/>
</manifest>
</jar>
</target>
<!-- build the examples -->
<target name="build-examples" depends="init">
<delete dir="lib/slick-examples.jar"/>
<javac includes="org/newdawn/slick/**" debug="true" srcdir="examples" destdir="${build.dir}/example-classes" target="1.4" source="1.4">
<classpath>
<pathelement path="lib/slick.jar"/>
<pathelement path="lib/lwjgl.jar"/>
<pathelement path="lib/lwjgl_util_applet.jar"/>
<pathelement path="lib/ibxm.jar"/>
<pathelement path="lib/jnlp.jar"/>
<pathelement path="lib/jogg-0.0.7.jar"/>
<pathelement path="lib/jorbis-0.0.15.jar"/>
</classpath>
</javac>
<jar destfile="lib/slick-examples.jar"
basedir="${build.dir}/example-classes" includes="org/newdawn/slick/**">
</jar>
</target>
<!--
Generate the javadoc from the Slick sources
-->
<target name="javadoc" depends="init">
<delete dir="javadoc"/>
<mkdir dir="javadoc"/>
<javadoc sourcepath="src"
defaultexcludes="yes"
destdir="javadoc"
author="true"
version="true"
use="true"
windowtitle="Slick - The 2D Library">
<packageset dir="src" defaultexcludes="yes">
<include name="org/newdawn/slick/**/**"/>
</packageset>
<classpath>
<pathelement path="lib/slick.jar"/>
<pathelement path="lib/lwjgl.jar"/>
<pathelement path="lib/jnlp.jar"/>
<pathelement path="lib/lwjgl_util_applet.jar"/>
<pathelement path="lib/ibxm.jar"/>
<pathelement path="lib/jogg-0.0.7.jar"/>
<pathelement path="lib/jorbis-0.0.15.jar"/>
</classpath>
<doctitle><![CDATA[<h1>Slick</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2006 New Dawn Software. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
<!--
Build and package the complete Slick distribution and demo game
-->
<target name="dist-nightly" depends="build-slick, build-examples, javadoc">
<zip destfile="${dist}/slick.zip">
<fileset dir="." includes="javadoc/**"/>
<fileset dir="." includes="src/org/newdawn/slick/**"/>
<fileset dir="." includes="tools/**"/>
<fileset dir="." includes="lib/**"/>
<fileset dir="." includes="testdata/**"/>
<fileset dir="." includes="scripts/**"/>
<fileset dir="." includes="readme.txt"/>
<fileset dir="." includes="build.xml"/>
<fileset dir="." includes="lwjgl.dll"/>
<fileset dir="." includes="OpenAL32.dll"/>
<fileset dir="." includes="jinput-dx8.dll"/>
<fileset dir="." includes="jinput-raw.dll"/>
<fileset dir="." includes="Pack200Task.jar"/>
</zip>
</target>
<target name="dist" depends="build-slick, build-examples, javadoc, build-test-webstarts">
<zip destfile="${dist}/slick.zip">
<fileset dir="." includes="javadoc/**"/>
<fileset dir="." includes="src/org/newdawn/slick/**"/>
<fileset dir="." includes="tools/**"/>
<fileset dir="." includes="lib/**"/>
<fileset dir="." includes="testdata/**"/>
<fileset dir="." includes="scripts/**"/>
<fileset dir="." includes="readme.txt"/>
<fileset dir="." includes="build.xml"/>
<fileset dir="." includes="lwjgl.dll"/>
<fileset dir="." includes="OpenAL32.dll"/>
<fileset dir="." includes="jinput-dx8.dll"/>
<fileset dir="." includes="jinput-raw.dll"/>
<fileset dir="." includes="Pack200Task.jar"/>
</zip>
</target>
<!--
Build pedigree distribution
-->
<target name="dist-pedigree" depends="build-pedigree">
<zip destfile="${dist}/pedigree.zip">
<fileset dir="lib" includes="pedigree.jar"/>
<fileset dir="lib" includes="lwjgl.jar"/>
<fileset dir="lib" includes="slick.jar"/>
<zipfileset src="lib/natives-win32.jar"/>
<zipfileset src="lib/natives-linux.jar"/>
<zipfileset src="lib/natives-mac.jar"/>
<fileset dir="." includes="pedigree-readme.xml"/>
<fileset dir="." includes="testdata/flame.xml"/>
<fileset dir="." includes="testdata/smoke.xml"/>
<fileset dir="." includes="testdata/system.xml"/>
</zip>
</target>
<target name="build-webstart-pedigree" depends="build-pedigree">
<input message="KeyStore Alias, a username:" addproperty="keystore.alias"/>
<input message="KeyStore Password, a password:" addproperty="keystore.password"/>
<copyandsign jar="pedigree"/>
<createdemojnlp name="pedigree" title="Slick2D Pedigree, Whiskas flavoured" mainclass="org.newdawn.slick.tools.peditor.ParticleEditor"/>
</target>
<target name="upload-pedigree" depends="build-webstart-pedigree, dist-pedigree">
<copy todir="${dir}/downloads" file="dist/pedigree.zip"/>
<copy todir="${demos}" file="webstart/pedigree.jar"/>
</target>
<!--
Build hiero distribution
-->
<target name="dist-hiero" depends="build-hiero">
<zip destfile="${dist}/hiero.zip">
<fileset dir="lib" includes="hiero.jar"/>
</zip>
</target>
<target name="build-webstart-hiero" depends="build-hiero">
<input message="KeyStore Alias, a username:" addproperty="keystore.alias"/>
<input message="KeyStore Password, a password:" addproperty="keystore.password"/>
<copyandsign jar="hiero"/>
<createdemojnlp name="hiero" title="Slick2D Hiero Bitmap Font Generator" mainclass="org.newdawn.slick.tools.hiero.Hiero"/>
</target>
<target name="upload-hiero" depends="build-webstart-hiero, dist-hiero">
<copy todir="${dir}/downloads" file="dist/hiero.zip"/>
<copy todir="${demos}" file="webstart/hiero.jar"/>
</target>
<!--
Build scalar distribution
-->
<target name="dist-scalar" depends="build-scalar">
<zip destfile="${dist}/scalar.zip">
<fileset dir="lib" includes="scalar.jar"/>
</zip>
</target>
<target name="build-webstart-scalar" depends="build-scalar">
<input message="KeyStore Alias, a username:" addproperty="keystore.alias"/>
<input message="KeyStore Password, a password:" addproperty="keystore.password"/>
<copyandsign jar="scalar"/>
<createdemojnlp name="scalar" title="Slick2D Scalar Scale2/3X Tool" mainclass="org.newdawn.slick.tools.scalar.Scalar"/>
</target>
<target name="upload-scalar" depends="build-webstart-scalar, dist-scalar">
<copy todir="${dir}/downloads" file="dist/scalar.zip"/>
<copy todir="${demos}" file="webstart/scalar.jar"/>
</target>
<!--
Build packer distribution
-->
<target name="dist-packer" depends="build-packer">
<zip destfile="${dist}/packulike.zip">
<fileset dir="lib" includes="packulike.jar"/>
</zip>
</target>
<target name="build-webstart-packer" depends="build-packer">
<input message="KeyStore Alias, a username:" addproperty="keystore.alias"/>
<input message="KeyStore Password, a password:" addproperty="keystore.password"/>
<copyandsign jar="packulike"/>
<createdemojnlp name="packer" title="Slick2D Sprite Packer" mainclass="org.newdawn.slick.tools.packulike.Packer"/>
</target>
<target name="upload-packer" depends="build-webstart-packer, dist-packer">
<copy todir="${dir}/downloads" file="dist/packulike.zip"/>
<copy todir="${demos}" file="webstart/packulike.jar"/>
</target>
<!--
Create a keystore to use when signing your own games
-->
<target name="build-key-store">
<input message="KeyStore Alias, a username:" addproperty="keystore.alias"/>
<input message="KeyStore Password, a password:" addproperty="keystore.password"/>
<input message="KeyStore Name, your name:" addproperty="keystore.name"/>
<input message="KeyStore Company, your development group or company:" addproperty="keystore.company"/>
<genkey keystore="${keystore.alias}.ks" alias="${keystore.alias}" storepass="${keystore.password}" >
<dname>
<param name="CN" value="${keystore.name}"/>
<param name="OU" value="${keystore.company}"/>
<param name="O" value=""/>
<param name="C" value=""/>
</dname>
</genkey>
</target>
<!--
Package and sign the libraries require for a webstart distribution of Slick
-->
<target name="build-webstart-libs" depends="build-slick, build-examples">
<input message="KeyStore Alias, a username:" addproperty="keystore.alias"/>
<input message="KeyStore Password, a password:" addproperty="keystore.password"/>
<copyandsign jar="ibxm"/>
<copyandsign jar="lwjgl"/>
<copyandsign jar="jogg-0.0.7"/>
<copyandsign jar="jinput"/>
<copyandsign jar="jorbis-0.0.15"/>
<copyandsignres jar="natives-linux"/>
<copyandsignres jar="natives-win32"/>
<copyandsignres jar="natives-mac"/>
<copyandsign jar="slick"/>
<copy file="webstart/slick.jar" toFile="webstart/slick-b${version.build}.jar"/>
<copyandsign jar="slick-examples"/>
</target>
<!--
Sign a single jar - useful for your game specific jars
-->
<target name="sign-a-jar">
<input message="KeyStore Alias, a username:" addproperty="keystore.alias"/>
<input message="KeyStore Password, a password:" addproperty="keystore.password"/>
<input message="Jar Location" addproperty="jar"/>
<signjar jar="${jar}" keystore="${keystore.alias}.ks" storepass="${keystore.password}" alias="${keystore.alias}"/>
</target>
<!--
Generate and package the JNLP and HTML files for the Slick webstart demos
-->
<target name="build-test-webstarts" depends="build-webstart-libs">
<input message="KeyStore Alias, a username:" addproperty="keystore.alias"/>
<input message="KeyStore Password, a password:" addproperty="keystore.password"/>
<jar destfile="webstart/testdata.jar"
basedir="." includes="testdata/**"/>
<signjar jar="webstart/testdata.jar" keystore="${keystore.alias}.ks" storepass="${keystore.password}" alias="${keystore.alias}"/>
<echo file="webstart/demos.txt">VERSION|0.4.8|SUBJECT|Webstart Demos|CONTENT|[html]</echo>
<createdemojnlp name="imagetest" title="Slick2D Image Test" mainclass="org.newdawn.slick.tests.ImageTest"/>
<createdemojnlp name="fonttest" title="Slick2D Font Test" mainclass="org.newdawn.slick.tests.FontTest"/>
<createdemojnlp name="inputtest" title="Slick2D Input Test" mainclass="org.newdawn.slick.tests.InputTest"/>
<createdemojnlp name="soundtest" title="Slick2D Sound Test" mainclass="org.newdawn.slick.tests.SoundTest"/>
<createdemojnlp name="animationtest" title="Slick2D Animation Test" mainclass="org.newdawn.slick.tests.AnimationTest"/>
<createdemojnlp name="graphicstest" title="Slick2D Graphics Test" mainclass="org.newdawn.slick.tests.GraphicsTest"/>
<createdemojnlp name="geomtest" title="Slick2D Geom Test" mainclass="org.newdawn.slick.tests.GeomTest"/>
<createdemojnlp name="tilemaptest" title="Slick2D TileMap Test" mainclass="org.newdawn.slick.tests.TileMapTest"/>
<createdemojnlp name="particletest" title="Slick2D Particle Test" mainclass="org.newdawn.slick.tests.ParticleTest"/>
<createdemojnlp name="duplicateemittertest" title="Slick2D Duplicate Emitter Test" mainclass="org.newdawn.slick.tests.DuplicateEmitterTest"/>
<createdemojnlp name="transformtest" title="Slick2D Transform Test" mainclass="org.newdawn.slick.tests.TransformTest"/>
<createdemojnlp name="statebasedtest" title="Slick2D StateBasedGame Test" mainclass="org.newdawn.slick.tests.StateBasedTest"/>
<createdemojnlp name="guitest" title="Slick2D GUI Test" mainclass="org.newdawn.slick.tests.GUITest"/>
<createdemojnlp name="packedtest" title="Slick2D Packed Sprite Sheet Test" mainclass="org.newdawn.slick.tests.PackedSheetTest"/>
<createdemojnlp name="storedstatetest" title="Slick2D Stored State Test" mainclass="org.newdawn.slick.tests.SavedStateTest"/>
<createdemojnlp name="pedigreetest" title="Slick2D Pedigree Test" mainclass="org.newdawn.slick.tests.PedigreeTest"/>
<createdemojnlp name="flashtest" title="Slick2D Flash Test" mainclass="org.newdawn.slick.tests.FlashTest"/>
<createdemojnlp name="deferredtest" title="Slick2D Deferred Test" mainclass="org.newdawn.slick.tests.DeferredLoadingTest"/>
<createdemojnlp name="spritesheetfonttest" title="Slick2D Sprite Sheet Font Test" mainclass="org.newdawn.slick.tests.SpriteSheetFontTest"/>
<createdemojnlp name="transparentcolortest" title="Slick2D Transparent Color Test" mainclass="org.newdawn.slick.tests.TransparentColorTest"/>
<createdemojnlp name="polygontest" title="Slick2D Polygon Point Test" mainclass="org.newdawn.slick.tests.PolygonTest"/>
<createdemojnlp name="purefonttest" title="Slick2D Pure Font Test" mainclass="org.newdawn.slick.tests.PureFontTest"/>
<createdemojnlp name="canvastest" title="Slick2D Canvas Container Test" mainclass="org.newdawn.slick.tests.CanvasContainerTest"/>
<createdemojnlp name="antialiastest" title="Slick2D Anti-Alias Test" mainclass="org.newdawn.slick.tests.AntiAliasTest"/>
<createdemojnlp name="offscreen" title="Slick2D Offscreen Rendering Test" mainclass="org.newdawn.slick.tests.ImageGraphicsTest"/>
<createdemojnlp name="clip" title="Slick2D Clipping Test" mainclass="org.newdawn.slick.tests.ClipTest"/>
<createdemojnlp name="imagereadtest" title="Slick2D Image Read Test" mainclass="org.newdawn.slick.tests.ImageReadTest"/>
<createdemojnlp name="bigimagetest" title="Slick2D Big Image Test" mainclass="org.newdawn.slick.tests.BigImageTest"/>
<createdemojnlp name="slickcallable" title="Slick2D Callables" mainclass="org.newdawn.slick.tests.SlickCallableTest"/>
<createdemojnlp name="keyrepeat" title="Slick2D Key Repeat" mainclass="org.newdawn.slick.tests.KeyRepeatTest"/>
<createdemojnlp name="musiclistener" title="Slick2D Music Listener" mainclass="org.newdawn.slick.tests.MusicListenerTest"/>
<createdemojnlp name="gradient" title="Slick2D Gradients" mainclass="org.newdawn.slick.tests.GradientTest"/>
<createdemojnlp name="transition" title="Slick2D Transitions" mainclass="org.newdawn.slick.tests.TransitionTest"/>
<!-- Examples under here please -->
<createdemojnlp template="slickexample.jnlp" name="scroller" title="Slick2D TileMap Scroll Example" mainclass="org.newdawn.slick.examples.scroller.Scroller"/>
<echo file="webstart/demos.txt" append="true">[/html]|DATE|1162965600</echo>
</target>
<!--
Upload the distrubtion ZIPs
-->
<target name="upload-dist" depends="dist, slick-util">
<copy todir="${dir}/downloads" file="dist/slick.zip"/>
<copy todir="${dir}/downloads/util" file="dist/slick-util.zip"/>
<copy todir="${dir}/downloads" file="lib/slick.jar"/>
<copy todir="${dir}/downloads/util" file="lib/slick-util.jar"/>
<copy todir="${dir}/downloads" file="src/version"/>
</target>
<!--
Upload the test webstarts to the Slick website
-->
<target name="upload-test-webstarts" depends="dist">
<copy todir="${demos}" file="webstart/slick.jar"/>
<copy todir="${demos}/versions" file="webstart/slick-b${version.build}.jar"/>
<copy todir="${demos}" file="webstart/slick-examples.jar"/>
<copy todir="${demos}" file="webstart/testdata.jar"/>
<copy todir="${demos}">
<fileset dir="webstart">
<include name="*.jnlp"/>
</fileset>
</copy>
<copy todir="${dir}/content/static" file="webstart/demos.txt"/>
</target>
<!--
Upload the javadoc
-->
<target name="upload-javadoc" depends="dist">
<copy todir="${dir}/javadoc">
<fileset dir="javadoc" includes="**/*"/>
</copy>
<copy todir="${dir}/javadoc-util">
<fileset dir="javadoc-util" includes="**/*"/>
</copy>
</target>
<!--
Upload everything, i.e. create a complete update to the Slick stuff.
-->
<target name="upload-all" depends="deploy-maven, upload-dist, upload-test-webstarts, upload-javadoc, upload-pedigree, upload-hiero, upload-scalar, upload-packer">
</target>
<!--
A macro to copy and sign a library for webstart distribution
-->
<macrodef name="copyandsign">
<attribute name="jar" default="NOT SET"/>
<sequential>
<copy file="lib/@{jar}.jar" toDir="webstart"/>
<signjar jar="webstart/@{jar}.jar" keystore="${keystore.alias}.ks" storepass="${keystore.password}" alias="${keystore.alias}"/>
<copy file="lib/@{jar}.jar" toDir="lzma"/>
<antcall target="compress-sign-class">
<param name="dir" value="lzma/"/>
<param name="jarfile" value="@{jar}"/>
</antcall>
</sequential>
</macrodef>
<macrodef name="copyandsignres">
<attribute name="jar" default="NOT SET"/>
<sequential>
<copy file="lib/@{jar}.jar" toDir="webstart"/>
<signjar jar="webstart/@{jar}.jar" keystore="${keystore.alias}.ks" storepass="${keystore.password}" alias="${keystore.alias}"/>
<copy file="lib/@{jar}.jar" toDir="lzma"/>
<signjar jar="lzma/@{jar}.jar" keystore="${keystore.alias}.ks" storepass="${keystore.password}" alias="${keystore.alias}"/>
<antcall target="compress-resource">
<param name="input" value="lzma/@{jar}.jar"/>
<param name="output" value="lzma/@{jar}.jar.lzma"/>
</antcall>
</sequential>
</macrodef>
<!--
A macro to copy and preprocess the JNLP template for all webstart demos
-->
<macrodef name="createdemojnlp">
<attribute name="name" default="NOT SET"/>
<attribute name="title" default="NOT SET"/>
<attribute name="mainclass" default="NOT SET"/>
<attribute name="template" default="slickdemo.jnlp"/>
<attribute name="datajar" default="testdata.jar"/>
<attribute name="projectjar" default=""/>
<sequential>
<delete file="webstart/@{name}.jnlp"/>
<copy file="scripts/@{template}" toFile="webstart/@{name}.jnlp">
<filterchain>
<replacetokens>
<token key="title" value="@{title}"/>
<token key="mainclass" value="@{mainclass}"/>
<token key="jnlpname" value="@{name}.jnlp"/>
<token key="homepage" value="http:https://slick.cokeandcode.com"/>
<token key="datajar" value="@{datajar}"/>
<token key="projectjar" value="@{projectjar}"/>
<token key="vendor" value="Slick 2D"/>
<token key="codebase" value="${demoscodebase}"/>
</replacetokens>
</filterchain>
</copy>
<echo file="webstart/demos.txt" append="true">
<a href="http:https://slick.cokeandcode.com/demos/@{name}.jnlp"> @{title} </a>
<br/>
</echo>
</sequential>
</macrodef>
<target name="repack200" description="Pack200-repack a jar file">
<pack200 src="${input}" destfile="${output}" repack="true"/>
</target>
<target name="pack200" description="Pack200 a jar file">
<pack200 src="${input}" destfile="${output}"/>
</target>
<target name="lzma" description="LZMA compress a file">
<java fork="true" classname="SevenZip.LzmaAlone">
<classpath>
<pathelement location="JLzma.jar"/>
</classpath>
<jvmarg value="-Xmx512m"/>
<arg value="e"/>
<arg value="${input}"/>
<arg value="${output}"/>
</java>
</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" keystore="${keystore.alias}.ks" storepass="${keystore.password}" alias="${keystore.alias}"/>
<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>
<delete file="${input}"/>
</target>
</project>