Package list findbugs / debian/3.1.0_preview2-1 build.xml
debian/3.1.0_preview2-1

Tree @debian/3.1.0_preview2-1 (Download .tar.gz)

build.xml @debian/3.1.0_preview2-1raw · history · blame

   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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
<!--
    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="samplesrc.dir" value="src/sampleXml"/>
    <property name="etc.dir" value="etc"/>
    <property name="test.dir" value="test"/>
    <property name="doc.dir" value="build/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="findbugs-annotations.jar" value="${jar.dir}/findbugs-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="baseline-anttask.jar" value="${findbugs-baseline.home}/lib/findbugs-ant.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="version.props.file" value="${build.dir}/classes/edu/umd/cs/findbugs/version.properties"/>

    <path id="findbugs.classpath">
        <fileset dir="${jar.dir}" includes="*.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>


    <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"/>

    <!-- Compile Java source files, and copy other files (properties,
        images, html, XSL stylesheets) that need to be part of the codebase. -->
    <target name="errorprone" depends="clean,init">
        <javac
                        destdir="${classes.dir}"
                        source="1.8"
                        target="1.8"
                        includeantruntime="false"
                        encoding="ISO-8859-1"
                        deprecation="off"
                        debug="on"
            compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"
            >
                    <compilerarg value="-Xlint:unchecked"/>
                    <src path="${src.dir}"/>
                    <src path="${src5.dir}"/>
                    <classpath refid="findbugs.classpath"/>
                </javac>
    </target>
    <target name="classes" depends="init">
        <echo>Requires JDK 8.x (not 7, not 9!), using: ${ant.java.version}</echo>
        <fail message="Requires JDK 8.x (not 7, not 9!), using: ${ant.java.version}">
             <condition>
                 <or>
                   <equals arg1="1.7" arg2="${ant.java.version}"/>
                   <equals arg1="1.9" arg2="${ant.java.version}"/>
                 </or>
             </condition>
         </fail>

        <!-- Compile Java source files. -->
        <echo level="info" message="compiling findbugs"/>
        <javac
                        destdir="${classes.dir}"
                        source="1.8"
                        target="1.8"
                        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.8"
                target="1.8"
                                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.8"
                target="1.8"
                                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.8"
            target="1.8"
                        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">
        <copy todir="${sampleoutput.dir}" overwrite="true">
            <fileset dir="${samplesrc.dir}">
                                <include name="*.xml"/>
        </fileset>
        </copy>
        <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>

        <!-- FindBugs only annotations jar file. -->
        <jar destfile="${findbugs-annotations.jar}" manifest="${etc.dir}/MANIFEST-findbugs-internal-annotations.MF">
            <fileset dir="${classes.dir}">
                <include name="**/annotations/*.class"/>
            </fileset>
            <fileset dir="${src.dir}">
                <include name="**/annotations/*.java"/>
            </fileset>
        </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="${basedir}" />
   <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="${basedir}" />
    <taskdef resource="edu/umd/cs/findbugs/anttask/tasks.properties" classpath="${anttask.jar}"/>
    <findbugs home="${basedir}"
              output="xml:withMessages"
              jvmargs="-ea -Xmx1200m"
              projectName="Byte code Engineering Library (BCEL)"
              outputFile="${sampleoutput.dir}/bcel.xml"
            >
      <class location="${jar.dir}/bcel-6.0-SNAPSHOT.jar" />
    </findbugs>
    <findbugs home="${basedir}"
              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-6.0-SNAPSHOT.jar" />
    </findbugs>


<setBugDatabaseInfo home="${basedir}"
    withMessages="true"
    name="Set name test"
    input="${sampleoutput.dir}/bcel.xml"
    output="${sampleoutput.dir}/bcel-2.xml"
    />
  </target>

  <target name="baseline-findbugscheck" depends="jars">
    <taskdef resource="edu/umd/cs/findbugs/anttask/tasks.properties" classpath="${baseline-anttask.jar}"/>
    <findbugs home="${findbugs-baseline.home}"
              output="xml:withMessages"
              jvmargs="-ea -Xmx1200m  "
              excludeFilter="findbugsExclude.xml"
              projectName="FindBugs"
              maxRank="20"
              timeout="1800000"
              outputFile="${build.dir}/findbugs-Baseline.xml" >
      <class location="${classes.dir}" />
      <sourcePath path="src/java:src/gui:src/junit:src/tools:src/antTask"/>
      <auxClasspath refid="tools.classpath"/>
      <auxClasspath path="lib/ant.jar"/>
    </findbugs>
   </target>


  <target name="findbugscheck" depends="anttask,junittests,jars">
    <property name="findbugs.home" value="${basedir}" />
    <ant dir="${pluginsSrc.dir}/findbugsCommunalCloud" target="install" inheritAll="false" />
    <taskdef resource="edu/umd/cs/findbugs/anttask/tasks.properties" classpath="${anttask.jar}"/>
    <findbugs home="${basedir}"
              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:src/antTask"/>
      <auxClasspath refid="tools.classpath"/>
      <auxClasspath path="lib/ant.jar"/>
    </findbugs>
    <filterBugs home="${basedir}"
              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="${basedir}" />
    <ant dir="${pluginsSrc.dir}/findbugsCommunalCloud" target="install" inheritAll="false" />
    <taskdef resource="edu/umd/cs/findbugs/anttask/tasks.properties" classpath="${anttask.jar}"/>
    <findbugs home="${basedir}"
              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:src/antTask"/>
      <auxClasspath refid="tools.classpath"/>
    </findbugs>
  </target>

   <target name="findbugsTestCases.check">
    <condition property="findbugsTestCases.exists">
      <available file="${findbugsTestCases.dir}" type="dir"/>
    </condition>
  </target>

  <target name="findbugsTestCases" depends="anttask,junittests,jars,findbugsTestCases.check" if="findbugsTestCases.exists">
   <property name="findbugs.home" value="${basedir}" />
    <taskdef resource="edu/umd/cs/findbugs/anttask/tasks.properties" classpath="${anttask.jar}"/>
    <findbugs home="${basedir}"
              output="xml"
              jvmargs="-ea -Xmx1200m"
              projectName="FindBugsTestCases"
              timeout="1800000"
              outputFile="${sampleoutput.dir}/findbugsTestCases.xml" >
      <class location="${findbugsTestCases.dir}/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="${basedir}" />
        <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="foundFindbugsTestCases" depends="findbugsTestCases.check" unless="findbugsTestCases.exists">
    <echo>FindBugs test cases not found at ${findbugsTestCases.dir}</echo>
        <echo>Skipping test cases that depend on them</echo>
    </target>

    <target name="compileFindbugsTestCases" depends="findbugsTestCases.check" if="findbugsTestCases.exists">
            <ant dir="${findbugsTestCases.dir}" target="classes" inheritAll="false" />
    </target>

    <!-- Run JUnit test cases -->
    <target name="test" depends="runjunit,foundFindbugsTestCases" description="Run tests"/>

    <target name="runjunit" depends="junittests,jars,compileFindbugsTestCases">
        <echo>Running JUnit test cases for FindBugs, results will be in: ${junit.dir}</echo>
        <delete dir="${junit.dir}"/>
        <mkdir dir="${junit.dir}"/>
        <junit fork="yes" printsummary="true" haltonfailure="true" haltonerror="true" dir="${basedir}">
            <jvmarg value="-ea"/>
            <jvmarg value="-Xmx1200m"/>
            <jvmarg value="-Dfindbugs.home=${basedir}"/>
            <jvmarg value="-DfindbugsTestCases.home=${findbugsTestCases.dir}"/>
            <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/antTask"/>
            <fileset dir="src/java"/>
            <fileset dir="src/gui"/>
            <fileset dir="src/junit"/>
            <fileset dir="${findbugsTestCases.dir}/src"/>

            <fileset dir="${pluginsSrc.dir}/webCloudClient/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="-get-git-revision">
    <exec executable="git" spawn="false" outputproperty="gitrnum">
            <arg value="log"/>
            <arg value="--pretty=format:%h"/>
            <arg value="-n"/>
            <arg value="1"/>
    </exec>
        <echo>Got git revision ${gitrnum}</echo>
    </target>


    <target name="version" depends="classes,-get-git-revision" >
        <echo>${gitrnum}</echo>
        <java classpathref="tools.classpath"
              output="${version.props.file}"
              classname="edu.umd.cs.findbugs.Version"
              failonerror="true">
            <arg value="-props"/>
            <sysproperty key="git.revision" value="${gitrnum}"/>
        </java>

        <loadproperties srcfile="${version.props.file}"/>
        <copy todir="${classes.dir}" file="${version.props.file}"/>
        <loadproperties srcfile="${version.props.file}"/>
    </target>


    <target name="checkdocs" depends="clean">
        <!-- FIXME: check whether docs are up to date -->
    </target>

    <!-- Generate formatted documentation. -->
    <target name="docs" depends="classes,version,bugdesc,checkdocs" unless="docs.uptodate" description="Make documentation">
        <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"/>
            <param name="bugdesc.user.language" value="en"/>
        </antcall>
        <antcall target="generatebugdesc">
            <param name="bugdesc.output" value="${docsrc.dir}/bugDescriptions_ja.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"/>
            <param name="bugdesc.user.language" value="ja"/>
        </antcall>
        <antcall target="generatebugdesc">
            <param name="bugdesc.output" value="${docsrc.dir}/bugDescriptions_fr.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"/>
            <param name="bugdesc.user.language" value="fr"/>
        </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="-Duser.language=${bugdesc.user.language}"/>
            <jvmarg value="-Dfindbugs.home=${basedir}"/>
            <jvmarg value="-Dfindbugs.bugdesc.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_BASE" value="${release.base}" />
            <filter token="VERSION" value="${release.number}" />
            <filter token="RELEASE_DATE" value="${release.date}" />
            <filter token="FINDBUGS_GIT_REVISION" value="${findbugs.git.revision}" />
            <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(&lt;&gt;){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.6.jar"/>
        <copy todir="${jnlp.dir}" file="${jar.dir}/jFormatString.jar"/>
        <copy todir="${jnlp.dir}" file="${jar.dir}/commons-lang-2.6.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"/>
                    </fileset>
                    <fileset dir="${plugin.dir}">
                        <include name="*.properties"/>
                        <include name="*.txt"/>
                    </fileset>
            </jar>
        <input message="Enter keystore password:"  addproperty="password"/>
        <signjar keystore="findbugs.keystore" alias="findbugs" storepass="${password}" keypass="${password}">
            <fileset dir="${jnlp.dir}">
                <include name="**/*.jar"/>
            </fileset>
        </signjar>
        <java classpathref="tools.classpath"
            classname="edu.umd.cs.findbugs.tools.CheckClassfileVersion"
            failonerror="true">
            <arg value="jnlp"/>
        </java>
    </target>

    <target name="sign" depends="jars">
        <input message="Enter keystore password:"  addproperty="password"/>
        <signjar keystore="findbugs.keystore" alias="findbugs" storepass="${password}" keypass="${password}">
            <fileset dir="${jnlp.dir}">
                <include name="**/*.jar"/>
            </fileset>
        </signjar>
        <java classpathref="tools.classpath"
            classname="edu.umd.cs.findbugs.tools.CheckClassfileVersion"
            failonerror="true">
            <arg value="jnlp"/>
        </java>
    </target>


    <!-- Generate binary and source distributions. -->
    <target name="dist" depends="clean,bindist,srcdist,web" description="Complete distribution except for jnlp"/>

    <!-- Generate binary distribution (both .zip and .tar.gz) -->
    <target name="bindist" depends="clean,validate,rebuild,docs" description="Binary distribution">
        <ant dir="${pluginsSrc.dir}/bugCollectionCloud" target="install" inheritAll="false" />
        <ant dir="${pluginsSrc.dir}/findbugsCommunalCloud" target="install" inheritAll="false" />
        <ant dir="${pluginsSrc.dir}/poweruser" target="install" inheritAll="false" />
        <ant dir="${pluginsSrc.dir}/noUpdateChecks" target="install" inheritAll="false" />
        <java classpathref="tools.classpath"
            classname="edu.umd.cs.findbugs.tools.CheckClassfileVersion"
            failonerror="true">
            <arg value="lib"/>
            <arg value="plugin"/>
        </java>
        <patternset id="bindist.miscfile.pats">
            <include name="README.txt"/>
            <include name="LICENSE*.txt"/>
            <include name="bin/*.bat"/>
            <include name="lib/buggy.icns"/>
            <include name="src/xsl/*.xsl"/> <!-- Bug #1187977 -->
        </patternset>

        <patternset id="bindist.jar.pats">
            <include name="lib/*.jar"/>
            <include name="plugin/webCloudClient.jar"/>
            <include name="plugin/findbugsCommunalCloud.jar"/>
            <include name="plugin/README"/>
            <include name="plugin"/>
            <include name="optionalPlugin/poweruser.jar"/>
            <include name="optionalPlugin/noUpdateChecks.jar"/>
            <include name="optionalPlugin/bugCollectionCloud.jar"/>
            <include name="optionalPlugin/README"/>
            <include name="optionalPlugin"/>
            <exclude name="lib/AppleJavaExtensions.jar"/>
            <exclude name="lib/junit.jar"/>
            <exclude name="lib/plastic.jar"/>
        </patternset>

        <patternset id="bindist2.jar.pats">
            <include name="lib/*.jar"/>
            <include name="plugin/noUpdateChecks.jar"/>
            <include name="plugin/README"/>
            <include name="plugin"/>
            <include name="optionalPlugin/webCloudClient.jar"/>
            <include name="optionalPlugin/findbugsCommunalCloud.jar"/>
            <include name="optionalPlugin/poweruser.jar"/>
            <include name="optionalPlugin/bugCollectionCloud.jar"/>
            <include name="optionalPlugin/README"/>
            <include name="optionalPlugin"/>
            <exclude name="lib/AppleJavaExtensions.jar"/>
            <exclude name="lib/junit.jar"/>
            <exclude name="lib/plastic.jar"/>
        </patternset>

        <patternset id="bindist.unixscript.pats">
            <include name="bin/*"/>
            <include name="bin/experimental/*"/>
            <include name="bin/deprecated/*"/>
            <exclude name="bin/*.bat"/>
        </patternset>

        <zip destfile="${build.dir}/findbugs-${release.number}.zip" compress="true">
            <zipfileset prefix="findbugs-${release.number}" dir="${basedir}">
                <patternset refid="bindist.miscfile.pats"/>
            </zipfileset>
            <zipfileset prefix="findbugs-${release.number}" dir="${basedir}" filemode="555">
                <patternset refid="bindist.unixscript.pats"/>
            </zipfileset>
            <zipfileset prefix="findbugs-${release.number}" dir="${basedir}">
                <patternset refid="bindist.jar.pats"/>
            </zipfileset>
            <zipfileset prefix="findbugs-${release.number}/doc" dir="${doc.dir}">
                <patternset refid="doc.src.pats"/>
                <patternset refid="doc.img.pats"/>
            </zipfileset>
        </zip>

        <tar destfile="${build.dir}/findbugs-${release.number}.tar.gz" compression="gzip">
            <tarfileset prefix="findbugs-${release.number}" dir="${basedir}">
                <patternset refid="bindist.miscfile.pats"/>
            </tarfileset>
            <tarfileset prefix="findbugs-${release.number}" dir="${basedir}" mode="555">
                <patternset refid="bindist.unixscript.pats"/>
            </tarfileset>
            <tarfileset prefix="findbugs-${release.number}" dir="${basedir}">
                <patternset refid="bindist.jar.pats"/>
            </tarfileset>
            <tarfileset prefix="findbugs-${release.number}/doc" dir="${doc.dir}">
                <patternset refid="doc.src.pats"/>
                <patternset refid="doc.img.pats"/>
            </tarfileset>
        </tar>

        <move file="optionalPlugin/noUpdateChecks.jar" todir="plugin"/>

        <zip destfile="${build.dir}/findbugs-noUpdateChecks-${release.number}.zip" compress="true">
            <zipfileset prefix="findbugs-${release.number}" dir="${basedir}">
                <patternset refid="bindist.miscfile.pats"/>
            </zipfileset>
            <zipfileset prefix="findbugs-${release.number}" dir="${basedir}" filemode="555">
                <patternset refid="bindist.unixscript.pats"/>
            </zipfileset>
            <zipfileset prefix="findbugs-${release.number}" dir="${basedir}">
                <patternset refid="bindist2.jar.pats"/>
            </zipfileset>
            <zipfileset prefix="findbugs-${release.number}/doc" dir="${doc.dir}">
                <patternset refid="doc.src.pats"/>
                <patternset refid="doc.img.pats"/>
            </zipfileset>
        </zip>

        <tar destfile="${build.dir}/findbugs-noUpdateChecks-${release.number}.tar.gz" compression="gzip">
            <tarfileset prefix="findbugs-${release.number}" dir="${basedir}">
                <patternset refid="bindist.miscfile.pats"/>
            </tarfileset>
            <tarfileset prefix="findbugs-${release.number}" dir="${basedir}" mode="555">
                <patternset refid="bindist.unixscript.pats"/>
            </tarfileset>
            <tarfileset prefix="findbugs-${release.number}" dir="${basedir}">
                <patternset refid="bindist2.jar.pats"/>
            </tarfileset>
            <tarfileset prefix="findbugs-${release.number}/doc" dir="${doc.dir}">
                <patternset refid="doc.src.pats"/>
                <patternset refid="doc.img.pats"/>
            </tarfileset>
        </tar>

        <move file="plugin/noUpdateChecks.jar" todir="optionalPlugin"/>

    </target>

    <!-- Build source distribution. -->
    <target name="srcdist" description="Source distribution" unless="doNotExportSrc" depends="version">
        <delete dir="${build.dir}/src"/>
        <mkdir dir="${build.dir}/src"/>
    <exec executable="git" spawn="true">
            <arg value="archive"/>
            <arg value="-o"/>
            <arg value="${build.dir}/src/findbugs-${release.number}-source.zip"/>
            <arg value="--prefix"/>
            <arg value="findbugs-${release.number}/"/>
            <arg value="HEAD"/>
    </exec>
    </target>

    <!-- Delete generated files. -->
    <target name="clean">
        <delete dir="${scripts.dir}"/>
        <delete dir="${build.dir}"/>
        <delete dir="${doc.dir}"/>
        <delete dir="${web.dir}"/>
        <delete dir="${apiDoc.dir}"/>
        <delete file="${engine.jar}"/>
        <delete dir="${annotationDoc.dir}"/>
        <delete file="${anttask.jar}" failonerror="false"/>
        <delete failonerror="false">
           <fileset dir="plugin" includes="*.jar"/>
        </delete>
        <mkdir dir="optionalPlugin"/> <!-- avoid an error on the next line -->
        <delete failonerror="false">
           <fileset dir="optionalPlugin" includes="*.jar"/>
        </delete>
    </target>

    <target name="init" depends="properties,getasm6,getbcel6">
        <mkdir dir="${scripts.dir}"/>
        <mkdir dir="${build.dir}"/>
        <mkdir dir="${doc.dir}"/>
        <mkdir dir="${web.dir}"/>
        <mkdir dir="${classes.dir}"/>
        <mkdir dir="${junitclasses.dir}"/>
        <mkdir dir="${apiDoc.dir}"/>
        <mkdir dir="${annotationDoc.dir}"/>
        <mkdir dir="${plugin.dir}"/>
        <mkdir dir="${sampleoutput.dir}"/>
    </target>

    <target name="properties">
      <!-- set different doc targets if the global doc property is set -->
      <condition property="webdocs.uptodate">
          <isset property="docs.uptodate"/>
       </condition>
      <condition property="manual.uptodate">
          <isset property="docs.uptodate"/>
       </condition>
      <condition property="pdfmanual.uptodate">
          <isset property="docs.uptodate"/>
       </condition>
      <condition property="apidoc.uptodate">
          <isset property="docs.uptodate"/>
       </condition>
    </target>

    <target name="apiJavadoc" depends="version" unless="apidoc.uptodate">
      <javadoc access="protected"
       author="true"
        packagenames="*"
        destdir="${apiDoc.dir}"
        doctitle="FindBugs API Documentation"
        Header="&lt;b&gt;FindBugs&amp;trade; ${release.number}&lt;/b&gt;"
        Windowtitle="FindBugs ${release.number} API"
        bottom="&lt;font size='-1'&gt;&lt;a href='http://findbugs.sourceforge.net/' target='_parent'&gt;FindBugs&lt;/a&gt;&amp;trade; is licensed under the LGPL. Copyright &amp;copy; 2006 University of Maryland.&lt;/font&gt;"
        nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar= "false" notree="false"
        sourcepath="src/java:src/gui:src/antTask" splitindex="true" use="true" version="true">
    <classpath refid="findbugs.classpath"/>
    </javadoc>
        </target>

    <target name="annotationJavadoc">
      <javadoc access="public"
       classpath="lib/bcel.jar:lib/junit.jar:lib/dom4j-1.6.1.jar:lib/jsr305.jar:lib/AppleJavaExtensions.jar"
        destdir="${annotationDoc.dir}"
        packagenames="edu.umd.cs.findbugs.annotations"
        doctitle="FindBugs Annotation Documentation"
        nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar= "false" notree="false"
        sourcepath="src/java:src/gui:src/antTask" splitindex="true" use="true" version="true"/>
        </target>

    <!-- Download snapshot of asm 6.0 with Java 9 support, built from SVN version 1818 from ASM_6_FUTURE branch,
        install resulting jar in lib.

        unless="asm6.exists"
        -->

    <scriptdef name="getAndCheckLibrary" language="javascript">
        <attribute name="url"/>
        <attribute name="path"/>
        <attribute name="checksum"/>
        <![CDATA[
           var URL = Java.type("java.net.URL");
           var File = Java.type("java.io.File");

           var path = attributes.get("path");
           var url = attributes.get("url");
           var checksum = attributes.get("checksum");
           print(path + " / " + url + " : " + checksum);

           var file = new File(path);

           check = project.createTask("checksum");
           check.setFile(file);
           check.setProperty(checksum);
           check.setVerifyproperty("check.result");

           result = false;
           if(file.exists()){
               print("File exists, verifying checksum...")
               result = check.eval();
               if(!result){
                  print("Checksum check failed, deleting!")
                  file.delete();
               } else {
                  print("Checksum check succeeded!")
               }
           }
           if(result == false){
               print("Downloading file...")
               get = project.createTask("get");
               get.setSrc(new URL(url));
               get.setDest(file)
               get.perform();
               result = check.eval();
               if(!result ){
                   fail = project.createTask("fail");
                   fail.setMessage("Download and checksum check failed for: " + path);
                   fail.perform();
               }
           }
        ]]>
    </scriptdef>

    <target name="getasm6" >
        <getAndCheckLibrary
            url="http://repository.ow2.org/nexus/service/local/repositories/releases/content/org/ow2/asm/asm-debug-all/6.0_ALPHA/asm-debug-all-6.0_ALPHA.jar"
            path="${basedir}/${jar.dir}/asm-debug-all-6.0-SNAPSHOT.jar"
            checksum="7df23eb7d67e31b18c2df741d1656f7b"
        />
    </target>

    <target name="getbcel6">
        <!-- BCEL 6.0 RC1, svn 14039 see
        http://mail-archives.apache.org/mod_mbox/commons-dev/201606.mbox/%3CCAB917R%2BmcbEarP5-ZBTDUTkt-xAwQCYagtmAbMqm3ub1KB5xDw%40mail.gmail.com%3E
         -->
        <getAndCheckLibrary
            url="https://repository.apache.org/content/repositories/orgapachecommons-1177/org/apache/bcel/bcel/6.0/bcel-6.0.jar"
            path="${basedir}/${jar.dir}/bcel-6.0-SNAPSHOT.jar"
            checksum="c5581905c94bb3e81e09b444229bf63e"
        />
    </target>

    <!-- Download, patch, and build a modified BCEL 5.2.  Install resulting bcel.jar in lib. -->
    <target name="patchbcel">
        <delete dir="${build.dir}/bcel-5.2-src"/>
        <delete file="${build.dir}/bcel-5.2-src.zip"/>
        <get src="http://www.apache.org/dist/jakarta/bcel/source/bcel-5.2-src.zip"
             dest="${build.dir}/bcel-5.2-src.zip"
         verbose="on"/>
        <unzip src="${build.dir}/bcel-5.2-src.zip" dest="${build.dir}/bcel-5.2-src"/>
        <delete file="${build.dir}/bcel-5.2-src/bcel-5.2/build.xml"/>
        <patch patchfile="${patch.dir}/bcel.diff" dir="${build.dir}/bcel-5.2-src/bcel-5.2" strip="7"/>
        <ant dir="${build.dir}/bcel-5.2-src/bcel-5.2" inheritAll="false"/>
        <copy file="${build.dir}/bcel-5.2-src/bcel-5.2/bcel.jar" tofile="${jar.dir}/bcel.jar"/>
    </target>

    <!--
        Rebuild jar305.jar.
        JSR305-ri must be checked out "next to" findbugs,
        and must have its classes built.
    -->
    <target name="jsr305.jar">
        <jar destfile="${jar.dir}/jsr305.jar">
            <fileset dir="${jsr305.dir}/build/classes">
                <include name="**/*.class"/>
            </fileset>
            <fileset dir="${jsr305.dir}/src/main/java">
                <include name="**/*.java"/>
            </fileset>
        </jar>
    </target>

  <target name="srcJar" description="build source jar file">
   <jar jarfile="findbugs-src.jar" compress="true">
    <fileset dir="${src.dir}"/>
    <fileset dir="${src5.dir}"/>
    <fileset dir="${toolsrc.dir}"/>
    <fileset dir="${anttasksrc.dir}"/>
    <fileset dir="${junitsrc.dir}"/>
    <fileset dir="${basedir}">
      <include name="LICENSE*.txt"/>
    </fileset>
  </jar>

</target>
</project>

<!-- vim:set ts=4: -->