-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
1307 lines (1176 loc) · 53.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
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
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!--
FindBugs Ant build script.
Based on original FindBugs Ant Script by Mike Fagan.
Rewritten 1/5/2005 by David Hovemeyer.
-->
<project name="findbugs" default="build">
<!--
The local.properties properties file contains the location of eclipsePlugin.dir
This value is likely to be different for each checkout of the plugin,
so the local.properties file is not managed by cvs
-->
<property file="local.properties" />
<property file="build.properties" />
<property name="jar.dir" value="lib"/>
<property name="plugin.dir" value="plugin"/>
<property name="build.dir" value="build"/>
<property name="junit.dir" value="build/junit"/>
<property name="classes.dir" value="build/classes"/>
<property name="eclipseClasses.dir" value="classesEclipse"/>
<property name="junitclasses.dir" value="build/junitclasses"/>
<property name="scripts.dir" value="bin"/>
<property name="src.dir" value="src/java"/>
<property name="src5.dir" value="src/gui"/>
<property name="toolsrc.dir" value="src/tools"/>
<property name="anttasksrc.dir" value="src/antTask"/>
<property name="scriptsrc.dir" value="src/scripts"/>
<property name="patch.dir" value="src/patches"/>
<property name="xslsrc.dir" value="src/xsl"/>
<property name="junitsrc.dir" value="src/junit"/>
<property name="docsrc.dir" value="src/doc"/>
<property name="etc.dir" value="etc"/>
<property name="test.dir" value="test"/>
<property name="doc.dir" value="doc"/>
<property name="web.dir" value="web"/>
<property name="apiDoc.dir" value="apiJavaDoc"/>
<property name="annotationDoc.dir" value="annotationJavaDoc"/>
<property name="jnlp.dir" value="jnlp"/>
<property name="jsr305.dir" value="../JSR305-ri"/>
<property name="pkg.base" value="edu/umd/cs/findbugs"/>
<property name="engine.jar" value="${jar.dir}/findbugs.jar"/>
<property name="oneFourCompatibility.jar" value="${build.dir}/oneFourCompatibility.jar"/>
<property name="annotations.jar" value="${jar.dir}/annotations.jar"/>
<property name="test.jar" value="${test.dir}/dumb.jar"/>
<property name="sampleoutput.dir" value="build/sampleoutput"/>
<property name="junittests.jar" value="build/junittests.jar"/>
<property name="anttask.jar" value="${jar.dir}/findbugs-ant.jar"/>
<property name="scripts.props" value="etc/script.properties"/>
<property name="scripts.stamp" value="${build.dir}/scripts.stamp"/>
<property name="allClassFiles.jar" value="${build.dir}/allClassFiles.jar"/>
<property name="doc.props.file" value="${etc.dir}/doc.properties"/>
<property name="svnrnum" value="Unknown"/>
<property name="version.props.file" value="${build.dir}/classes/edu/umd/cs/findbugs/version.properties"/>
<path id="findbugs.classpath">
<pathelement location="${jar.dir}/bcel.jar"/>
<pathelement location="${jar.dir}/dom4j-1.6.1.jar"/>
<pathelement location="${jar.dir}/AppleJavaExtensions.jar"/>
<pathelement location="${jar.dir}/junit.jar"/>
<pathelement location="${jar.dir}/asm-3.3.jar"/>
<pathelement location="${jar.dir}/asm-commons-3.3.jar"/>
<pathelement location="${jar.dir}/asm-tree-3.3.jar"/>
<pathelement location="${jar.dir}/jaxen-1.1.1.jar"/>
<pathelement location="${jar.dir}/jsr305.jar"/>
<pathelement location="${jar.dir}/jFormatString.jar"/>
<pathelement location="${jar.dir}/commons-lang-2.4.jar"/>
<pathelement location="${jar.dir}/jcip-annotations.jar"/>
</path>
<path id="tools.classpath">
<pathelement location="${classes.dir}"/>
<pathelement location="${jar.dir}/findbugs.jar"/>
<pathelement location="${jar.dir}/jdepend-2.9.jar"/>
<path refid="findbugs.classpath"/>
</path>
<path id="svn.classpath">
<pathelement location="${svnant.home}/lib/svnant.jar"/>
<pathelement location="${svnant.home}/lib/svnClientAdapter.jar"/>
<pathelement location="${svnant.home}/lib/svnkit.jar"/>
<pathelement location="${svnant.home}/lib/ganymed.jar"/>
<pathelement location="${svnant.home}/lib/svnjavahl.jar"/>
<pathelement location="${svnant.home}/lib/jna.jar"/>
</path>
<patternset id="codebase.data.pats">
<include name="**/*.properties"/>
<include name="**/*.png"/>
<include name="**/*.html"/>
<include name="**/*.db"/>
</patternset>
<patternset id="doc.src.pats">
<include name="**/*.html"/>
<include name="**/*.txt"/>
<include name="**/*.xml"/>
<include name="**/*.xsl"/>
</patternset>
<patternset id="doc.img.pats">
<include name="**/*.png"/>
<include name="**/*.css"/>
<include name="**/*.txt"/>
<include name="**/*.pdf"/>
</patternset>
<fileset id="plugin.jars" dir="${plugin.dir}" includes="*.jar"/>
<property name="prop.plugin.jars" refid="plugin.jars"/>
<!-- Default target builds scripts and jars, allowing execution using
the working directory as FINDBUGS_HOME. Also build test case jarfile. -->
<target name="build" depends="jars,scripts,anttask"/>
<!-- Rebuild from scratch. -->
<target name="rebuild" depends="clean,build"/>
<target name="mondo" depends="jars">
<jar destfile="build/mondo.jar"
manifest="etc/MANIFEST-findbugs-mondo.MF">
<zipfileset src="${jar.dir}/bcel.jar"/>
<zipfileset src="${jar.dir}/dom4j-1.6.1.jar"/>
<zipfileset src="${jar.dir}/AppleJavaExtensions.jar"/>
<zipfileset src="${jar.dir}/junit.jar"/>
<zipfileset src="${jar.dir}/asm-3.3.jar"/>
<zipfileset src="${jar.dir}/asm-commons-3.3.jar"/>
<zipfileset src="${jar.dir}/asm-tree-3.3.jar"/>
<zipfileset src="${jar.dir}/jaxen-1.1.1.jar"/>
<zipfileset src="${jar.dir}/jsr305.jar"/>
<zipfileset src="${jar.dir}/jFormatString.jar"/>
<zipfileset src="${jar.dir}/commons-lang-2.4.jar"/>
<zipfileset src="${jar.dir}/findbugs.jar"/>
</jar>
</target>
<!-- Compile Java source files, and copy other files (properties,
images, html, XSL stylesheets) that need to be part of the codebase. -->
<target name="classes" depends="init">
<!-- Compile Java source files. -->
<echo level="info" message="compiling findbugs"/>
<javac
destdir="${classes.dir}"
source="1.5"
target="1.5"
includeantruntime="false"
encoding="ISO-8859-1"
deprecation="off"
debug="on">
<compilerarg value="-Xlint:unchecked"/>
<src path="${src.dir}"/>
<src path="${src5.dir}"/>
<classpath refid="findbugs.classpath"/>
</javac>
<native2ascii encoding="Cp1252"
dest = "${classes.dir}"
src= "${src.dir}"
includes = "${pkg.base}/**/*_de.properties"
/>
<!-- Copy codebase data files. -->
<echo level="info" message="copying data files"/>
<copy todir="${classes.dir}">
<fileset dir="${src.dir}">
<patternset refid="codebase.data.pats"/>
</fileset>
<fileset dir="${src5.dir}">
<patternset refid="codebase.data.pats"/>
</fileset>
<fileset dir="${xslsrc.dir}">
<include name="*.xsl"/>
</fileset>
</copy>
<!-- Compile JUnit test cases. -->
<echo level="info" message="compiling junit test cases"/>
<javac srcdir="${junitsrc.dir}"
destdir="${junitclasses.dir}"
source="1.5"
target="1.5"
includeantruntime="false"
encoding="ISO-8859-1"
deprecation="off"
debug="on">
<classpath refid="tools.classpath"/>
</javac>
<!-- Compile tools. -->
<echo level="info" message="compiling tools"/>
<javac srcdir="${toolsrc.dir}"
destdir="${classes.dir}"
source="1.5"
target="1.5"
includeantruntime="false"
encoding="ISO-8859-1"
debug="on"
deprecation="off"
excludes="${pkg.base}/tools/patcomp/">
<compilerarg value="-Xlint:unchecked"/>
<classpath refid="tools.classpath"/>
</javac>
<!-- Compile Ant task. -->
<echo level="info" message="compiling ant task"/>
<javac srcdir="${anttasksrc.dir}"
destdir="${classes.dir}"
source="1.5"
target="1.5"
includeantruntime="false"
encoding="ISO-8859-1"
deprecation="off"
debug="on">
<classpath>
<path refid="tools.classpath"/>
<pathelement location="${ant.core.lib}"/>
</classpath>
</javac>
</target>
<!-- Validate findbugs.xml and messagesXXX.xml files. -->
<target name="validate">
<xmlvalidate lenient="false" failonerror="yes">
<attribute name="http://apache.org/xml/features/validation/schema" value="true"/>
<attribute name="http://xml.org/sax/features/namespaces" value="true"/>
<fileset dir="${etc.dir}" includes="*.xml" excludes="checkstyle.xml"/>
</xmlvalidate>
</target>
<target name="validatesamplexmloutput" depends="runanttask">
<schemavalidate failonerror="yes" noNamespaceFile="${etc.dir}/bugcollection.xsd">
<attribute name="http://xml.org/sax/features/namespaces" value="true"/>
<fileset dir="${sampleoutput.dir}" includes="*.xml"/>
</schemavalidate>
</target>
<target name="validatesamplehtmloutput" depends="applystylesheets">
<xmlvalidate failonerror="no">
<attribute name="http://apache.org/xml/features/validation/schema" value="true"/>
<attribute name="http://xml.org/sax/features/namespaces" value="true"/>
<fileset dir="${sampleoutput.dir}" includes="plain.html"/>
</xmlvalidate>
</target>
<target name="validatesampleoutput" depends="validatesamplexmloutput"/>
<!-- Build jar files. -->
<target name="allClassFilesJar" depends="classes,validate,version">
<jar destfile="${allClassFiles.jar}">
<fileset dir="${classes.dir}">
<include name="**/*.class"/>
<include name="**/*.properties"/>
<include name="**/*.db"/>
<include name="**/*.xsl"/>
</fileset>
</jar>
</target>
<target name="jars" depends="classes,version">
<copy todir="${eclipseClasses.dir}" overwrite="true">
<fileset dir="${etc.dir}">
<include name="*.xsd"/>
<include name="bugrank.txt"/>
<include name="findbugs.xml"/>
<include name="messages*.xml"/>
<include name="*.properties"/>
</fileset>
</copy>
<!-- Main engine and command line jar file. -->
<jar destfile="${engine.jar}"
manifest="etc/MANIFEST-findbugs.MF">
<!-- Compiled classes, properties files. -->
<fileset dir="${classes.dir}">
<exclude name="${pkg.base}/tools/**"/>
<exclude name="${pkg.base}/tools/**"/>
<exclude name="${pkg.base}/antTask/**"/>
<!-- Exclude JUnit tests. -->
<!--
<exclude name="**/*Test.class"/>
-->
<include name="**/*.class"/>
<include name="**/*.properties"/>
<include name="**/*.db"/>
<include name="**/*.xsl"/>
<include name="**/*.png"/>
<include name="**/*.html"/>
</fileset>
<fileset dir="${etc.dir}">
<include name="*.xsd"/>
<include name="bugrank.txt"/>
<include name="findbugs.xml"/>
<include name="messages*.xml"/>
</fileset>
</jar>
<!-- Annotations jar file. -->
<jar destfile="${annotations.jar}"
manifest="${etc.dir}/MANIFEST-findbugs-annotations.MF"
>
<fileset dir="${classes.dir}">
<include name="**/annotations/*.class"/>
</fileset>
<fileset dir="${src.dir}">
<include name="**/annotations/*.java"/>
</fileset>
<zipfileset src="${jar.dir}/jcip-annotations.jar" excludes="META-INF/**,**/*.html"/>
<zipfileset src="${jar.dir}/jsr305.jar" excludes="META-INF/**,**/*.html"/>
</jar>
</target>
<!--
Create one giant executable Jar file containing
Findbugs, textui and gui, detectors, and all required
libraries.
-->
<target name="fulljar" depends="classes,validate,version">
<property name="fullJarName" value="findbugs-full-${release.number}.jar"/>
<jar destfile="${jar.dir}/${fullJarName}" manifest="etc/MANIFEST-findbugs-full.MF">
<fileset dir="${classes.dir}">
<exclude name="${pkg.base}/tools/**"/>
<exclude name="${pkg.base}/antTask/**"/>
<include name="**/*.class"/>
<include name="**/*.properties"/>
<include name="**/*.db"/>
<include name="**/*.xsl"/>
<include name="${pkg.base}/sourceViewer/**/*.class"/>
<include name="${pkg.base}/gui/**/*.png"/>
<include name="${pkg.base}/gui/**/*.html"/>
<include name="${pkg.base}/gui2/**/*.png"/>
<include name="${pkg.base}/gui2/**/*.html"/>
</fileset>
<fileset dir="${etc.dir}">
<include name="bugrank.txt"/>
<include name="findbugs.xml"/>
<include name="bugrank.txt"/>
<include name="messages*.xml"/>
</fileset>
<zipfileset src="${jar.dir}/bcel.jar" excludes="META-INF/**"/>
<zipfileset src="${jar.dir}/asm-3.3.jar" excludes="META-INF/**"/>
<zipfileset src="${jar.dir}/asm-analysis-3.3.jar" excludes="META-INF/**"/>
<zipfileset src="${jar.dir}/asm-commons-3.3.jar" excludes="META-INF/**"/>
<zipfileset src="${jar.dir}/asm-tree-3.3.jar" excludes="META-INF/**"/>
<zipfileset src="${jar.dir}/asm-util-3.3.jar" excludes="META-INF/**"/>
<zipfileset src="${jar.dir}/asm-xml-3.3.jar" excludes="META-INF/**"/>
<zipfileset src="${jar.dir}/dom4j-1.6.1.jar" excludes="META-INF/**"/>
<zipfileset src="${jar.dir}/jaxen-1.1.1.jar" excludes="META-INF/**"/>
<zipfileset src="${jar.dir}/jsr305.jar" excludes="META-INF/**"/>
<zipfileset src="${jar.dir}/jFormatString.jar" excludes="META-INF/**"/>
<zipfileset src="${jar.dir}/commons-lang-2.4.jar" excludes="META-INF/**"/>
</jar>
</target>
<!-- Generate front-end scripts. -->
<target name="scripts" depends="init">
<loadproperties srcFile="${scripts.props}"/>
<filterset id="script.filters">
<filter token="GET_FBHOME" value="${script.get.fbhome}" />
<filter token="SET_DEFAULT_JAVA" value="${script.set.default.java}"/>
<filter token="WRAP_JAVA" value="${script.wrap.java}"/>
<filter token="WRAP_JAR" value="${script.wrap.jar}"/>
<filter token="DEFINE_ESCAPE_ARG" value="${script.define.escape_arg}"/>
</filterset>
<copy todir="${scripts.dir}" overwrite="true">
<fileset dir="${scriptsrc.dir}/standard"/>
<filterset refid="script.filters"/>
</copy>
<copy todir="${scripts.dir}" overwrite="true">
<fileset dir="${scriptsrc.dir}/windows"/>
</copy>
<copy todir="${scripts.dir}/deprecated" overwrite="true">
<fileset dir="${scriptsrc.dir}/deprecated"/>
<filterset refid="script.filters"/>
</copy>
<copy todir="${scripts.dir}/experimental" overwrite="true">
<fileset dir="${scriptsrc.dir}/experimental"/>
<filterset refid="script.filters"/>
</copy>
<!-- Make the Unix scripts executable. -->
<chmod dir="${scripts.dir}" perm="a+x" includes="**/*" excludes="**/*.bat"/>
<fixcrlf srcdir="${scripts.dir}" includes="**/*.bat" eol="crlf"/>
<touch file="${scripts.stamp}"/>
</target>
<!-- Ant task jar file. -->
<target name="anttask" depends="classes">
<jar destfile="${anttask.jar}">
<fileset dir="${classes.dir}">
<include name="${pkg.base}/anttask/**"/>
</fileset>
<fileset dir="${anttasksrc.dir}">
<include name="${pkg.base}/anttask/*.properties"/>
</fileset>
</jar>
</target>
<!-- JUnit test cases -->
<target name="junittests" depends="classes">
<jar destfile="${junittests.jar}">
<fileset dir="${junitclasses.dir}">
<include name="**"/>
</fileset>
</jar>
</target>
<target name="applystylesheets" depends="jars,runanttask">
<property name="findbugs.home" value="." />
<java classname="edu.umd.cs.findbugs.PrintingBugReporter"
fork="true"
failonerror="true"
output="${sampleoutput.dir}/fancy.html"
maxmemory="400m">
<classpath>
<pathelement location="${jar.dir}/findbugs.jar"/>
</classpath>
<jvmarg value="-ea"/>
<jvmarg value="-Dfindbugs.home=${findbugs.home}"/>
<arg value="-html:fancy.xsl"/>
<arg value="${sampleoutput.dir}/bcel.xml"/>
</java>
<java classname="edu.umd.cs.findbugs.PrintingBugReporter"
fork="true"
failonerror="true"
output="${sampleoutput.dir}/default.html"
maxmemory="400m">
<classpath>
<pathelement location="${jar.dir}/findbugs.jar"/>
</classpath>
<jvmarg value="-ea"/>
<jvmarg value="-Dfindbugs.home=${findbugs.home}"/>
<arg value="-html:default.xsl"/>
<arg value="${sampleoutput.dir}/bcel.xml"/>
</java>
<java classname="edu.umd.cs.findbugs.PrintingBugReporter"
fork="true"
failonerror="true"
output="${sampleoutput.dir}/plain.html"
maxmemory="400m">
<classpath>
<pathelement location="${jar.dir}/findbugs.jar"/>
</classpath>
<jvmarg value="-ea"/>
<jvmarg value="-Dfindbugs.home=${findbugs.home}"/>
<arg value="-html:plain.xsl"/>
<arg value="${sampleoutput.dir}/bcel.xml"/>
</java>
<java classname="edu.umd.cs.findbugs.PrintingBugReporter"
fork="true"
failonerror="true"
output="${sampleoutput.dir}/summary.html"
maxmemory="400m">
<classpath>
<pathelement location="${jar.dir}/findbugs.jar"/>
</classpath>
<jvmarg value="-ea"/>
<jvmarg value="-Dfindbugs.home=${findbugs.home}"/>
<arg value="-html:summary.xsl"/>
<arg value="${sampleoutput.dir}/bcel.xml"/>
</java>
</target>
<target name="runanttask" depends="anttask,jars">
<property name="findbugs.home" value="." />
<taskdef resource="edu/umd/cs/findbugs/anttask/tasks.properties" classpath="${anttask.jar}"/>
<findbugs home="."
output="xml:withMessages"
jvmargs="-ea -Xmx1200m"
projectName="Byte code Engineering Library (BCEL)"
outputFile="${sampleoutput.dir}/bcel.xml"
>
<class location="${jar.dir}/bcel.jar" />
</findbugs>
<findbugs home="."
output="xml:withMessages"
cloud="edu.umd.cs.findbugs.cloud.appengine.findbugs-cloud"
jvmargs="-ea -Xmx1200m"
projectName="Byte code Engineering Library (BCEL)"
outputFile="${sampleoutput.dir}/bcel-cloud-appengine.xml" >
<class location="${jar.dir}/bcel.jar" />
</findbugs>
<!--
<findbugs home="."
output="xml:withMessages"
cloud="edu.umd.cs.findbugs.cloud.appengine.findbugs-cloud"
jvmargs="-ea -Xmx1200m"
projectName="Byte code Engineering Library (BCEL)"
outputFile="${sampleoutput.dir}/bcel-cloud.xml" >
<class location="${jar.dir}/bcel.jar" />
</findbugs>
-->
<!--
<findbugs home="${findbugs.home}"
output="xml"
jvmargs="-ea -Xmx940m"
outputFile="${sampleoutput.dir}/bcel-3.xml"
projectFile="${sampleoutput.dir}/bcel.fbp"
applySuppression="true"
/>
<convertXmlToText
home="${findbugs.home}"
jvmargs="-ea -Xmx940m"
input="${sampleoutput.dir}/bcel-3.xml"
output="${sampleoutput.dir}/bcel-3.txt"
applySuppression="true"
/>
-->
<setBugDatabaseInfo home="."
withMessages="true"
name="Set name test"
input="${sampleoutput.dir}/bcel.xml"
output="${sampleoutput.dir}/bcel-2.xml"
/>
</target>
<target name="findbugscheck" depends="anttask,junittests,jars">
<property name="findbugs.home" value="." />
<ant dir="${pluginsSrc.dir}/findbugsCommunalCloud" target="install" inheritAll="false" />
<taskdef resource="edu/umd/cs/findbugs/anttask/tasks.properties" classpath="${anttask.jar}"/>
<findbugs home="."
output="xml:withMessages"
cloud="edu.umd.cs.findbugs.cloud.appengine.findbugs-cloud"
jvmargs="-ea -Xmx1200m -Dfindbugs.failOnCloudError=true -Dfindbugs.cloud.token=238b6fc80cec17ec"
excludeFilter="findbugsExclude.xml"
projectName="FindBugs"
maxRank="20"
timeout="1800000"
outputFile="${build.dir}/findbugscheckAll.xml" >
<class location="${classes.dir}" />
<sourcePath path="src/java:src/gui:src/junit:src/tools"/>
<auxClasspath refid="tools.classpath"/>
</findbugs>
<filterBugs home="."
withMessages="true"
notAProblem="false"
jvmargs="-ea -Xmx1200m"
input="${build.dir}/findbugscheckAll.xml"
output="${build.dir}/findbugscheck.xml" >
</filterBugs>
</target>
<target name="findbugscheck-cloud-fails" depends="anttask,junittests,jars">
<property name="findbugs.home" value="." />
<ant dir="${pluginsSrc.dir}/findbugsCommunalCloud" target="install" inheritAll="false" />
<taskdef resource="edu/umd/cs/findbugs/anttask/tasks.properties" classpath="${anttask.jar}"/>
<findbugs home="."
output="xml:withMessages"
cloud="edu.umd.cs.findbugs.cloud.appengine.findbugs-cloud"
jvmargs="-ea -Xmx1200m -Dfindbugs.failOnCloudError=true -Dwebcloud.host=example.com"
excludeFilter="findbugsExclude.xml"
projectName="FindBugs"
maxRank="20"
timeout="1800000"
outputFile="${build.dir}/findbugscheck.xml" >
<class location="${classes.dir}" />
<sourcePath path="src/java:src/gui:src/junit:src/tools"/>
<auxClasspath refid="tools.classpath"/>
</findbugs>
</target>
<target name="findbugsTestCases" depends="anttask,junittests,jars">
<property name="findbugs.home" value="." />
<taskdef resource="edu/umd/cs/findbugs/anttask/tasks.properties" classpath="${anttask.jar}"/>
<findbugs home="."
output="xml"
jvmargs="-ea -Xmx1200m"
projectName="FindBugsTestCases"
timeout="1800000"
outputFile="${sampleoutput.dir}/findbugsTestCases.xml" >
<class location="../findbugsTestCases/build/classes" />
</findbugs>
</target>
<!-- Download, install a plugin and run it on BCEL. This is useful
as a check for whether changes to FindBugs have broken its
interface with plugins. Note that the generated .xml file is
kept in the ${sampleoutput.dir} for later perusal. -->
<target name="plugincheck" depends="anttask">
<property name="findbugs.home" value="." />
<taskdef resource="edu/umd/cs/findbugs/anttask/tasks.properties" classpath="${anttask.jar}"/>
<!-- download the plugin -->
<echo message="curl ${plugincheck.jar} -o ${plugin.dir}/${plugincheck.jar}"/>
<!-- won't work everywhere, but I can't find an easy alternative -->
<exec executable="curl" failonerror="true">
<arg value="${plugincheck.url}"/>
<arg value="-o"/>
<arg value="${plugin.dir}/${plugincheck.jar}"/>
</exec>
<!-- run FindBugs w/ plugin on BCEL -->
<antcall target="runanttask"/>
<delete file="${plugin.dir}/${plugincheck.jar}"/>
<!-- keep warning file -->
<move file="${sampleoutput.dir}/bcel.xml" tofile="${sampleoutput.dir}/bcel.xml.${plugincheck.jar}"/>
</target>
<!-- Check for plugin fb-contrib-3.2.5.jar -->
<target name="plugincheck_fbcontrib" depends="anttask">
<delete file="${plugin.dir}/fb-contrib-3.2.5.jar" quiet="true"/>
<antcall target="runanttask"/>
<move file="${sampleoutput.dir}/bcel.xml" tofile="${sampleoutput.dir}/bcel.xml.core"/>
<antcall target="plugincheck">
<param name="plugincheck.url" value="http://umn.dl.sourceforge.net/sourceforge/fb-contrib/fb-contrib-3.2.5.jar"/>
<param name="plugincheck.jar" value="fb-contrib-3.2.5.jar"/>
</antcall>
</target>
<target name="compileFindbugsTestCases">
<ant dir="../findbugsTestCases" target="classes" inheritAll="false" />
</target>
<!-- Run JUnit test cases -->
<target name="runjunit" depends="junittests,jars,compileFindbugsTestCases">
<echo>Running JUnit test cases for FindBugs...</echo>
<delete dir="${junit.dir}"/>
<mkdir dir="${junit.dir}"/>
<junit fork="yes" printsummary="true">
<jvmarg value="-ea"/>
<jvmarg value="-Dfindbugs.home=."/>
<formatter type="xml"/> <!-- Hudson reads generated xml -->
<classpath refid="tools.classpath"/>
<classpath>
<pathelement path="${junitclasses.dir}"/>
</classpath>
<!-- junit needs fileset to point to .java files (not .class) -->
<batchtest todir="${junit.dir}">
<fileset dir="${junitsrc.dir}">
<include name="**/*Test.java"/>
<include name="**/Test*.java"/>
<exclude name="**/Abstract*Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="checkstyle">
<taskdef resource="checkstyletask.properties"
classpath="build-lib/checkstyle-all-5.1.jar"/>
<checkstyle config="etc/checkstyle.xml" failonviolation="false">
<fileset dir="src/java"/>
<fileset dir="src/gui"/>
<fileset dir="src/junit"/>
<!--
<fileset dir="../sandbox/localCloud/src"/>
-->
<fileset dir="../findbugsTestCases/src"/>
<fileset dir="${pluginsSrc.dir}/findbugsCommunalCloud/src"/>
<fileset dir="${pluginsSrc.dir}/jira/src"/>
<fileset dir="${pluginsSrc.dir}/googlecode/src"/>
<fileset dir="${pluginsSrc.dir}/jdbcCloudClient/src"/>
<fileset dir="${serverSrc.dir}/appengine/src"/>
<fileset dir="${serverSrc.dir}/common/src"/>
<formatter type="xml" tofile="build/checkstyle-result.xml"/>
</checkstyle>
</target>
<target name="smoketest" depends="scripts,findbugscheck,runjunit,validate,validatesampleoutput"/>
<!-- Get version properties. -->
<target name="version" depends="classes,-get-svn-revision" >
<echo>${svnrnum}</echo>
<java classpathref="tools.classpath"
output="${version.props.file}"
classname="edu.umd.cs.findbugs.Version"
failonerror="true">
<arg value="-props"/>
<sysproperty key="svn.revision" value="${svnrnum}"/>
</java>
<loadproperties srcfile="${version.props.file}"/>
<copy todir="${classes.dir}" file="${version.props.file}"/>
<loadproperties srcfile="${version.props.file}"/>
</target>
<target name="-get-svn-revision" if="svnant.home">
<taskdef resource="org/tigris/subversion/svnant/svnantlib.xml"
classpathref="svn.classpath"/>
<svn svnkit="false" javahl="false">
<status path="." revisionProperty="svnrnum"/>
</svn>
<echo>${svnrnum}</echo>
</target>
<target name="checkdocs">
<!-- FIXME: check whether docs are up to date -->
</target>
<!-- Generate formatted documentation. -->
<target name="docs" depends="classes,version,bugdesc,checkdocs" unless="docs.uptodate">
<loadproperties srcFile="${doc.props.file}"/>
<!-- Generate HTML docs (the website). -->
<antcall target="generatedocs">
<param name="docoutput.dir" value="${doc.dir}"/>
<param name="googleanalytics.fragment" value=""/>
</antcall>
<property name="webdocs.uptodate" value="true"/>
<!-- Generate HTML version of manual. -->
<antcall target="generatemanual">
<param name="docoutput.dir" value="${doc.dir}"/>
<param name="googleanalytics.fragment" value=""/>
</antcall>
<property name="manual.uptodate" value="true"/>
<!-- Generate PDF version of manual. -->
<antcall target="generatepdfmanual">
<param name="docoutput.dir" value="${doc.dir}"/>
</antcall>
<property name="pdfmanual.uptodate" value="true"/>
</target>
<target name="checkweb">
<!-- FIXME: check whether web docs are up to date -->
</target>
<target name="web" depends="classes,version,web0,bugdesc,checkweb,apiJavadoc"/>
<!-- Generate website. -->
<target name="web0" depends="apiJavadoc">
<loadproperties srcFile="${doc.props.file}"/>
<antcall target="generatedocs">
<param name="docoutput.dir" value="${web.dir}"/>
<param name="googleanalytics.fragment" value="${doc.html.googleanalytics}"/>
</antcall>
<property name="webdocs.uptodate" value="true"/>
<antcall target="generatemanual">
<param name="docoutput.dir" value="${web.dir}"/>
<param name="googleanalytics.fragment" value="${doc.html.googleanalytics}"/>
</antcall>
<property name="manual.uptodate" value="true"/>
<!-- move javadocs from 'apiJavadoc' target (could use <copy/> instead of <move/>, but slower) -->
<move todir="${web.dir}/api">
<fileset dir="${apiDoc.dir}"/>
</move>
<mkdir dir="${web.dir}/xsl"/>
<copy todir="${web.dir}/xsl">
<fileset dir="${xslsrc.dir}">
<include name="*.xsl"/>
</fileset>
</copy>
</target>
<!--
Generate all bug description HTML files.
-->
<target name="bugdesc" depends="jars" unless="bugdesc.uptodate">
<loadproperties srcFile="${doc.props.file}"/>
<!-- Generate bug descriptions. -->
<antcall target="generatebugdesc">
<param name="bugdesc.output" value="${docsrc.dir}/bugDescriptions.html"/>
<param name="bugdesc.title" value="FindBugs Bug Descriptions"/>
<param name="bugdesc.prologue" value="${doc.html.gen.bugDescriptions.prologue}"/>
<param name="bugdesc.unabridged" value="false"/>
</antcall>
<antcall target="generatebugdesc">
<param name="bugdesc.output" value="${docsrc.dir}/allBugDescriptions.html"/>
<param name="bugdesc.title" value="FindBugs Bug Descriptions (Unabridged)"/>
<param name="bugdesc.prologue" value="${doc.html.gen.allBugDescriptions.prologue}"/>
<param name="bugdesc.unabridged" value="true"/>
</antcall>
</target>
<!--
Generate a single bug description HTML file.
Input Params:
bugdesc.output - bug description file to create
bugdesc.title - title of document
bugdesc.prologue - text at beginning of bug description file
bugdesc.unabridged - true if generating all bug descriptions,
false if only default-enabled
-->
<target name="generatebugdesc">
<java classname="edu.umd.cs.findbugs.tools.html.PrettyPrintBugDescriptions"
fork="true"
logError="true"
output="${bugdesc.output}">
<jvmarg value="-ea"/>
<jvmarg value="-Dfindbugs.home=."/>
<jvmarg value="-Dfindbugs.desc.unabridged=${bugdesc.unabridged}"/>
<classpath refid="tools.classpath"/>
<arg value="${bugdesc.title}"/>
<arg value="${doc.html.gen.header}"/>
<arg value="${doc.html.gen.beginBody}"/>
<arg value="${bugdesc.prologue}"/>
<arg value="${doc.html.gen.endBody}"/>
</java>
</target>
<!--
Generate documentation files by performing token substitutions
based on property values. This will construct viewable HTML
from the raw documentation sources, as well as the XML/XSL files
ready to be formatted as HTML by the docbook-XSL stylesheet
package.
Input Params:
docoutput.dir - output directory for generated documents
googleanalytics.fragment - HTML fragment for google analytics
(empty if not formatting for website)
-->
<target name="generatedocs" unless="webdocs.uptodate">
<mkdir dir="${docoutput.dir}"/>
<mkdir dir="${docoutput.dir}/ja"/>
<!-- Filter set used for generating text substitution values for
documentation. -->
<filterset id="doc.filters">
<filter token="VERSION" value="${release.number}" />
<filter token="RELEASE_DATE" value="${release.date}" />
<filter token="ECLIPSE_UI_VERSION" value="${eclipse.ui.version}" />
<filter token="WEBSITE" value="${findbugs.website}"/>
<filter token="DOWNLOADS_WEBSITE" value="${findbugs.downloads.website}"/>
<filter token="HTML_XSL_STYLESHEET" value="${xsl.stylesheet.home}/html/chunk.xsl" />
<filter token="FO_XSL_STYLESHEET" value="${xsl.stylesheet.home}/fo/docbook.xsl"/>
<!--
<filter token="ECLIPSE_XSL_STYLESHEET" value="${eclipse.xsl.stylesheet}" />
-->
<filter token="HTML_SIDEBAR" value="${doc.html.sidebar}"/>
<filter token="HTML_FOOTER" value="${doc.html.footer}"/>
<filter token="GOOGLE_ANALYTICS" value="${googleanalytics.fragment}"/>
</filterset>
<!-- Generate files, substituting token values based on properties -->
<copy todir="${docoutput.dir}">
<filterset>
<filterset refid="doc.filters"/>
</filterset>
<fileset dir="${docsrc.dir}">
<patternset refid="doc.src.pats"/>
</fileset>
</copy>
<!-- overwrite UTF-8 files -->
<copy todir="${docoutput.dir}" encoding="UTF-8" overwrite="true">
<filterset>
<filterset refid="doc.filters"/>
</filterset>
<fileset dir="${docsrc.dir}">
<include name="manual_*.xml"/>
</fileset>
</copy>
<copy todir="${docoutput.dir}">
<fileset dir="${docsrc.dir}">
<patternset refid="doc.img.pats"/>
</fileset>
</copy>
<copy todir="${docoutput.dir}/ja/manual">
<fileset dir="${docsrc.dir}/manual">
<patternset refid="doc.img.pats"/>
</fileset>
</copy>
</target>
<!--
Format the manual as HTML.
Input Params:
docoutput.dir - the directory containing the generated HTML/XML/XSL files
(must be a child of the project root directory)
-->
<target name="generatemanual" unless="manual.uptodate">
<echo>Generating HTML version of manual</echo>
<echo>Running saxon: ${saxon.home}/saxon.jar</echo>
<java fork="true" dir="${docoutput.dir}" failonerror="true" classname="com.icl.saxon.StyleSheet" >
<classpath>
<pathelement location="${saxon.home}/saxon.jar"/>
<pathelement path="${java.class.path}"/>
</classpath>
<arg value="manual.xml" />
<arg value="manual.xsl" />
</java>
<java fork="true" dir="${docoutput.dir}/ja" failonerror="true" classname="com.icl.saxon.StyleSheet" >
<classpath>
<pathelement location="${saxon.home}/saxon.jar"/>
<pathelement path="${java.class.path}"/>
</classpath>
<arg value="../manual_ja.xml" />
<arg value="../manual.xsl" />
</java>
</target>
<!--
Format the manual as PDF.
Requires dblatex http://sourceforge.net/projects/dblatex,
pdflatex, and perl to be installed.
Input Params:
docoutput.dir - the directory containing the generated HTML/XML/XSL files
(must be a child of the project root directory)
-->
<target name="generatepdfmanual" if="doc.generate.pdf" unless="pdfmanual.uptodate">
<echo>Generating PDF version of manual</echo>
<!--
<echo>Running saxon: ${saxon.home}/saxon.jar</echo>
<java fork="true" dir="${docoutput.dir}" failonerror="true" classname="com.icl.saxon.StyleSheet" >
<classpath>
<pathelement location="${saxon.home}/saxon.jar"/>
<pathelement path="${java.class.path}"/>
</classpath>
<arg value="-o"/>
<arg value="manual.fo"/>
<arg value="manual.xml" />
<arg value="manual-fo.xsl" />
</java>
<exec dir="${docoutput.dir}" executable="${fop.home}/fop">
<arg value="-fo"/>
<arg value="manual.fo"/>
<arg value="-pdf"/>
<arg value="manual.pdf"/>
</exec>
-->
<echo>Running dblatex...</echo>
<exec dir="${docoutput.dir}" executable="dblatex">
<arg value="-t"/>
<arg value="tex"/>
<arg value="-o"/>
<arg value="manual-raw.tex"/>
<arg value="manual.xml"/>
</exec>
<echo>Fixing dblatex output...</echo>
<exec dir="${docoutput.dir}" executable="/usr/bin/perl" output="${docoutput.dir}/manual.tex">
<arg value="-e"/>
<arg value="while(<>){s,([A-Za-z-]*\.png\}),manual/\1,g;print;}"/>
<arg value="manual-raw.tex"/>
</exec>
<echo>Running pdflatex...</echo>
<antcall target="pdflatex-manual"/>
<echo>Done.</echo>
</target>
<target name="pdflatex-manual">
<exec dir="${docoutput.dir}" executable="pdflatex">
<arg value="manual.tex"/>
</exec>
</target>
<!-- Generate jnlp jars -->
<target name="jnlp" depends="jars">
<copy todir="${jnlp.dir}" file="${engine.jar}"/>
<copy todir="${jnlp.dir}" file="${jar.dir}/bcel.jar"/>
<copy todir="${jnlp.dir}" file="${jar.dir}/jsr305.jar"/>
<copy todir="${jnlp.dir}" file="${jar.dir}/asm-3.3.jar"/>
<copy todir="${jnlp.dir}" file="${jar.dir}/asm-commons-3.3.jar"/>
<copy todir="${jnlp.dir}" file="${jar.dir}/asm-tree-3.3.jar"/>
<copy todir="${jnlp.dir}" file="${jar.dir}/dom4j-1.6.1.jar"/>
<copy todir="${jnlp.dir}" file="${jar.dir}/jaxen-1.1.1.jar"/>
<copy todir="${jnlp.dir}" file="${jar.dir}/jFormatString.jar"/>
<copy todir="${jnlp.dir}" file="${jar.dir}/commons-lang-2.4.jar"/>
<copy todir="${jnlp.dir}" file="${jar.dir}/AppleJavaExtensions.jar"/>
<copy todir="${jnlp.dir}" file="${docsrc.dir}/buggy-sm.png"/>
<copy todir="${jnlp.dir}">
<fileset refid="plugin.jars"/>
</copy>
<copy todir="${jnlp.dir}">
<fileset dir="${plugin.dir}">
<exclude name="README"/>
</fileset>
</copy>
<echo file="${plugin.dir}/pluginlist.properties">${prop.plugin.jars}</echo>
<jar destfile="${jnlp.dir}/findbugs.jar" update="yes">
<fileset dir="${etc.dir}">
<include name="systemProperties.properties"/>
<include name="my.java.policy"/>