-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
683 lines (647 loc) · 24.3 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Limegreen" default="build" basedir=".">
<property name="props" value="build.properties"/>
<property name="secret" value="secret.properties"/>
<property name="secret.example" value="secret.example.properties"/>
<property name="secret.temp" value="secret.temp.properties"/>
<property file="${props}"/>
<property file="${secret}"/>
<property name="name" value="${application.name}"/>
<!-- Preexisitng Directories -->
<property name="src" location="src"/>
<property name="lib" location="lib"/>
<property name="tools" location="tools"/>
<property name="antlib" location="${tools}/antlib"/>
<property name="manifest" location="${tools}/manifest"/>
<property name="main.manifest" value="main-MANIFEST.MF"/>
<property name="include.manifest" value="include-MANIFEST.MF"/>
<property name="onejar.manifest" value="onejar-MANIFEST.MF"/>
<property name="onejar" location="${tools}/onejar"/>
<property name="autoupdate" location="${tools}/autoupdate"/>
<property name="atomfile" value="${name}.xml"/>
<property name="atompath" location="${atomfile}"/>
<property name="jarbundler" location="${tools}/jarbundler"/>
<property name="jsmooth" location="${tools}/jsmooth"/>
<property name="jsmooth.edit" location="${jsmooth}/editor"/>
<property name="jsmooth.infile" location="${jsmooth}/ant.jsmooth"/>
<property name="applejava" location="${tools}/applejava"/>
<property name="github" location="${tools}/github"/>
<property name="s3upload" location="${tools}/s3upload"/>
<!-- Output Directories -->
<property name="build" location="build"/>
<property name="misc" location="${build}/misc"/>
<property name="bin" location="${build}/bin"/>
<property name="dist" location="${build}/dist"/>
<property name="jarfile" location="${dist}/${name}.jar"/>
<property name="jarfile.temp" location="${misc}/${name}.jar"/>
<property name="appfile" location="${dist}/${name}.app"/>
<property name="exefile" location="${dist}/${name}.exe"/>
<property name="jsmooth.outfile" location="${dist}/${name}.jsmooth"/>
<property name="jar" location="${build}/jar"/>
<property name="jar.main" location="${jar}/main"/>
<property name="jar.lib" location="${jar}/lib"/>
<property name="jarfile.main" location="${jar.main}/main.jar"/>
<property name="app" location="${build}/app"/>
<property name="new.stub" location="${app}/${name}"/>
<property name="exe" location="${build}/exe"/>
<available file="${secret}" property="secret.present"/>
<condition property="copy.do">
<isfalse value="${secret.present}"/>
</condition>
<condition property="copy.dont">
<istrue value="${secret.present}"/>
</condition>
<!-- Ant tasks -->
<taskdef classname="com.jameslow.update.Generator" classpath="${autoupdate}" name="autoupdate"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${tools}/antcontrib/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<fileset id="jar.jars" dir="${jarbundler}">
<include name="**/*.jar"/>
</fileset>
<path id="jar.path">
<fileset refid="jar.jars"/>
</path>
<taskdef name="jarbundler" classname="net.sourceforge.jarbundler.JarBundler" classpathref="jar.path"/>
<fileset id="jsmooth.jars" dir="${jsmooth}">
<include name="**/*.jar"/>
</fileset>
<path id="jsmooth.path">
<fileset refid="jsmooth.jars"/>
</path>
<taskdef name="jsmoothgen" classname="net.charabia.jsmoothgen.ant.JSmoothGen" classpathref="jsmooth.path"/>
<fileset id="ant.jars" dir="${antlib}">
<include name="**/*.jar"/>
</fileset>
<path id="ant.path">
<fileset refid="ant.jars"/>
</path>
<taskdef name="ftp" classname="org.apache.tools.ant.taskdefs.optional.net.FTP" classpathref="ant.path"/>
<fileset id="github-anttasks.jars" dir="${github}/lib">
<include name="**/*.jar"/>
</fileset>
<path id="github-anttasks.classpath">
<fileset refid="github-anttasks.jars"/>
<pathelement location="."/>
<fileset dir="${github}">
<include name="**/*.jar"/>
</fileset>
</path>
<taskdef name="github.createrelease" classname="com.github.api.CreateRelease" classpathref="github-anttasks.classpath" loaderref="github-anttasks.classpath.loader" />
<taskdef name="github.uploadasset" classname="com.github.api.UploadAsset" classpathref="github-anttasks.classpath" loaderref="github-anttasks.classpath.loader" />
<taskdef name="github.fullrelease" classname="com.github.api.FullRelease" classpathref="github-anttasks.classpath" loaderref="github-anttasks.classpath.loader" />
<fileset id="aws.jars" dir="${s3upload}">
<include name="**/*.jar"/>
</fileset>
<path id="aws.path">
<fileset refid="aws.jars"/>
</path>
<taskdef name="s3upload" classname="dak.ant.taskdefs.S3Upload" classpathref="aws.path"/>
<fileset id="antlib.jars" dir="${antlib}">
<include name="**/*.jar"/>
</fileset>
<path id="antlib.id">
<fileset refid="antlib.jars"/>
</path>
<pathconvert property="antlib.classpath" pathsep=";">
<path refid="antlib.id"/>
</pathconvert>
<!-- <taskdef classname="org.apache.tools.ant.taskdefs.optional.ssh.Scp" classpath="${antlib.classpath}" name="scp"/> -->
<taskdef classname="com.jameslow.Substring" classpath="${antlib}" name="substring"/>
<!-- How to build main jar -->
<condition property="onejar.do">
<istrue value="${onejar.use}"/>
</condition>
<condition property="include.do">
<isfalse value="${onejar.use}"/>
</condition>
<condition property="version.do">
<istrue value="${build.doversion}"/>
</condition>
<condition property="version.default">
<isfalse value="${build.doversion}"/>
</condition>
<condition property="mainclass" value="com.simontuffs.onejar.Boot">
<istrue value="${onejar.use}"/>
</condition>
<condition property="mainclass" value="${main.class}">
<isfalse value="${onejar.use}"/>
</condition>
<!-- Which uploads to do -->
<condition property="upload.s3">
<matches string="${aws.s3}" pattern=".+"/>
</condition>
<condition property="upload.ftp">
<matches string="${ftp.server}" pattern=".+"/>
</condition>
<condition property="upload.github">
<matches string="${github.repo}" pattern=".+"/>
</condition>
<condition property="upload.sourceforge">
<matches string="${sourceforge.project}" pattern=".+"/>
</condition>
<!-- Do auto update -->
<condition property="autoupdate.do">
<istrue value="${autoupdate.enable}"/>
</condition>
<!-- Which auto update takes priority for xml file -->
<condition property="autoupdate.s3">
<and>
<isset property="autoupdate.do"/>
<isset property="upload.s3"/>
</and>
</condition>
<condition property="autoupdate.ftp">
<and>
<isset property="autoupdate.do"/>
<isset property="upload.ftp"/>
<not><isset property="autoupdate.s3"/></not>
</and>
</condition>
<condition property="autoupdate.github">
<and>
<isset property="autoupdate.do"/>
<isset property="upload.github"/>
<not><isset property="autoupdate.ftp"/></not>
</and>
</condition>
<condition property="autoupdate.sourceforge">
<and>
<isset property="autoupdate.do"/>
<isset property="upload.sourceforge"/>
<not><isset property="autoupdate.github"/></not>
</and>
</condition>
<!-- Other auto update -->
<condition property="autoupdate.dosource">
<istrue value="${autoupdate.uploadsource}"/>
</condition>
<condition property="autoupdate.upload">
<and>
<contains string="${autoupdate.type}" substring="upload"/>
<or>
<isset property="autoupdate.s3"/>
<isset property="autoupdate.ftp"/>
</or>
</and>
</condition>
<condition property="autoupdate.source">
<and>
<contains string="${autoupdate.type}" substring="source"/>
<or>
<isset property="autoupdate.github"/>
</or>
</and>
</condition>
<!-- Auto update paths -->
<condition property="apppage" value="${autoupdate.apppage}">
<matches string="${autoupdate.apppage}" pattern=".+"/>
</condition>
<condition property="apppage" value="https://github.com/${github.repouser}/${github.repo}/">
<and>
<not><isset property="apppage"/></not>
<isset property="autoupdate.github"/>
</and>
</condition>
<condition property="apppage" value="https://sourceforge.net/projects/${sourceforge.project}/">
<and>
<not><isset property="apppage"/></not>
<isset property="autoupdate.sourceforge"/>
</and>
</condition>
<propertyfile file="${props}">
<entry key="autoupdate.apppage" value="${apppage}"/>
</propertyfile>
<!-- Release paths -->
<condition property="releaselink" value="${autoupdate.releaselink}">
<matches string="${autoupdate.releaselink}" pattern=".+"/>
</condition>
<condition property="releaselink" value="https://github.com/${github.repouser}/${github.repo}/releases/tag/%version%/">
<and>
<not><isset property="releaselink"/></not>
<isset property="autoupdate.github"/>
</and>
</condition>
<condition property="releaselink" value="${apppage}?version=%version%">
<and>
<not><isset property="releaselink"/></not>
</and>
</condition>
<propertyfile file="${props}">
<entry key="autoupdate.releaselink" value="${releaselink}"/>
</propertyfile>
<!-- Download paths -->
<condition property="applinkbase" value="${autoupdate.applinkbase}">
<matches string="${autoupdate.applinkbase}" pattern=".+"/>
</condition>
<condition property="applinkbase" value="http://s3.amazonaws.com/${aws.s3}">
<!-- This can be overridden to use your own domain name by hard coding autoupdate.applinkbase in the build.properties file -->
<and>
<not><isset property="applinkbase"/></not>
<isset property="autoupdate.s3"/>
</and>
</condition>
<condition property="applinkbase" value="https://github.com/${github.repouser}/${github.repo}/releases/download/%version%/">
<and>
<not><isset property="applinkbase"/></not>
<isset property="autoupdate.github"/>
</and>
</condition>
<propertyfile file="${props}">
<entry key="autoupdate.applinkbase" value="${applinkbase}"/>
</propertyfile>
<!-- Auto update xml paths -->
<condition property="xmllinkbase" value="${autoupdate.xmllinkbase}">
<matches string="${autoupdate.xmllinkbase}" pattern=".+"/>
</condition>
<condition property="xmllinkbase" value="${autoupdate.applinkbase}">
<and>
<not><isset property="xmllinkbase"/></not>
<isset property="autoupdate.upload"/>
</and>
</condition>
<condition property="xmllinkbase" value="https://raw.githubusercontent.com/${github.repouser}/${github.repo}/master/">
<and>
<not><isset property="xmllinkbase"/></not>
<isset property="autoupdate.source"/>
<isset property="autoupdate.github"/>
</and>
</condition>
<propertyfile file="${props}">
<entry key="autoupdate.xmllinkbase" value="${xmllinkbase}"/>
</propertyfile>
<!-- Platform detection -->
<condition property="is.mac">
<os family="mac"/>
</condition>
<condition property="not.mac">
<not><isset property="is.mac"/></not>
</condition>
<condition property="is.windows">
<os family="windows"/>
</condition>
<condition property="is.unix">
<and>
<os family="unix"/>
<isset property="not.mac"/>
</and>
</condition>
<condition property="is.other">
<and>
<not><isset property="is.mac"/></not>
<not><isset property="is.unix"/></not>
<not><isset property="is.windows"/></not>
</and>
</condition>
<fileset id="lib.jars" dir="${lib}">
<include name="**/*.jar"/>
</fileset>
<path id="lib.path">
<fileset refid="lib.jars"/>
<pathelement path="${applejava}/AppleJavaExtensions.jar"/>
<pathelement path="${jsmooth}/jnismooth.jar"/>
</path>
<target name="sort.props" description="Sort properties file after ant messes with the order">
<move tofile="temp.properties" file="${props}">
<filterchain>
<sortfilter/>
</filterchain>
</move>
<move tofile="${props}" file="temp.properties"/>
</target>
<target name="secret.copy" description="Copy secret file if it doesn't exist" if="copy.do">
<copy file="${secret.example}" tofile="${secret}" overwrite="false"/>
</target>
<target name="secret" depends="secret.copy" description="Source the secret file">
<property file="${secret}"/>
</target>
<target name="compile.onejar" description="Compile onejar">
<javac srcdir="${onejar}" destdir="${onejar}"
source="1.4" target="1.4"
failonerror="true"
includes="**/*.java">
</javac>
</target>
<target name="compile.autoupdate" description="Compile autoupdate">
<javac srcdir="${autoupdate}" destdir="${autoupdate}"
source="1.4" target="1.4"
failonerror="true"
includes="**/*.java">
</javac>
</target>
<target name="compile.utils" description="Compile additional ant utils">
<javac srcdir="${antlib}" destdir="${antlib}"
source="1.4" target="1.4"
failonerror="true"
includes="**/*.java">
</javac>
</target>
<target name="prepare" depends="secret" description="Create build dirs">
<mkdir dir="${build}"/>
<mkdir dir="${bin}"/>
<mkdir dir="${dist}"/>
<mkdir dir="${jar}"/>
<mkdir dir="${jar.main}"/>
<mkdir dir="${jar.lib}"/>
<mkdir dir="${app}"/>
<mkdir dir="${exe}"/>
<mkdir dir="${misc}"/>
</target>
<target name="version.input" depends="prepare" if="version.do">
<input
message="Please input a new version. Current version ${build.version}"
addproperty="new.version"
/>
<propertyfile file="${props}">
<entry key="build.version" value="${new.version}"/>
</propertyfile>
<condition property="version.default">
<equals arg1="${new.doversion}" arg2=""/>
</condition>
</target>
<target name="version.default">
<property name="new.version" value="${build.version}"/>
</target>
<target name="version" depends="version.input" description="Prompt user to enter new version">
<!-- At the moment version requires nothing else -->
</target>
<target name="create.jsmooth" depends="prepare" description="Create JSmooth config file">
<copy file="${application.win.icon}" todir="${dist}"/>
<copy file="${jsmooth.infile}" tofile="${jsmooth.outfile}"/>
<replace file="${jsmooth.outfile}" token="@icofile@" value="${application.win.icon}"/>
<replace file="${jsmooth.outfile}" token="@exefile@" value="${name}.exe"/>
<replace file="${jsmooth.outfile}" token="@jarfile@" value="${name}.jar"/>
<replace file="${jsmooth.outfile}" token="@mainclass@" value="${mainclass}"/>
<replace file="${jsmooth.outfile}" token="@exewrapper@" value="${build.exewrapper}"/>
<replace file="${jsmooth.outfile}" token="@javaminversion@" value="${build.jvm}"/>
<replace file="${jsmooth.outfile}" token="@initheapmemory@" value="${jsmooth.initheap}"/>
<replace file="${jsmooth.outfile}" token="@maxheapmemory@" value="${jsmooth.maxheap}"/>
</target>
<target name="compile" depends="prepare,version.default" description="Compile code">
<javac srcdir="${src}" destdir="${bin}"
source="${build.jvm}" target="${build.jvm}"
failonerror="true"
includes="**/*.*"
classpathref="lib.path">
</javac>
<propertyfile file="${props}">
<entry key="build.date" type="date" value="now"/>
</propertyfile>
<buildnumber file="${props}"/>
<copy todir="${bin}">
<fileset dir="${src}">
<exclude name="**/*.java"/>
</fileset>
</copy>
<copy file="${props}" todir="${bin}"/>
<copy file="${manifest}/${main.manifest}" todir="${misc}"/>
<copy file="${manifest}/${include.manifest}" todir="${misc}"/>
<copy file="${manifest}/${onejar.manifest}" todir="${misc}"/>
<manifest file="${misc}/${main.manifest}">
<attribute name="Manifest-Version" value="1.0"/>
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</target>
<target name="jar.onejar" depends="compile" if="onejar.do">
<echo message="Placing library jars witin main jar, onejar.use=${onejar.use}."/>
<copy todir="${jar.lib}">
<fileset dir="${lib}"/>
</copy>
<!--
<manifestclasspath property="jar.classpath" jarfile="${jarfile.main}">
<classpath refid="lib.path"/>
</manifestclasspath>
<attribute name="Class-Path" value="${jar.classpath}" />
-->
<jar jarfile="${jarfile.main}" basedir="${bin}" manifest="${misc}/${main.manifest}">
</jar>
<jar jarfile="${jarfile}" manifest="${misc}/${onejar.manifest}">
<fileset dir="${jar}"/>
<fileset dir="${onejar}" includes="**/*.class"/>
</jar>
</target>
<target name="jar.include" depends="compile" if="include.do">
<echo message="Extracting and including library jars in main jar, onejar.use=${onejar.use}."/>
<jar jarfile="${jarfile.temp}" basedir="${bin}" manifest="${misc}/${main.manifest}">
<!-- Merge library jars into final jar file -->
<zipgroupfileset refid="lib.jars"/>
</jar>
<!-- remove possible signature files from library jars https://issues.apache.org/bugzilla/show_bug.cgi?id=34403 -->
<zip destfile="${jarfile}">
<zipfileset src="${jarfile.temp}" excludes="META-INF/*.RSA, META-INF/*.DSA, META-INF/*.SF" />
</zip>
</target>
<target name="jar" depends="jar.onejar,jar.include,sort.props" description="Build jar">
<!-- At the moment jar requires nothing else -->
</target>
<target name="exe" depends="jar,create.jsmooth" description="Build exe">
<jsmoothgen project="${jsmooth.outfile}" skeletonroot="${jsmooth}/skeletons"/>
</target>
<target name="exe.run" depends="exe" if="is.windows">
<exec dir="${dist}" executable="${dist}/${name}.exe"/>
</target>
<target name="app.other" depends="jar" if="not.mac">
<copy file="${jarbundler}/JavaApplicationStub" tofile="${new.stub}"/>
</target>
<target name="app" depends="app.other" description="Build app">
<jarbundler
name="${name}"
shortname="${name}"
icon="${application.osx.icon}"
jvmversion="${build.jvm}+"
build="${build.number}"
version="${new.version}"
dir="${dist}"
mainclass="${mainclass}"
jar="${jarfile}"
stubfile="${new.stub}"/>
</target>
<target name="app.run" depends="app" if="is.mac">
<exec dir="${dist}" executable="open">
<arg line="-a ${name}.app"/>
</exec>
</target>
<target name="mac.zip.mac" depends="version,app" description="Make mac zip on osx" if="is.mac">
<property name="mac.zip" value="${name}-mac-${new.version}.zip"/>
<property name="mac.zip.full" location="${dist}/${mac.zip}"/>
<zip destfile="${mac.zip.full}"
basedir="${dist}"
includes="${name}.app/**" />
</target>
<target name="mac.zip.other" depends="version,app" description="Make mac zip windows/unix/other" if="not.mac">
<property name="mac.zip" value="${name}-mac-${new.version}.zip"/>
<property name="mac.zip.full" location="${dist}/${mac.zip}"/>
<zip destfile="${mac.zip.full}"
basedir="${dist}"
includes="${name}.app/**">
<zipfileset dir="${dist}/${name}.app/Contents/MacOS" filemode="755" prefix="${name}.app/Contents/MacOS">
<include name="${name}"/>
</zipfileset>
</zip>
</target>
<target name="mac.zip" depends="mac.zip.mac,mac.zip.other" description="Make mac zip">
</target>
<target name="notdmg" description="Set distribution if not using dmg" if="not.mac">
<property name="mac.dmg" value="${mac.zip}"/>
<property name="mac.dmg.full" location="${mac.zip.full}"/>
<property name="mac.sf.type" value="binary_zip"/>
</target>
<target name="dmg" depends="mac.zip" description="Make dmg" if="is.mac">
<property name="mac.dmg" value="${name}-${new.version}.dmg"/>
<property name="mac.dmg.full" location="${dist}/${mac.dmg}"/>
<property name="mac.sf.type" value="dmg"/>
<!-- Requires OSX -->
<exec dir="${dist}" executable="hdiutil">
<arg line="create -ov -srcfolder ${name}.app ${mac.dmg}"/>
</exec>
</target>
<target name="win.zip" depends="version,exe" description="Make windows zip">
<property name="win.zip" value="${name}-win-${new.version}.zip"/>
<property name="win.zip.full" location="${dist}/${win.zip}"/>
<zip destfile="${win.zip.full}"
basedir="${dist}"
includes="${name}.exe" />
</target>
<target name="other.zip" depends="version,jar" description="Make other zip">
<property name="other.zip" value="${name}-other-${new.version}.zip"/>
<property name="other.zip.full" location="${dist}/${other.zip}"/>
<zip destfile="${other.zip.full}"
basedir="${dist}"
includes="${name}.jar" />
</target>
<target name="source.zip" depends="version,jar" description="Make source zip">
<property name="source.zip" value="${name}-source-${new.version}.zip"/>
<property name="source.zip.full" location="${dist}/${source.zip}"/>
<move file="${secret}" tofile="${secret.temp}"/>
<copy file="${secret.example}" tofile="${secret}"/>
<zip destfile="${source.zip.full}">
<fileset dir=".">
<include name="**"/>
<exclude name="**/.svn/**"/>
<exclude name="**/build/**"/>
<exclude name="${secret.temp}"/>
</fileset>
</zip>
<delete file="${secret}"/>
<move file="${secret.temp}" tofile="${secret}"/>
</target>
<target name="run" depends="jar" description="Run jar file">
<java jar="${jarfile}" fork="yes" failonerror="true"/>
</target>
<target name="build" description="Build exe,app" depends="exe,app,sort.props">
<!-- At the moment build requires nothing else -->
</target>
<target name="release" description="Create release dmg/zips" depends="dmg,win.zip,other.zip,source.zip,sort.props">
<!-- At the moment release requires nothing else -->
</target>
<target name="autoupdate" description="Create autoupdate entry" if="autoupdate.do" depends="release">
<condition property="autoupdate.source.zip.full" value="${source.zip.full}">
<isset property="autoupdate.dosource"/>
</condition>
<autoupdate
atompath="${atompath}"
apppage="${apppage}"
appname="${application.name}"
applinkbase="${applinkbase}"
xmllinkbase="${xmllinkbase}"
releaselink="${releaselink}"
macdmg="${mac.dmg.full}"
maczip="${mac.zip.full}"
winzip="${win.zip.full}"
otherzip="${other.zip.full}"
sourcezip="${autoupdate.source.zip.full}"
build="${build.number}"
version="${new.version}"
returnproperty="version.info"
/>
<echo message="${version.info}"/>
</target>
<target name="ftp" description="Deploy All To FTP Location" depends="release" if="upload.ftp">
<ftp server="${ftp.server}"
port="${ftp.port}"
remotedir="${ftp.dir}"
userid="${ftp.username}"
password="${ftp.password}">
<fileset dir="${dist}" casesensitive="yes">
<include name="${atomfile}" if="${autoupdate.upload}"/>
<include name="${source.zip}" if="${autoupdate.dosource}"/>
<include name="${mac.dmg}"/>
<include name="${mac.zip}"/>
<include name="${win.zip}"/>
<include name="${other.zip}"/>
</fileset>
</ftp>
</target>
<target name="sourceforge" description="Deploy All To Sourceforge" depends="release" if="upload.sourceforge">
<tstamp>
<format property="sourceforge.date" pattern="d/M/yyyy"/>
</tstamp>
<sfpublish
releasename="${new.version}"
packagename="${sourceforge.project}"
packagehidden="no"
hidden="no"
projectshortname="${sourceforge.project}"
projectname="${sourceforge.project}"
username="${sourceforge.username}"
password="${sourceforge.password}"
releasedate="${sourceforge.date}">
<filespec
file="${source.zip.full}"
filetype="source_zip"
processortype="platform_independent"/>
<filespec
file="${other.zip.full}"
filetype="binary_zip"
processortype="platform_independent"/>
<filespec
file="${mac.dmg.full}"
filetype="${mac.sf.type}"
processortype="any"/>
<filespec
file="${win.zip.full}"
filetype="binary_zip"
processortype="i386"/>
</sfpublish>
</target>
<target name="github" description="Deploy All To GitHub" depends="autoupdate" if="upload.github">
<github.fullrelease
repouser="${github.repouser}"
repo="${github.repo}"
tokenuser="${github.tokenuser}"
token="${github.token}"
tag="${new.version}"
body="${version.info}">
<fileset dir="${dist}" casesensitive="yes">
<include name="${mac.dmg}"/>
<include name="${mac.zip}"/>
<include name="${win.zip}"/>
<include name="${other.zip}"/>
</fileset>
</github.fullrelease>
</target>
<target name="s3" depends="autoupdate" if="upload.s3">
<s3upload verbose="true"
accessId="${aws.key}"
secretKey="${aws.secret}"
bucket="${aws.s3}"
publicRead="true">
<fileset dir="${dist}" casesensitive="yes">
<include name="${atomfile}" if="${autoupdate.upload}"/>
<include name="${source.zip}" if="${autoupdate.dosource}"/>
<include name="${mac.dmg}"/>
<include name="${mac.zip}"/>
<include name="${win.zip}"/>
<include name="${other.zip}"/>
</fileset>
</s3upload>
</target>
<target name="deploy" description="Deploy to sourceforge/ftp/github/s3" depends="sourceforge,ftp,github,s3">
<!-- At the moment deploy requires nothing else -->
</target>
<target name="clean" description="Remove build and dist directories" depends="sort.props">
<delete dir="${build}"/>
</target>
</project>