-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild.xml
More file actions
891 lines (635 loc) · 25.3 KB
/
build.xml
File metadata and controls
891 lines (635 loc) · 25.3 KB
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
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
<?xml version="1.0" encoding="utf-8"?>
<!--
SQL Power Wabit Ant build file
-->
<project
name="wabit"
default="assembly"
basedir=".">
<!-- $Id: $ -->
<property name="project.version" value="1.3.4"/>
<!-- Optional per-user customization -->
<property file="${user.home}/build.properties" />
<!-- Optional directory customization -->
<property file="build.properties" />
<!-- The directory where the Java source files are -->
<property name="src" value="src/main/java"/>
<!-- The directory where the Java source files are -->
<property name="test.src" value="src/test/java"/>
<!-- The directory where the Java source files are -->
<property name="jdbc.dir" value="src/main/jdbc"/>
<!-- The directory where the Java resource files are -->
<property name="resources" value="src/main/resources"/>
<!-- The directory where the Java resource files are -->
<property name="test.resources" value="src/test/resources"/>
<!-- The directory with all the JAR files that are required
by the Wabit at runtime -->
<property name="lib" value="lib"/>
<!-- A temp directory where we will put everything that needs to be in the jar manifest -->
<property name="manifest.dir" value="manifest"/>
<!-- The directory with all the JAR files that are required
by the Wabit at compile time but are not part of
the runtime dependencies -->
<property name="buildlib" value="buildlib" />
<!-- The target build directory for compiled classes, docs,
resources, and more. The contents of this dir will eventually
get added to the wabit.jar file. -->
<property name="build" value="build"/>
<!-- The directory where distributables are put -->
<property name="dist.base" value="dist"/>
<!-- The directory where the website is built -->
<property name="web.dir" value="${dist.base}/site"/>
<!-- The directory where junit HTML reports are generated.
Other report files could eventually be placed here too. -->
<property name="reports.base" value="${dist.base}/reports"/>
<!-- The target build directory for compiled test classes.
The contents of this directory will get excluded form the wabit.jar. -->
<property name="build.tests" value="build_tests"/>
<!-- The java compiler to use. See Ant docs for details. -->
<property name="build.compiler" value="modern"/>
<!-- The staging directory is a temp dir that is used as a base for all
the OS-dependant distributions -->
<property name="staging.dir" value="staging" />
<!-- Windows installer tool: izpack (needs both a jar and its own
directory to run properly) -->
<property name="izpack.dir" value="ext-tools-home/izpack"/>
<taskdef name="izpack" classpath="${izpack.dir}/lib/standalone-compiler.jar"
classname="com.izforge.izpack.ant.IzPackTask"/>
<!-- Base directory for the izpack (Windows) installer output -->
<property name="installer.dir" value="installer"/>
<!-- When the build runs on a Mac, we can create the .dmg disk image
using the native hdiutil program. Otherwise, we just make a .tar.gz.
-->
<condition property="isMac">
<os family="mac"/>
</condition>
<condition property="isNotMac">
<not>
<os family="mac"/>
</not>
</condition>
<!-- When the build runs on Windows, we can create the .exe executable
using the izpack2exe's exe tool. Otherwise, we would use python
along with the python izpack2exe python script.
-->
<condition property="isWindows">
<os family="windows"/>
</condition>
<condition property="isNotWindows">
<not>
<os family="windows"/>
</not>
</condition>
<!--
Actually, I wanted to test for if this is Linux so to know which
launch4j binaries to use, but unfortunately, there is no 'linux'
value, just unix. So if it's unix, then we will try to use the linux binary.
-->
<condition property="isUnix">
<os family="unix"/>
</condition>
<condition property="isNotUnix">
<not>
<os family="unix"/>
</not>
</condition>
<condition property="launch4j.dir" value="ext-tools-home/launch4j/launch4j-macosx" >
<isset property="isMac"/>
</condition>
<condition property="launch4j.dir" value="ext-tools-home/launch4j/launch4j-linux" >
<isset property="isUnix"/>
</condition>
<condition property="launch4j.dir" value="ext-tools-home/launch4j/launch4j-win32" >
<isset property="isWindows"/>
</condition>
<taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar
:${launch4j.dir}/lib/xstream.jar" />
<!-- OS X .app bundling tool: jarbundler -->
<taskdef name="jarbundler"
classpath="ext-tools-home/osx/jarbundler.jar:ext-tools-home/osx/xercesImpl.jar:ext-tools-home/osx/xml-apis.jar"
classname="net.sourceforge.jarbundler.JarBundler"/>
<!-- findbugs code checking tool -->
<property name="findbugs.home" value="ext-tools-home/findbugs"/>
<property name="findbugs-ant.jar" value="${findbugs.home}/lib/findbugs-ant.jar"/>
<!-- pmd code checking tool and its helper jar files -->
<property name="pmd.home" value="ext-tools-home/pmd"/>
<property name="pmd.jar" value="${pmd.home}/lib/pmd-4.2.jar"/>
<!--
Set the format of the findbugs report to html by default
-->
<condition property="findbugs.report.format" value="html">
<not>
<isset property="findbugs.report.format"/>
</not>
</condition>
<!--
Set the format of the pmd report to html by default
-->
<condition property="pmd.report.format" value="html">
<not>
<isset property="pmd.report.format"/>
</not>
</condition>
<!--
Set the format of the clover report to html by default
-->
<condition property="clover.report.format" value="html">
<not>
<isset property="clover.report.format"/>
</not>
</condition>
<!-- *******************************************************************************
************ Classpaths ************************************************** -->
<path id="runtime.classpath"
description="All the runtime dependencies of the Wabit code">
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
</path>
<path id="compile.classpath"
description="All the compile-time dependencies of the Wabit code">
<path refid="runtime.classpath" />
<fileset dir="${buildlib}">
<include name="*.jar"/>
</fileset>
</path>
<path id="test.classpath"
description="All the test-time dependencies of the Wabit code,
including the compiles Wabit code itself">
<path refid="compile.classpath" />
<pathelement location="${build}"/>
<fileset dir="${jdbc.dir}">
<include name="*.jar"/>
</fileset>
</path>
<!-- *******************************************************************************
************ Build targets *********************************************** -->
<target name="clean" description="Cleans the build system.">
<delete dir="${build}" includeemptydirs="true" />
<delete dir="${build.tests}" includeemptydirs="true" />
<delete dir="${dist.base}" includeemptydirs="true" />
<delete dir="${staging.dir}" includeemptydirs="true" />
</target>
<target name="init" depends="checkAntVersion, generateVersionFile">
<echo message="Building Wabit version: ${app.version}"/>
<mkdir dir="${build}"/>
<mkdir dir="${build.tests}"/>
<mkdir dir="${dist.base}"/>
<mkdir dir="${web.dir}" />
<mkdir dir="${reports.base}"/>
<mkdir dir="${staging.dir}" />
</target>
<target name="compile" depends="init, copy.sqlpower.library">
<javac
srcdir="${src}"
destdir="${build}"
classpathref="compile.classpath"
debug="true"
compiler="modern"
target="1.6"/>
<copy includeEmptyDirs="true" flatten="false" todir="${build}" >
<fileset dir="${resources}">
<include name="**/*"/>
</fileset>
</copy>
</target>
<target name="compile-tests" depends="compile"
description="Compiles the regression test suite">
<javac
srcdir="${test.src}"
destdir="${build.tests}"
classpathref="test.classpath"
debug="true"
compiler="modern"
target="1.6"/>
<copy includeEmptyDirs="true" flatten="false" todir="${build.tests}" >
<fileset dir="${test.resources}">
<include name="**/*"/>
</fileset>
</copy>
</target>
<target name="copy.sqlpower.library" depends="check.sqlpower.library.dir" if="copySqlpLibrary">
<copy file="${sqlpower.library.home}/dist/sqlpower_library.jar" todir="${lib}"/>
<copy file="${sqlpower.library.home}/dist/sqlpower_library-tests.jar" todir="${buildlib}"/>
</target>
<target name="check.sqlpower.library.dir">
<echo message="Checking for sqlpower-library project..."/>
<fail message="Can't find sqlpower-library project! Set the property 'sqlpower.library.home' to point to the sqlpower-library project directory">
<condition>
<not>
<isset property="sqlpower.library.home"/>
</not>
</condition>
</fail>
</target>
<condition property="copySqlpLibrary">
<isfalse value="${release.mode}"/>
</condition>
<!-- *******************************************************************************
************ Testing and code quality targets **************************** -->
<target name="test" depends="compile-tests"
description="Runs the entire test suite.">
<property name="reports.junit" value="${reports.base}/junit"/>
<mkdir dir="${reports.junit}/xml"/>
<junit
printsummary="on"
showoutput="no"
maxmemory="1024m">
<sysproperty
key="ca.sqlpower.wabit.rs.ResultSetHandle.forceSync"
value="true"/>
<classpath>
<path refid="test.classpath"/>
<path path="${build.tests}"/>
</classpath>
<batchtest todir="${reports.junit}/xml">
<fileset dir="${test.src}">
<include name="**/*Test*.java"/>
<exclude name="**/AbstractWabitObjectTest.java"/>
</fileset>
</batchtest>
<formatter type="xml"/>
</junit>
<!-- Generate HTML report -->
<junitreport todir="${reports.junit}">
<fileset dir="${reports.junit}/xml">
<include name="*.xml" />
</fileset>
<report todir="${reports.junit}" />
</junitreport>
</target>
<target name="pmd" depends="init">
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask"
classpath="${pmd.jar}"/>
<property name="pmd-results" value="${reports.base}/pmd-ant-results.${pmd.report.format}"/>
<pmd shortFilenames="true" targetjdk="1.6">
<ruleset>basic,imports</ruleset>
<formatter type="${pmd.report.format}" toFile="${pmd-results}"/>
<fileset dir="${src}">
<include name="**/*.java"/>
</fileset>
</pmd>
<echo message="PMD completed, output is in ${pmd-results}."/>
</target>
<target name="pmd-cpd" depends="init">
<taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask"
classpath="${pmd.jar}"/>
<property name="cpd-results" value="${reports.base}/cpd-ant-results.xml"/>
<cpd encoding="UTF-8" minimumTokenCount="120" format="xml" outputfile="${cpd-results}">
<fileset dir="${src}">
<include name="**/*.java"/>
<exclude name="generated/**.java"/>
</fileset>
</cpd>
<xslt
in="${cpd-results}"
style="${pmd.home}/etc/xslt/cpdhtml.xslt"
out="${reports.base}/cpd-ant-results.html" />
<echo message="CPD completed, output is in ${reports.base}/cpd-ant-results.html."/>
</target>
<target name="findbugs"
depends="compile">
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
classpath="${findbugs-ant.jar}"/>
<findbugs home="${findbugs.home}"
output="${findbugs.report.format}"
outputFile="${reports.base}/findbugs-ant-results.${findbugs.report.format}"
reportLevel="low"
jvmargs="-Xms512m -Xmx1024m"> <!-- FindBugs can use up a lot of memory, so adjust the JVM memory here-->
<class location="${build}" />
<sourcePath path="${src}" />
<!-- Classes needed by our code but that we don't want tested -->
<auxClasspath path="${pmd.jar}" />
<systemProperty name="findbugs.maskedfields.locals" value='true'/>
</findbugs>
</target>
<!-- *******************************************************************************
************ Assembly and distribution targets *************************** -->
<target name="build.manifest">
<mkdir dir="${manifest.dir}"/>
<copy todir="${manifest.dir}/lib">
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
<fileset dir="${buildlib}">
<include name="sqlpower_library.jar"/>
</fileset>
<fileset dir="${sqlpower.library.home}/lib/main">
<include name="*.jar"/>
</fileset>
</copy>
<manifestclasspath property="wabit.jar.classpath" jarfile="${manifest.dir}/wabit.jar">
<classpath>
<pathelement path="${manifest.dir}/jdbc"/>
<fileset dir="${manifest.dir}/">
<include name="lib/*.jar"/>
</fileset>
</classpath>
</manifestclasspath>
<manifest file="${build}/manifest">
<attribute name="Main-Class" value="ca.sqlpower.wabit.swingui.WabitSwingSessionContextImpl"/>
<attribute name="Implementation-Version" value="${app.version}"/>
<attribute name="Built-Date" value="${TODAY}"/>
<attribute name="Class-Path" value="${wabit.jar.classpath}" />
</manifest>
<delete dir="${manifest.dir}"/>
</target>
<target name="jar" description="Creates the embedable JAR" depends="compile-tests, build.manifest">
<property file="src/main/resources/ca/sqlpower/wabit/wabit.properties" />
<tstamp/>
<jar jarfile="${dist.base}/wabit.jar" basedir="${build}" includes="**/*" manifest="${build}/manifest"/>
<jar jarfile="${dist.base}/wabit-tests.jar" basedir="${build.tests}" includes="**/*" manifest="${build}/manifest"/>
</target>
<target
name="assembly"
description="Assembles all the distributions."
depends="assembly-mac, assembly-windows, assembly-generic">
</target>
<target name="assembly-generic" depends="jar">
<property name="staging.dir.generic" value="${staging.dir}/generic" />
<!-- Create directories -->
<mkdir dir="${staging.dir.generic}" />
<!-- Copy all JDBC drivers -->
<copy todir="${staging.dir.generic}/jdbc">
<fileset dir="${jdbc.dir}">
<include name="**/*" />
</fileset>
</copy>
<!-- Copy all Jar files -->
<copy todir="${staging.dir.generic}/lib">
<fileset dir="${lib}">
<include name="*.jar" />
</fileset>
</copy>
<!-- Copy all Wabit Jar file -->
<copy todir="${staging.dir.generic}" file="${dist.base}/wabit.jar"/>
<!-- Copy legal files -->
<copy todir="${staging.dir.generic}">
<fileset dir="">
<include name="LICENSE" />
<include name="LEGAL" />
</fileset>
<fileset dir="doc">
<include name="README.generic" />
<include name="wabit.sh" />
<include name="wabit.bat" />
</fileset>
</copy>
<!-- NOTE: This generally won't work on Windows as it typically doesn't have 'tar' installed -->
<exec executable="tar" dir="${staging.dir.generic}">
<arg value="-cpzf" />
<arg value="${basedir}/${dist.base}/wabit-generic-${app.version}.tar.gz"/>
<arg value="LICENSE"/>
<arg value="LEGAL"/>
<arg value="jdbc"/>
<arg value="lib"/>
<arg value="wabit.jar"/>
</exec>
<delete dir="${staging.dir.generic}" includeemptydirs="true" />
</target>
<target name="assembly-mac" depends="jar">
<property name="staging.dir.mac" value="${staging.dir}/mac" />
<!-- Create directories -->
<mkdir dir="${staging.dir.mac}/tmp" />
<mkdir dir="${staging.dir.mac}/tmp/jdbc" />
<mkdir dir="${staging.dir.mac}/tmp/lib" />
<taskdef name="jarbundler"
classpath="ext-tools-home/osx/jarbundler.jar:ext-tools-home/osx/xercesImpl.jar:ext-tools-home/osx/xml-apis.jar"
classname="net.sourceforge.jarbundler.JarBundler" />
<!-- Copy all JDBC drivers -->
<copy todir="${staging.dir.mac}/tmp/jdbc">
<fileset dir="${jdbc.dir}">
<include name="**/*" />
</fileset>
</copy>
<!-- Copy all Jar files -->
<copy todir="${staging.dir.mac}/tmp/lib">
<fileset dir="${lib}">
<include name="*.jar" />
</fileset>
</copy>
<!-- Copy all Wabit Jar file -->
<copy todir="${staging.dir.mac}/tmp" file="${dist.base}/wabit.jar"/>
<!-- The pre-compiled osx adapter class (it only compiles on OS X) -->
<copy file="ext-tools-home/osx/osx_adapter.jar" todir="${staging.dir.mac}/tmp/lib" />
<property file="src/main/resources/ca/sqlpower/wabit/wabit.properties" />
<!-- jarbundler is from sourceforge, defined near top of file -->
<jarbundler
dir="${staging.dir.mac}"
name="Wabit"
version="${app.version}"
bundleid="ca.sqlpower.wabit"
mainclass="ca.sqlpower.wabit.swingui.WabitSwingSessionContextImpl"
icon="src/main/resources/icons/wabit.icns"
jvmversion="1.6+"
shortname="SQL Power Wabit"
stubfile="ext-tools-home/osx/JavaApplicationStub"
vmoptions="-Xms256m -Xmx1024m">
<jarfileset dir="${staging.dir.mac}/tmp" includes="**/*" />
<extraclasspathfilelist dir="KICKME" files="jdbc" />
<documenttype name="SQL Power Wabit Workspace"
extensions="wabit"
role="Editor"/>
</jarbundler>
<delete dir="${staging.dir.mac}/tmp" includeemptydirs="true" />
<!-- Copy legal files -->
<copy todir="${staging.dir.mac}">
<fileset dir="">
<include name="LICENSE" />
<include name="LEGAL" />
</fileset>
</copy>
<!--
XXX this is stupid. we should modify the jarbundler task to
allow literal strings in the classpath
-->
<replace file="${staging.dir.mac}/Wabit.app/Contents/Info.plist"
token="KICKME" value="$JAVAROOT" />
<!-- NOTE: This generally won't work on Windows as it typically doesn't have 'tar' installed -->
<exec executable="tar" dir="${staging.dir.mac}">
<arg value="-cpzf" />
<arg value="Wabit-OSX-${app.version}.tar.gz"/>
<arg value="LICENSE"/>
<arg value="LEGAL"/>
<arg value="Wabit.app"/>
</exec>
<copy file="${staging.dir.mac}/Wabit-OSX-${app.version}.tar.gz" todir="${dist.base}" />
<delete dir="${staging.dir.mac}" includeemptydirs="true" />
</target>
<target name="assembly-windows" depends="jar">
<property name="staging.dir.windows" value="${staging.dir}/windows" />
<property file="src/main/resources/ca/sqlpower/wabit/wabit.properties" />
<!-- Create directories -->
<mkdir dir="${staging.dir.windows}" />
<!-- Build an executable Wabit program -->
<launch4j>
<config dontwrapjar="true"
headertype="gui"
jarpath="wabit.jar"
outfile="${staging.dir.windows}/wabit.exe"
errtitle="Java Runtime Required"
priority="normal"
downloadurl="http://java.com/download"
supporturl="http://www.sqlpower.ca/forum"
customprocname="false"
stayalive="false"
icon="src/main/resources/icons/wabit.ico">
<jre minVersion="1.6.0"
maxHeapSize="1024"
/>
</config>
</launch4j>
<!-- Build an executable Wabit uninstaller -->
<launch4j>
<config dontwrapjar="true"
headertype="gui"
jarpath="uninstaller.jar"
outfile="${staging.dir.windows}/uninstaller.exe"
errtitle="Java Runtime Required"
priority="normal"
downloadurl="http://java.com/download"
supporturl="http://www.sqlpower.ca/forum"
customprocname="false"
stayalive="false"
icon="${izpack.dir}/uninstall.ico">
<singleInstance
mutexName="SQL Power Wabit Uninstaller"
windowTitle="SQL Power Wabit Uninstaller"
/>
<jre minVersion="1.6.0"/>
</config>
</launch4j>
<!-- Create the installer JAR -->
<izpack
input="${izpack.dir}/install.xml"
output="${staging.dir.windows}/wabit-installer-${app.version}.jar"
installerType="standard"
basedir="${staging.dir.windows}"
izPackDir="${izpack.dir}/">
</izpack>
<!-- Now wrap the installer package in an executable -->
<launch4j>
<config dontwrapjar="false"
headertype="gui"
jar="${staging.dir.windows}/wabit-installer-${app.version}.jar"
outfile="${dist.base}/Wabit-Setup-Windows-${app.version}.exe"
errtitle="Java Runtime Required"
priority="normal"
downloadurl="http://java.com/download"
supporturl="http://www.sqlpower.ca/forum"
customprocname="false"
stayalive="false"
icon="${izpack.dir}/installer-w.ico">
<singleInstance
mutexName="SQL Power Wabit Installer"
windowTitle="SQL Power Wabit Installer"
/>
<jre minVersion="1.6.0"/>
</config>
</launch4j>
<delete dir="${staging.dir.windows}" includeemptydirs="true" />
</target>
<!-- *******************************************************************************
************ Minor targets no one cares about... ************************* -->
<!-- Some of the Ant targets in this build.xml require Ant 1.7.
To upgrade if using Eclipse 3.x,
1. Download the latest Ant from http://ant.apache.org/bindownload.cgi
2. Extract it somewhere
3. Under window, preferences select Ant runtime in the tree
4. Set the Ant home to be the folder that Ant was extracted to -->
<target name="checkAntVersion">
<echo message="Checking Ant version. Using ${ant.version}"/>
<echo message="Note: This build script requires Ant 1.7 or newer."/>
<fail message="This build script requires Ant 1.7 or newer">
<condition>
<not>
<antversion atleast="1.7.0"/>
</not>
</condition>
</fail>
</target>
<target
name="site"
depends="generateVersionFile, test, javadoc"
description="Generates all website files.">
<property file="src/main/resources/ca/sqlpower/wabit/wabit.properties" />
<property name="downloadLinkBase" value="http://wabit.googlecode.com/files"/>
<property name="docLinkBase"
value="http://download.sqlpower.ca/wabit/${app.version}" />
<!-- Generate the index file for the download site. -->
<get
dest="${web.dir}/index.html"
src="http://www.sqlpower.ca/page/splash/page/wabit_download_template" />
<replace file="${web.dir}/index.html">
<replacefilter token="<head>"
value="<head><base href="http://www.sqlpower.ca/page/">" />
<replacefilter token="@@app_version" value="${app.version}" />
<replacefilter token="@@downloadLinkBase" value="${downloadLinkBase}" />
<replacefilter token="@@docLinkBase" value="${docLinkBase}" />
</replace>
<!-- Copy the javadoc -->
<mkdir dir="${web.dir}/apidocs" />
<copy todir="${web.dir}/apidocs">
<fileset dir="${reports.base}/javadoc">
<include name="**/*"/>
</fileset>
</copy>
<!-- Copy the junit report -->
<mkdir dir="${web.dir}/tests" />
<copy todir="${web.dir}/tests">
<fileset dir="${reports.junit}">
<include name="**/*"/>
<exclude name="xml/**"/>
<exclude name="TESTS-TestSuites.xml"/>
</fileset>
</copy>
<!-- Copy release notes -->
<copy
tofile="${web.dir}/ReleaseNotes.txt"
file="ReleaseNotes.txt" />
</target>
<target name="hudson" depends="clean, test, assembly, findbugs, pmd, pmd-cpd">
</target>
<target name="generateVersionFile">
<taskdef name="propertyfile" classname="org.apache.tools.ant.taskdefs.optional.PropertyFile"/>
<tstamp>
<format property="date" pattern="yyyyMMddHHmmss"/>
</tstamp>
<condition property ="version.suffix" value="-${date}">
<isset property="nightly"/>
</condition>
<condition property ="version.suffix" value="">
<not><isset property="nightly"/></not>
</condition>
<property name="app.version" value="${project.version}${version.suffix}"/>
<propertyfile
file="src/main/resources/ca/sqlpower/wabit/wabit.properties"
comment="Wabit Version">
<entry key="app.version" value="${app.version}"/>
</propertyfile>
</target>
<target name="javadoc" depends="init">
<javadoc
source="${src}"
destdir="${reports.base}/javadoc"
author="false"
version="true"
use="true"
verbose="false"
windowtitle="SQL Power Wabit">
<packageset dir="${src}" defaultexcludes="yes">
<include name="ca/sqlpower/**"/>
</packageset>
<classpath refid="test.classpath"/>
<doctitle><![CDATA[<h1>SQL Power Wabit</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2008-2010, SQL Power Group Inc. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
<!-- convert classpath to a flat list/string for use in manifest task -->
<pathconvert property="mf.classpath" pathsep=" " dirsep="/">
<path refid="runtime.classpath" />
<map from="${basedir}/" to=""/>
</pathconvert>
</project>