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
|
<?xml version="1.0" encoding="utf-8"?>
<!-- ** build.xml - main ant file for JOSM
**
** To build run
** ant clean
** ant dist
** This will create 'josm-custom.jar' in directory 'dist'. See also
** https://josm.openstreetmap.de/wiki/DevelopersGuide/CreateBuild
**
-->
<project name="josm" default="dist"
xmlns:as="antlib:org.codehaus.mojo.animal_sniffer"
xmlns:if="ant:if"
xmlns:ivy="antlib:org.apache.ivy.ant"
xmlns:jacoco="antlib:org.jacoco.ant"
xmlns:unless="ant:unless"
>
<target name="init-ivy" description="Initialize dependency management system Apache Ivy">
<property name="ivy.version" value="2.5.1"/>
<dirname property="base.dir" file="${ant.file.josm}"/>
<property name="lib.dir" location="${base.dir}/lib"/>
<property name="tools.dir" location="${base.dir}/tools"/>
<property name="tools.ivy" location="${tools.dir}/ivy.xml"/>
<property name="ivy.jar.dir" location="${tools.dir}/ivy"/>
<property name="ivy.jar.file" location="${ivy.jar.dir}/ivy-${ivy.version}.jar"/>
<!--
<mkdir dir="${ivy.jar.dir}"/>
<get src="https://josm.openstreetmap.de/repository/public/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar"
dest="${ivy.jar.file}"
skipexisting="true"
/>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.jar.file}"/>
-->
</target>
<target name="init-properties" description="Initialize properties for the build">
<property environment="env"/>
<!-- Load properties in a target and not at top level, so this build file can be
imported from an IDE ant file (Netbeans) without messing up IDE properties.
When imported from another file, ${basedir} will point to the parent directory
of the importing ant file. Use ${base.dir} instead, which is always the parent
directory of this file. -->
<dirname property="base.dir" file="${ant.file.josm}"/>
<property name="test.dir" location="${base.dir}/test"/>
<property name="src.dir" location="${base.dir}/src"/>
<condition property="sign.jar">
<and>
<isset property="env.SIGN_ALIAS"/>
<isset property="env.SIGN_KEYSTORE"/>
<isset property="env.SIGN_KEYPASS"/>
<isset property="env.SIGN_STOREPASS"/>
<isset property="env.SIGN_TSA"/>
</and>
</condition>
<condition property="noJavaFX">
<or>
<isset property="env.JOSM_NOJAVAFX"/>
<not>
<available classname="javafx.scene.media.Media"/>
</not>
</or>
</condition>
<available property="svn.present" file="${base.dir}/.svn"/>
<available property="git.present" file="${base.dir}/.git"/>
<property name="build.dir" location="${base.dir}/build"/>
<property name="dist.dir" location="${base.dir}/dist"/>
<property name="resources.dir" location="${base.dir}/resources"/>
<property name="modules.dir" location="${dist.dir}/modules"/>
<property name="tools.dir" location="${base.dir}/tools"/>
<property name="pmd.dir" location="${tools.dir}/pmd"/>
<property name="checkstyle.dir" location="${tools.dir}/checkstyle"/>
<property name="spotbugs.dir" location="${tools.dir}/spotbugs"/>
<property name="javacc.home" location="${tools.dir}"/>
<property name="mapcss.dir" location="${src.dir}/org/openstreetmap/josm/gui/mappaint/mapcss"/>
<property name="proj-build.dir" location="${base.dir}/build2"/>
<property name="script-build.dir" location="${base.dir}/build2"/>
<property name="epsg.output" location="${resources.dir}/data/projection/custom-epsg"/>
<property name="antcontrib.jar" value="/usr/share/java/ant-contrib.jar"/>
<property name="commons-lang3.jar" location="${tools.dir}/commons-lang3.jar"/>
<property name="dist.jar" location="${dist.dir}/josm-custom.jar"/>
<property name="dist-optimized.jar" location="${dist.dir}/josm-custom-optimized.jar"/>
<property name="dist-sources.jar" location="${dist.dir}/josm-custom-sources.jar"/>
<!-- When incrementing the minimum Java version, don't forget to update the Java versions users will update to
(PlatformHook#getJavaUrl, PlatformHook#startupSanityChecks and PlatformHook#warnSoonToBeUnsupportedJava) -->
<property name="java.lang.version" value="11" />
<property name="test.headless" value="true" />
<property name="noErrorProne" value="false"/>
<property name="jacoco.includes" value="org.openstreetmap.josm.*" />
<property name="jacoco.inclbootstrapclasses" value="false" />
<property name="jacoco.inclnolocationclasses" value="false" />
<property name="junit.printsummary" value="on" />
<property name="default-junit-includes" value="**/*Test.class"/>
<property name="default-junitIT-includes" value="**/*TestIT.class"/>
<!-- build parameter: compression level (ant -Dclevel=N)
N ranges from 0 (no compression) to 9 (maximum compression)
default: 9 -->
<condition property="clevel" value="${clevel}" else="9">
<isset property="clevel"/>
</condition>
<!-- For Java specific stuff by version -->
<!-- <condition property="isJava12"><matches string="${ant.java.version}" pattern="1[2-9]|[2-9][0-9]" /></condition> -->
<condition property="isJava13"><matches string="${ant.java.version}" pattern="1[3-9]|[2-9][0-9]" /></condition>
<!-- <condition property="isJava14"><matches string="${ant.java.version}" pattern="1[4-9]|[2-9][0-9]" /></condition> -->
<!-- <condition property="isJava15"><matches string="${ant.java.version}" pattern="1[5-9]|[2-9][0-9]" /></condition> -->
<condition property="isJava16"><matches string="${ant.java.version}" pattern="1[6-9]|[2-9][0-9]" /></condition>
<condition property="isJava17"><matches string="${ant.java.version}" pattern="1[7-9]|[2-9][0-9]" /></condition>
<!-- <condition property="isJava18"><matches string="${ant.java.version}" pattern="1[8-9]|[2-9][0-9]" /></condition> -->
<condition property="isJava19"><matches string="${ant.java.version}" pattern="19|[2-9][0-9]" /></condition>
<!-- <condition property="isJava20"><matches string="${ant.java.version}" pattern="[2-9][0-9]" /></condition> -->
<condition property="isJava21"><matches string="${ant.java.version}" pattern="2[1-9]|[3-9][0-9]" /></condition>
<!-- Disable jacoco on Java 19+, see https://github.com/jacoco/jacoco/pull/1282 -->
<condition property="coverageByDefault">
<not>
<isset property="isJava19"/>
</not>
</condition>
<property name="java.library.dir" value="jmods" />
<!-- Java classpath addition (all jar files to compile tests with this) -->
<path id="classpath">
<fileset dir="/usr/share/java">
<include name="gettext-commons.jar"/>
<include name="jmapviewer.jar"/>
</fileset>
</path>
<property name="classpathprop-colon" refid="classpath"/>
</target>
<target name="init-svn-revision-xml" if="svn.present" depends="init-properties"
description="Initialize the REVISION.XML file from SVN information">
<exec append="false" output="${base.dir}/REVISION.XML" executable="svn" dir="${base.dir}" resultproperty="svn.info.result">
<env key="LANG" value="C"/>
<arg value="info"/>
<arg value="--xml"/>
<arg value="."/>
</exec>
</target>
<target name="init-git-revision-xml" if="git.present" depends="init-properties"
description="Initialize the REVISION.XML file from git information">
<exec append="false" output="${base.dir}/REVISION.XML" executable="git" dir="${base.dir}">
<arg value="log"/>
<arg value="-1"/>
<arg value="--grep=git-svn-id"/>
<!--
%B: raw body (unwrapped subject and body)
%n: new line
%ai: author date, ISO 8601 format
-->
<arg value="--pretty=format:%B%n%ai"/>
<arg value="HEAD"/>
</exec>
<replaceregexp file="${base.dir}/REVISION.XML" flags="s"
match=".*git-svn-id: [^@]*@([0-9]+).*(\d{4}-\d{2}-\d{2}.\d{2}\:\d{2}\:\d{2}\s*[+-]\d{2}:?\d{2})\s*$"
replace="<info><entry><commit revision="\1"><date>\2</date></commit></entry></info>"/>
</target>
<target name="create-revision"
description="Create the REVISION file to be included in the distribution based on the latest SVN/Git commit">
<xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
<tstamp>
<format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss"/>
</tstamp>
<property name="version.entry.commit.revision" value="UNKNOWN"/>
<property name="version.entry.commit.date" value="UNKNOWN"/>
<!-- add Build-Name: ... when making special builds, e.g. DEBIAN -->
<echo file="${resources.dir}/REVISION">
# automatically generated by JOSM build.xml - do not edit
Revision: ${version.entry.commit.revision}
Build-Date: ${build.tstamp}
Is-Local-Build: false
Build-Name: Debian
Debian-Release: ${debian.version}
</echo>
</target>
<target name="check-schemas" unless="check-schemas.notRequired" depends="init-properties"
description="Check internal XML files against their XSD">
<schemavalidate file="${resources.dir}/data/defaultpresets.xml" >
<schema namespace="http://josm.openstreetmap.de/tagging-preset-1.0" file="${resources.dir}/data/tagging-preset.xsd" />
</schemavalidate>
</target>
<target name="dist" depends="compile,epsg,copy-resources,check-schemas"
description="Main target that builds JOSM and checks XML against schemas">
<echo>Revision ${version.entry.commit.revision}</echo>
<copy file="CONTRIBUTION" todir="${build.dir}"/>
<copy file="README" todir="${build.dir}"/>
<copy file="LICENSE" todir="${build.dir}"/>
<copy file="gpl-2.0.txt" todir="${build.dir}"/>
<copy file="gpl-3.0.txt" todir="${build.dir}"/>
<!-- create josm-custom.jar -->
<propertyregex property="classpathprop" input="${classpathprop-colon}" global="true" regexp=":" replace=" "/>
<jar destfile="${dist.jar}" basedir="${build.dir}" level="${clevel}">
<!-- add attribute excludes="**/*BZip2*,**/*Bzip2*" to create a non-bzip2 supporting jar -->
<manifest>
<attribute name="Main-class" value="org.openstreetmap.josm.gui.MainApplication"/>
<attribute name="Main-Version" value="${version.entry.commit.revision}"/>
<attribute name="Main-Date" value="${version.entry.commit.date}"/>
<attribute name="Permissions" value="all-permissions"/>
<attribute name="Codebase" value="josm.openstreetmap.de"/>
<attribute name="Application-Name" value="JOSM - Java OpenStreetMap Editor"/>
<attribute name="Debian-Release" value="${debian.version}"/>
<attribute name="Class-Path" value="${classpathprop}"/>
<!-- Java 9 stuff. Entries are safely ignored by Java 8 -->
<attribute name="Add-Exports" value="java.base/sun.security.action java.desktop/com.apple.eawt java.desktop/com.sun.imageio.spi java.desktop/com.sun.imageio.plugins.jpeg javafx.graphics/com.sun.javafx.application jdk.deploy/com.sun.deploy.config" />
<attribute name="Add-Opens" value="java.base/java.lang java.base/java.nio java.base/jdk.internal.loader java.base/jdk.internal.ref java.desktop/javax.imageio.spi java.desktop/javax.swing.text.html java.prefs/java.util.prefs" />
<!-- Indicate that this jar may have version specific classes. Only used in Java9+. -->
<attribute name="Multi-Release" value="true"/>
</manifest>
<service type="jakarta.json.spi.JsonProvider">
<provider classname="org.eclipse.parsson.JsonProviderImpl"/>
</service>
<service type="org.apache.commons.jcs3.log.LogFactory">
<provider classname="org.apache.commons.jcs3.log.JulLogFactory"/>
<provider classname="org.apache.commons.jcs3.log.Log4j2Factory"/>
</service>
</jar>
<!-- Sign jar if all environment variables are set -->
<signjar jar="${dist.jar}" alias="${env.SIGN_ALIAS}" tsaurl="${env.SIGN_TSA}"
keystore="${env.SIGN_KEYSTORE}" storepass="${env.SIGN_STOREPASS}" keypass="${env.SIGN_KEYPASS}" if:set="sign.jar" />
</target>
<target name="javacc" depends="init" unless="javacc.notRequired" description="Compile the MapCSS compiler">
<mkdir dir="${mapcss.dir}/parsergen"/>
<exec append="false" executable="javacc" failifexecutionfails="true">
<arg value="-DEBUG_PARSER=false"/>
<arg value="-DEBUG_TOKEN_MANAGER=false"/>
<arg value="-JDK_VERSION=1.${java.lang.version}"/>
<arg value="-GRAMMAR_ENCODING=UTF-8"/>
<arg value="-UNICODE_INPUT=true"/>
<arg value="-OUTPUT_DIRECTORY=${mapcss.dir}/parsergen"/>
<arg value="${mapcss.dir}/MapCSSParser.jj"/>
</exec>
</target>
<target name="javacc-openinghoursparser" depends="init" unless="javacc.notRequired">
<mkdir dir="${src.dir}/ch/poole/openinghoursparser/parsergen"/>
<exec append="false" executable="javacc" failifexecutionfails="true">
<arg value="-DEBUG_PARSER=false"/>
<arg value="-DEBUG_TOKEN_MANAGER=false"/>
<arg value="-JDK_VERSION=1.${java.lang.version}"/>
<arg value="-GRAMMAR_ENCODING=UTF-8"/>
<arg value="-UNICODE_INPUT=true"/>
<arg value="-OUTPUT_DIRECTORY=${src.dir}/ch/poole/openinghoursparser"/>
<arg value="${src.dir}/ch/poole/openinghoursparser/OpeningHoursParser.jj"/>
</exec>
</target>
<target name="compile-cots" depends="init,javacc-openinghoursparser" description="Compile third-party dependencies not retrieved with Ivy">
<!-- COTS -->
<javac srcdir="${src.dir}" classpathref="classpath"
includes="ch/**,com/**,jakarta/**,org/apache/commons/**,org/eclipse/**,org/jetbrains/annotations/**,org/tukaani/**"
excludes="**/package-info.java" nowarn="on" encoding="iso-8859-1"
destdir="${build.dir}" release="${java.lang.version}" debug="on" includeAntRuntime="false">
<!-- get rid of "internal proprietary API" warning -->
<compilerarg value="-XDignore.symbol.file"/>
<exclude name="ch/poole/openinghoursparser/DataTest.java"/>
<exclude name="ch/poole/openinghoursparser/UnitTest.java"/>
<exclude name="com/drew/imaging/FileTypeDetector*"/>
<exclude name="com/drew/imaging/ImageMetadataReader*"/>
<exclude name="com/drew/imaging/avi/**"/>
<exclude name="com/drew/imaging/bmp/**"/>
<exclude name="com/drew/imaging/eps/**"/>
<exclude name="com/drew/imaging/gif/**"/>
<exclude name="com/drew/imaging/heif/**"/>
<exclude name="com/drew/imaging/ico/**"/>
<exclude name="com/drew/imaging/mp3/**"/>
<exclude name="com/drew/imaging/mp4/**"/>
<exclude name="com/drew/imaging/pcx/**"/>
<exclude name="com/drew/imaging/psd/**"/>
<exclude name="com/drew/imaging/quicktime/**"/>
<exclude name="com/drew/imaging/raf/**"/>
<exclude name="com/drew/imaging/riff/**"/>
<exclude name="com/drew/imaging/wav/**"/>
<exclude name="com/drew/imaging/webp/**"/>
<exclude name="com/drew/metadata/avi/**"/>
<exclude name="com/drew/metadata/bmp/**"/>
<exclude name="com/drew/metadata/eps/**"/>
<exclude name="com/drew/metadata/gif/**"/>
<exclude name="com/drew/metadata/heif/**"/>
<exclude name="com/drew/metadata/ico/**"/>
<exclude name="com/drew/metadata/mov/**"/>
<exclude name="com/drew/metadata/mp3/**"/>
<exclude name="com/drew/metadata/mp4/**"/>
<exclude name="com/drew/metadata/pcx/**"/>
<exclude name="com/drew/metadata/wav/**"/>
<exclude name="com/drew/metadata/webp/**"/>
<exclude name="com/drew/tools/**"/>
<exclude name="com/kitfox/svg/app/ant/**"/>
<exclude name="com/kitfox/svg/app/*Dialog*"/>
<exclude name="com/kitfox/svg/app/*Frame*"/>
<exclude name="com/kitfox/svg/app/*Player*"/>
<exclude name="com/kitfox/svg/app/*Viewer*"/>
<exclude name="org/apache/commons/compress/PasswordRequiredException*"/>
<exclude name="org/apache/commons/compress/archivers/**"/>
<exclude name="org/apache/commons/compress/changes/**"/>
<exclude name="org/apache/commons/compress/compressors/bzip2/BZip2Utils*"/>
<exclude name="org/apache/commons/compress/compressors/brotli/**"/>
<exclude name="org/apache/commons/compress/compressors/CompressorStreamFactory*"/>
<exclude name="org/apache/commons/compress/compressors/CompressorStreamProvider*"/>
<exclude name="org/apache/commons/compress/compressors/CompressorException*"/>
<exclude name="org/apache/commons/compress/compressors/FileNameUtil*"/>
<exclude name="org/apache/commons/compress/compressors/deflate/**"/>
<exclude name="org/apache/commons/compress/compressors/gzip/**"/>
<exclude name="org/apache/commons/compress/compressors/lz4/**"/>
<exclude name="org/apache/commons/compress/compressors/lzma/**"/>
<exclude name="org/apache/commons/compress/compressors/lz77support/**"/>
<exclude name="org/apache/commons/compress/compressors/pack200/**"/>
<exclude name="org/apache/commons/compress/compressors/snappy/**"/>
<exclude name="org/apache/commons/compress/compressors/xz/XZUtils*"/>
<exclude name="org/apache/commons/compress/compressors/z/**"/>
<exclude name="org/apache/commons/compress/compressors/zstandard/**"/>
<exclude name="org/apache/commons/compress/java/util/jar/Pack200*"/>
<exclude name="org/apache/commons/compress/harmony/pack200/**"/>
<exclude name="org/apache/commons/compress/harmony/unpack200/**"/>
<exclude name="org/apache/commons/compress/parallel/**"/>
<exclude name="org/apache/commons/compress/utils/ArchiveUtils*"/>
<exclude name="org/apache/commons/jcs3/auxiliary/disk/jdbc/**"/>
<exclude name="org/apache/commons/jcs3/auxiliary/remote/http/client/**"/>
<exclude name="org/apache/commons/jcs3/auxiliary/remote/http/server/RemoteHttpCacheServlet*"/>
<exclude name="org/apache/commons/jcs3/auxiliary/remote/server/RemoteCacheStartupServlet*"/>
<exclude name="org/apache/commons/jcs3/log/Log4j2Factory*"/>
<exclude name="org/apache/commons/jcs3/log/Log4j2LogAdapter*"/>
<exclude name="org/apache/commons/jcs3/utils/servlet/**"/>
<exclude name="org/jetbrains/annotations/Debug.java"/>
<exclude name="org/openstreetmap/gui/jmapviewer/Demo*"/>
</javac>
<copy todir="${build.dir}">
<fileset dir="${src.dir}" includes="ch/poole/**/*.properties" excludes="**/*.java"/>
</copy>
<!-- I18N -->
<ant dir="i18n" />
</target>
<macrodef name="call-javac-compile">
<attribute name="sourcepath" default=""/>
<attribute name="srcdir" default="${src.dir}"/>
<attribute name="fork" default="yes"/>
<attribute name="excludes" default=""/>
<attribute name="includes" default="**/*.java"/>
<attribute name="destdir" default="${build.dir}"/>
<attribute name="debug" default="on"/>
<attribute name="includeantruntime" default="false"/>
<attribute name="encoding" default="UTF-8"/>
<attribute name="release" default="${java.lang.version}"/>
<element name="cp-elements" optional="true"/>
<sequential>
<javac sourcepath="@{sourcepath}" srcdir="@{srcdir}" fork="@{fork}"
includes="@{includes}" excludes="@{excludes}" destdir="@{destdir}" release="@{release}"
debug="@{debug}" includeantruntime="@{includeantruntime}" encoding="@{encoding}">
<compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
<compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
<compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
<compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
<compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
<compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
<compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
<compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED" if:set="isJava16" unless:set="noErrorProne"/>
<compilerarg line="-XDcompilePolicy=simple"/>
<compilerarg value="-processorpath"/>
<compilerarg value="${toString:errorprone.classpath}:${toString:semanticdb.classpath}"/>
<compilerarg value="-Xlint:cast"/>
<compilerarg value="-Xlint:deprecation"/>
<compilerarg value="-Xlint:dep-ann"/>
<compilerarg value="-Xlint:divzero"/>
<compilerarg value="-Xlint:empty"/>
<compilerarg value="-Xlint:finally"/>
<compilerarg value="-Xlint:overrides"/>
<!--<compilerarg value="-Xlint:rawtypes"/>-->
<compilerarg value="-Xlint:static"/>
<compilerarg value="-Xlint:try"/>
<compilerarg value="-Xlint:unchecked"/>
<!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
<compilerarg value="-XDignore.symbol.file"/>
<!-- -XepExcludedPaths:.*/parsergen/.*: see #16860 - Resolve JavaCC using Apache Ivy -->
<!-- ReferenceEquality: see #12472, fix #13230, fix #13225, fix #13228 - disable ReferenceEquality warning + partial revert of r10656 + r10659, causes too much problems -->
<!-- FutureReturnValueIgnored: update to error_prone 2.0.18 (disabled on purpose?) -->
<!-- JdkObsolete: see #11924 - see #15560 - support jdk10+ in build.xml, update to proguard 6.0beta1 and error_prone 2.1.2 (disabled due to crashes) -->
<!-- EqualsGetClass, UndefinedEquals: see #16498 - update to error_prone 2.3.2-20180817.184126-35 to test JDK 12 compatibility. (disabled due to crashes?) -->
<!-- BadImport, AnnotateFormatMethod: see #17516 - update to error-prone 2.3.5-SNAPSHOT plus following patches for Java 13 compatibility (disabled due to crashes?) -->
<!-- JavaUtilDate, DoNotCallSuggester, BanSerializableRead: see #19724 - update to error-prone 2.5.1, checkstyle 8.36, spotbugs 4.2.1 (disabled due to crashes?) -->
<!-- InlineMeSuggester: See #20522 - Disable https://errorprone.info/bugpattern/InlineMeSuggester (maybe it crashed?) -->
<!-- LongDoubleConversion: Disable due to conflicting with Sonar settings -->
<compilerarg value="-Xplugin:ErrorProne -XepExcludedPaths:.*/parsergen/.* -Xep:ReferenceEquality:OFF -Xep:FutureReturnValueIgnored:OFF -Xep:JdkObsolete:OFF -Xep:EqualsGetClass:OFF -Xep:UndefinedEquals:OFF -Xep:BadImport:OFF -Xep:AnnotateFormatMethod:OFF -Xep:JavaUtilDate:OFF -Xep:DoNotCallSuggester:OFF -Xep:BanSerializableRead:OFF -Xep:InlineMeSuggester:OFF -Xep:LongDoubleConversion:OFF" unless:set="noErrorProne"/>
<compilerarg line="-Xmaxwarns 1000"/>
<compilerarg value="-Xplugin:semanticdb -sourceroot:@{srcdir} -targetroot:${build.dir}/semanticdb" if:set="lsif" />
<classpath>
<path refid="runtime.path"/>
<cp-elements/>
</classpath>
</javac>
</sequential>
</macrodef>
<macrodef name="call-javac-compile-mrjar">
<!--
See https://openjdk.java.net/jeps/238 for the specification
The big bits are that the version specific files should be in META-INF/versions/${javaVersion}/
using the same package scheme. And that the files in the version specific directories are *full*
implementations of the class they are replacing.
-->
<attribute name="release"/>
<sequential>
<condition property="java@{release}DirExists">
<and>
<isset property="isJava@{release}"/>
<resourceexists>
<file file="${src.dir}/main/java-@{release}"/>
</resourceexists>
</and>
</condition>
<echo message="Compiling Java @{release} files" if:true="${java@{release}DirExists}"/>
<mkdir dir="${build.dir}/META-INF/versions/@{release}" if:true="${java@{release}DirExists}"/>
<call-javac-compile srcdir="${src.dir}/main/java-@{release}" destdir="${build.dir}/META-INF/versions/@{release}" release="@{release}" if:true="${java@{release}DirExists}">
<cp-elements>
<pathelement path="${build.dir}"/>
</cp-elements>
</call-javac-compile>
</sequential>
</macrodef>
<target name="compile" depends="init,javacc,compile-cots" unless="compile.notRequired" description="Compile JOSM">
<!--
<ivy:cachepath log="download-only" file="${tools.ivy}" pathid="errorprone.classpath" conf="errorprone"/>
<ivy:cachepath log="download-only" file="${tools.ivy}" pathid="errorprone_javac.classpath" conf="errorprone_javac"/>
-->
<!-- JOSM -->
<!--
<call-javac-compile excludes="**/package-info.java,**/module-info.java,main/**" release="${java.lang.version}"/>
-->
<!-- Java 11 specific files (2018-09 LTS) -->
<!--
<call-javac-compile-mrjar release="11"/>
-->
<!-- Java 17 specific files (2021-09 LTS) -->
<!--
<call-javac-compile-mrjar release="17"/>
-->
<!-- Java 21 specific files (2023-09 LTS) -->
<!--
<call-javac-compile-mrjar release="21"/>
-->
<javac sourcepath="" srcdir="${src.dir}" fork="yes" classpathref="classpath"
excludes="ch/**,com/**,jakarta/**,org/apache/commons/**,org/eclipse/**,org/jetbrains/annotations/**,org/openstreetmap/gui/jmapviewer/**,org/tukaani/**,**/package-info.java"
destdir="${build.dir}" release="${java.lang.version}" debug="on" includeantruntime="false" encoding="UTF-8">
<compilerarg value="-Xlint:cast"/>
<compilerarg value="-Xlint:deprecation"/>
<compilerarg value="-Xlint:dep-ann"/>
<compilerarg value="-Xlint:divzero"/>
<compilerarg value="-Xlint:empty"/>
<compilerarg value="-Xlint:finally"/>
<compilerarg value="-Xlint:overrides"/>
<!--<compilerarg value="-Xlint:rawtypes"/>-->
<compilerarg value="-Xlint:static"/>
<compilerarg value="-Xlint:try"/>
<compilerarg value="-Xlint:unchecked"/>
<!-- Undocumented argument to ignore "Sun internal proprietary API" warning, see http://stackoverflow.com/a/13862308/2257172 -->
<compilerarg value="-XDignore.symbol.file"/>
</javac>
</target>
<target name="create-resources" depends="create-revision" description="Create generated resource files">
<copy todir="${resources.dir}">
<file file="CONTRIBUTION"/>
<file file="README"/>
<file file="LICENSE"/>
</copy>
</target>
<target name="copy-resources" depends="create-resources" description="Copy resource files to build directory">
<copy todir="build" failonerror="no" includeemptydirs="no">
<fileset dir="${resources.dir}"/>
</copy>
</target>
<target name="init" depends="init-properties,resolve" description="Initialize the build">
<uptodate property="javacc.notRequired" targetfile="${mapcss.dir}/parsergen/MapCSSParser.java" >
<srcfiles dir="${mapcss.dir}" includes="MapCSSParser.jj"/>
</uptodate>
<uptodate property="epsg.notRequired" targetfile="${epsg.output}">
<srcfiles file="${base.dir}/scripts/BuildProjectionDefinitions.java"/>
<srcfiles dir="nodist/data/projection"/>
</uptodate>
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${antcontrib.jar}"/>
</target>
<target name="javadoc" depends="init" description="Generate API documentation from JOSM source files">
<javadoc destdir="javadoc"
sourcepath="${src.dir}"
classpathref="compile.path"
encoding="UTF-8"
packagenames="org.openstreetmap.josm.*"
excludepackagenames="org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.*"
windowtitle="JOSM"
use="true"
private="true"
linksource="true"
author="false">
<link href="https://docs.oracle.com/en/java/javase/11/docs/api" />
<doctitle><![CDATA[<h2>
<img src="https://josm.openstreetmap.de/svn/trunk/nodist/images/logo/header.png" style="vertical-align: middle;" alt="JOSM">
— Javadoc
</h2>]]></doctitle>
<bottom><![CDATA[<a href="https://josm.openstreetmap.de/">JOSM</a>]]></bottom>
<!-- Disable HTML checking until we switch to Java13+, see https://bugs.openjdk.java.net/browse/JDK-8223552 -->
<arg value="-Xdoclint:-html" if:set="isJava13" />
<arg value="-html5" />
<arg value="--add-exports" unless:set="noJavaFX" />
<arg value="javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" unless:set="noJavaFX" />
</javadoc>
</target>
<target name="clean" depends="init-properties" description="Delete all build files">
<delete dir="${build.dir}"/>
<delete dir="${proj-build.dir}"/>
<delete dir="${script-build.dir}"/>
<delete dir="${dist.dir}"/>
<delete dir="${mapcss.dir}/parsergen"/>
<delete file="${src.dir}/org/w3/_2001/xmlschema/Adapter1.java"/>
<delete dir="${src.dir}/org/openstreetmap/josm/data/imagery/types"/>
<delete file="${epsg.output}"/>
<delete file="${pmd.dir}/cache"/>
<ant target="clean" dir="i18n"/>
</target>
<macrodef name="init-test-preferences">
<attribute name="testfamily"/>
<sequential>
<copy file="${test.dir}/config/preferences.template.xml" tofile="${test.dir}/config/@{testfamily}-josm.home/preferences.xml"/>
<replace file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_USERNAME@" value="${osm.username}"/>
<replace file="${test.dir}/config/@{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_PASSWORD@" value="${osm.password}"/>
</sequential>
</macrodef>
<target name="test-init" depends="init" description="Initialize the tests">
<mkdir dir="${test.dir}/build"/>
<mkdir dir="${test.dir}/build/unit"/>
<mkdir dir="${test.dir}/build/functional"/>
<mkdir dir="${test.dir}/build/performance"/>
<mkdir dir="${test.dir}/report"/>
<init-test-preferences testfamily="unit"/>
<init-test-preferences testfamily="functional"/>
<init-test-preferences testfamily="performance"/>
<path id="test.classpath">
<path refid="test.path"/>
<pathelement path="${build.dir}"/>
<pathelement path="${resources.dir}"/>
</path>
<ivy:retrieve log="download-only" pattern="${test.dir}/lib/[artifact].[ext]" conf="junit5-system-exit"/>
<ivy:retrieve log="download-only" pattern="${test.dir}/lib/[artifact].[ext]" conf="jmockit"/>
<ivy:retrieve log="download-only" pattern="${tools.dir}/[artifact].[ext]" conf="commonslang"/>
<ivy:retrieve log="download-only" pattern="${tools.dir}/[conf].[ext]" conf="jacocoant"/>
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="${tools.dir}/jacocoant.jar" />
</target>
<target name="test-clean" depends="init-properties" description="Delete all built test files">
<delete dir="${test.dir}/build"/>
<delete dir="${test.dir}/report"/>
<delete file="${test.dir}/jacoco.exec" />
<delete file="${test.dir}/jacocoIT.exec" />
<delete file="${test.dir}/config/unit-josm.home" failonerror="false"/>
<delete file="${test.dir}/config/functional-josm.home" failonerror="false"/>
<delete file="${test.dir}/config/performance-josm.home" failonerror="false"/>
</target>
<macrodef name="call-javac">
<attribute name="testfamily"/>
<element name="cp-elements"/>
<sequential>
<javac srcdir="${test.dir}/@{testfamily}" destdir="${test.dir}/build/@{testfamily}"
release="${java.lang.version}" debug="on"
includeantruntime="false" encoding="UTF-8">
<compilerarg value="-Xlint:all"/>
<compilerarg value="-Xlint:-path"/><!-- Suppress "bad path element .../xmpcore-6.0.6.jar: no such file or directory" warning, see https://github.com/drewnoakes/metadata-extractor/pull/483 -->
<compilerarg value="-Xlint:-serial"/>
<classpath>
<cp-elements/>
</classpath>
</javac>
<copy todir="${test.dir}/build/@{testfamily}/META-INF">
<fileset dir="${test.dir}/data/META-INF"/>
</copy>
</sequential>
</macrodef>
<target name="test-compile" depends="test-init,compile,extract-libraries,epsg,copy-resources" description="Compile all tests">
<call-javac testfamily="unit">
<cp-elements>
<path refid="test.classpath"/>
</cp-elements>
</call-javac>
<call-javac testfamily="functional">
<cp-elements>
<path refid="test.classpath"/>
<pathelement path="${test.dir}/build/unit"/>
</cp-elements>
</call-javac>
<call-javac testfamily="performance">
<cp-elements>
<path refid="test.classpath"/>
<pathelement path="${test.dir}/build/unit"/>
</cp-elements>
</call-javac>
</target>
<macrodef name="call-junit">
<attribute name="testfamily"/>
<attribute name="testITsuffix" default=""/>
<attribute name="coverage" default="${coverageByDefault}"/>
<attribute name="includes" default="${default-junit@{testITsuffix}-includes}"/>
<attribute name="excludes" default="${default-junit@{testITsuffix}-excludes}"/>
<sequential>
<echo message="Running @{testfamily}@{testITsuffix} tests with JUnit"/>
<jacoco:agent destfile="${test.dir}/jacoco@{testITsuffix}.exec" enabled="@{coverage}" includes="${jacoco.includes}" dumponexit="true"
inclbootstrapclasses="${jacoco.inclbootstrapclasses}" inclnolocationclasses="${jacoco.inclnolocationclasses}"
property="jacocoagent@{testfamily}@{testITsuffix}" if:true="@{coverage}"/>
<junitlauncher printsummary="${junit.printsummary}" failureproperty="test.@{testfamily}@{testITsuffix}.failed">
<classpath>
<path refid="test.classpath"/>
<pathelement path="${test.dir}/build/unit"/> <!-- required for functional/etc to have JOSMTestRules -->
<pathelement path="${test.dir}/build/@{testfamily}"/>
</classpath>
<testclasses outputDir="${test.dir}/report">
<fileset dir="${test.dir}/build/@{testfamily}" includes="@{includes}" excludes="@{excludes}"/>
<fork>
<jvmarg value="${jacocoagent@{testfamily}@{testITsuffix}}" if:set="jacocoagent@{testfamily}@{testITsuffix}" />
<jvmarg value="-Dfile.encoding=UTF-8"/>
<jvmarg value="-Djava.locale.providers=SPI,CLDR" />
<jvmarg value="-Djava.security.manager=allow" if:set="isJava17" />
<jvmarg value="-javaagent:${test.dir}/lib/junit5-system-exit.jar" if:set="isJava17"/>
<jvmarg value="-javaagent:${test.dir}/lib/jmockit.jar"/>
<jvmarg value="-Djunit.jupiter.extensions.autodetection.enabled=true"/>
<jvmarg value="-Djunit.jupiter.execution.parallel.enabled=true"/>
<jvmarg value="--add-exports" unless:set="noJavaFX" />
<jvmarg value="javafx.graphics/com.sun.javafx.application=ALL-UNNAMED" unless:set="noJavaFX" />
<jvmarg value="--add-opens" />
<jvmarg value="java.base/java.io=ALL-UNNAMED" />
<jvmarg value="--add-opens" />
<jvmarg value="java.base/java.lang=ALL-UNNAMED" />
<jvmarg value="--add-opens" />
<jvmarg value="java.base/java.nio=ALL-UNNAMED" />
<jvmarg value="--add-opens" />
<jvmarg value="java.base/java.text=ALL-UNNAMED" />
<jvmarg value="--add-opens" />
<jvmarg value="java.base/java.util=ALL-UNNAMED" />
<jvmarg value="--add-opens" />
<jvmarg value="java.base/jdk.internal.loader=ALL-UNNAMED" />
<jvmarg value="--add-opens" />
<jvmarg value="java.desktop/java.awt=ALL-UNNAMED" />
<jvmarg value="--add-opens" />
<jvmarg value="java.prefs/java.util.prefs=ALL-UNNAMED" />
<sysproperty key="josm.home" value="${test.dir}/config/@{testfamily}-josm.home"/>
<sysproperty key="josm.test.data" value="${test.dir}/data"/>
<sysproperty key="java.awt.headless" value="${test.headless}"/>
<sysproperty key="java.security.manager" value="allow" if:set="isJava17" />
<sysproperty key="glass.platform" value="Monocle"/>
<sysproperty key="monocle.platform" value="Headless"/>
<sysproperty key="prism.order" value="sw"/>
<sysproperty key="suppressPermanentFailure" value="${suppressPermanentFailure}"/>
<sysproperty key="junit.jupiter.execution.parallel.enabled" value="${junit.jupiter.execution.parallel.enabled}" if:set="junit.jupiter.execution.parallel.enabled"/>
<sysproperty key="junit.jupiter.execution.parallel.mode.default" value="${junit.jupiter.execution.parallel.mode.default}" if:set="junit.jupiter.execution.parallel.mode.default"/>
<sysproperty key="junit.jupiter.execution.parallel.mode.classes.default" value="${junit.jupiter.execution.parallel.mode.classes.default}" if:set="junit.jupiter.execution.parallel.mode.classes.default"/>
</fork>
<listener type="legacy-brief" sendSysOut="true" sendSysErr="true"/>
<listener type="legacy-plain" />
<listener type="legacy-xml" />
</testclasses>
</junitlauncher>
</sequential>
</macrodef>
<target name="test" depends="test-compile" unless="test.notRequired"
description="Run unit and functional tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
<call-junit testfamily="unit"/>
<call-junit testfamily="functional"/>
</target>
<target name="test-hardfail" depends="test" description="Run 'test' target but abort if tests failed">
<fail message="'test' failed">
<condition>
<or>
<isset property="test.unit.failed"/>
<isset property="test.functional.failed"/>
</or>
</condition>
</fail>
</target>
<target name="test-unit" depends="test-compile" unless="test-unit.notRequired"
description="Run unit tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
<call-junit testfamily="unit"/>
</target>
<target name="test-unit-hardfail" depends="test-unit" description="Run 'test-unit' target but abort if tests failed">
<fail message="'test-unit' failed" if="test.unit.failed"/>
</target>
<target name="test-it" depends="test-compile,create-revision" unless="test-it.notRequired"
description="Run integration tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
<call-junit testfamily="unit" testITsuffix="IT"/>
<call-junit testfamily="functional" testITsuffix="IT"/>
</target>
<target name="test-it-hardfail" depends="test-it" description="Run 'test-it' target but abort if tests failed">
<fail message="'test-it' failed">
<condition>
<or>
<isset property="test.unitIT.failed"/>
<isset property="test.functionalIT.failed"/>
</or>
</condition>
</fail>
</target>
<target name="test-perf" depends="test-compile" unless="test-perf.notRequired"
description="Run performance tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
<call-junit testfamily="performance" coverage="false"/>
</target>
<target name="test-perf-hardfail" depends="test-perf" description="Run 'test-perf' target but abort if tests failed">
<fail message="'test-perf' failed" if="test.performance.failed"/>
</target>
<target name="test-html" depends="test, test-it, test-perf" description="Generate HTML, CSV and XML test reports">
<!-- May require additional ant dependencies like ant-trax package -->
<junitreport todir="${test.dir}/report">
<fileset dir="${test.dir}/report">
<include name="TEST-*.xml"/>
</fileset>
<report todir="${test.dir}/report/html"/>
</junitreport>
<jacoco:report>
<executiondata>
<fileset dir="${test.dir}" includes="*.exec"/>
</executiondata>
<structure name="JOSM Test Coverage">
<classfiles>
<fileset dir="${build.dir}" includes="org/openstreetmap/"/>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${src.dir}" includes="org/openstreetmap/"/>
</sourcefiles>
</structure>
<html destdir="${test.dir}/report/jacoco"/>
<xml destfile="${test.dir}/report/jacoco.xml"/>
<csv destfile="${test.dir}/report/jacoco.csv"/>
</jacoco:report>
</target>
<target name="dist-optimized" depends="dist" description="Build an optimized JOSM distribution file">
<ivy:cachepath log="download-only" file="${tools.ivy}" pathid="proguard.classpath" conf="proguard"/>
<taskdef resource="proguard/ant/task.properties" classpathref="proguard.classpath"/>
<proguard>
-injars ${dist.jar}
-outjars ${dist-optimized.jar}
-libraryjars ${java.home}/${java.library.dir}
-dontoptimize
-dontobfuscate
-dontwarn org.jetbrains.annotations.**
# These options probably are not necessary (and make processing a bit slower)
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-keepclasseswithmembers public class org.openstreetmap.josm.gui.MainApplication {
public static void main(java.lang.String[]);
}
-keep class * extends org.openstreetmap.josm.io.FileImporter
-keep class * extends org.openstreetmap.josm.io.FileExporter
-keep class org.openstreetmap.josm.actions.search.SearchCompiler$Never
-keep class org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory$PseudoClasses {
static boolean *(org.openstreetmap.josm.gui.mappaint.Environment);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
# Keep unused public classes and methods (needed for plugins)
-keep public class * {
public protected *;
}
# Keep serialization code
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
# Disable annoying [proguard] Note: the configuration keeps the entry point '...', but not the descriptor class '...'.
# This note should not be a problem as we don't use obfuscation
-dontnote
</proguard>
</target>
<target name="dist-optimized-report" depends="dist-optimized">
<!-- generate difference report between optimized jar and normal one -->
<exec executable="perl" dir="${basedir}">
<arg value="${tools.dir}/japicc/japi-compliance-checker.pl"/>
<arg value="--lib=JOSM"/>
<arg value="--keep-internal"/>
<arg value="--v1=${version.entry.commit.revision}"/>
<arg value="--v2=${version.entry.commit.revision}-optimized"/>
<arg value="--report-path=${dist.dir}/compat_report.html"/>
<arg value="${dist.jar}"/>
<arg value="${dist-optimized.jar}"/>
</exec>
</target>
<target name="check-plugins" depends="dist-optimized" description="Check of plugins binary compatibility" unless="isJava21">
<!-- animal_sniffer doesn't support Java 21 yet. The unless statement can be removed after animal_sniffer is updated to 1.24. -->
<local name="dir"/>
<local name="plugins"/>
<property name="dir" value="plugin-check"/>
<ivy:cachepath log="download-only" file="${tools.ivy}" pathid="animal.classpath" conf="animal"/>
<typedef uri="antlib:org.codehaus.mojo.animal_sniffer">
<classpath refid="animal.classpath"/>
</typedef>
<delete dir="${dir}" failonerror="false"/>
<mkdir dir="${dir}"/>
<!-- List of deprecated plugins -->
<loadfile property="deprecated-plugins" srcFile="${src.dir}/org/openstreetmap/josm/plugins/PluginHandler.java">
<filterchain>
<linecontains>
<contains value="new DeprecatedPlugin("/>
</linecontains>
<tokenfilter>
<replaceregex pattern=".*new DeprecatedPlugin\("(.+?)".*" replace="\1|" flags="gi"/>
</tokenfilter>
<striplinebreaks/>
<tokenfilter>
<replaceregex pattern="\|$" replace="" flags="gi"/>
</tokenfilter>
</filterchain>
</loadfile>
<!-- Download list of plugins -->
<loadresource property="plugins">
<url url="https://josm.openstreetmap.de/pluginicons?minjava=8&noparams=1"/>
<filterchain>
<linecontainsregexp negate="true">
<regexp pattern="${deprecated-plugins}"/>
</linecontainsregexp>
<tokenfilter>
<replaceregex pattern="^.*;" replace="" flags="gi"/>
</tokenfilter>
</filterchain>
</loadresource>
<!-- Delete files that are not in plugin list (like old plugins) -->
<loadresource property="file-list">
<propertyresource name="plugins"/>
<filterchain>
<tokenfilter>
<replaceregex pattern="^.*/(.*)$" replace="\1\|" flags=""/>
</tokenfilter>
<striplinebreaks/>
<tokenfilter>
<replaceregex pattern="\|$" replace="" flags="gi"/>
</tokenfilter>
</filterchain>
</loadresource>
<delete>
<restrict>
<fileset dir="${dir}"/>
<not>
<name regex="${file-list}"/>
</not>
</restrict>
</delete>
<!-- Download plugins -->
<copy todir="${dir}" flatten="true" verbose="true" failonerror="false">
<resourcelist>
<string value="${plugins}"/>
</resourcelist>
</copy>
<!-- Check plugins -->
<as:build-signatures destfile="${dir}/api.sig">
<path>
<fileset file="${dist-optimized.jar}"/>
<fileset dir="${java.home}/jmods" />
</path>
</as:build-signatures>
<as:check-signature signature="${dir}/api.sig" failonerror="false">
<ignore classname="afu.*"/>
<ignore classname="android.*"/>
<ignore classname="au.*"/>
<ignore classname="com.*"/>
<ignore classname="de.*"/>
<ignore classname="edu.*"/>
<ignore classname="groovy.*"/>
<ignore classname="io.*"/>
<ignore classname="it.*"/>
<ignore classname="java.lang.invoke.MethodHandle"/>
<ignore classname="java.nio.ByteBuffer"/>
<ignore classname="java.nio.FloatBuffer"/>
<ignore classname="java.util.list.kotlin.*"/>
<ignore classname="javax.*"/>
<ignore classname="jdk.swing.interop.*"/>
<ignore classname="jogamp.*"/>
<ignore classname="junit.*"/>
<ignore classname="kdu_jni.*"/>
<ignore classname="kotlin.*"/>
<ignore classname="net.*"/>
<ignore classname="netscape.*"/>
<ignore classname="nu.*"/>
<ignore classname="oracle.*"/>
<ignore classname="org.apache.*"/>
<ignore classname="org.bouncycastle.*"/>
<ignore classname="org.checkerframework.*"/>
<ignore classname="org.codehaus.*"/>
<ignore classname="org.conscrypt.*"/>
<ignore classname="org.dom4j.*"/>
<ignore classname="org.eclipse.*"/>
<ignore classname="org.ejml.*"/>
<ignore classname="org.fusesource.*"/>
<ignore classname="org.gdal.*"/>
<ignore classname="org.geotools.data.h2.*"/>
<ignore classname="org.geotools.gce.imagemosaic.*"/>
<ignore classname="org.hibernate.*"/>
<ignore classname="org.hsqldb.*"/>
<ignore classname="org.ibex.*"/>
<ignore classname="org.iso_relax.*"/>
<ignore classname="org.jaitools.*"/>
<ignore classname="org.jaxen.*"/>
<ignore classname="org.jboss.*"/>
<ignore classname="org.jctools.*"/>
<ignore classname="org.jdom.*"/>
<ignore classname="org.jdom2.*"/>
<ignore classname="org.jfree.*"/>
<ignore classname="org.jgraph.*"/>
<ignore classname="org.joda.*"/>
<ignore classname="org.json.*"/>
<ignore classname="org.junit.*"/>
<ignore classname="org.jvnet.*"/>
<ignore classname="org.kxml2.*"/>
<ignore classname="org.locationtech.*"/>
<ignore classname="org.mozilla.*"/>
<ignore classname="org.objectweb.*"/>
<ignore classname="org.opentest4j.*"/>
<ignore classname="org.osgi.*"/>
<ignore classname="org.postgresql.*"/>
<ignore classname="org.python.*"/>
<ignore classname="org.seasar.*"/>
<ignore classname="org.slf4j.*"/>
<ignore classname="org.springframework.*"/>
<ignore classname="org.testng.*"/>
<ignore classname="org.w3c.*"/>
<ignore classname="org.zeromq.*"/>
<ignore classname="waffle.*"/>
<!-- Our installers include javafx -->
<ignore classname="javafx.*"/>
<!-- plugins used by another ones -->
<ignore classname="org.openstreetmap.josm.plugins.geotools.*"/>
<ignore classname="org.openstreetmap.josm.plugins.jaxb.*"/>
<ignore classname="org.openstreetmap.josm.plugins.jna.*"/>
<ignore classname="org.openstreetmap.josm.plugins.jts.*"/>
<ignore classname="org.openstreetmap.josm.plugins.log4j.*"/>
<ignore classname="org.openstreetmap.josm.plugins.openjfx.*"/>
<ignore classname="org.openstreetmap.josm.plugins.utilsplugin2.*"/>
<ignore classname="sun.*"/>
<path path="${dir}"/>
</as:check-signature>
</target>
<target name="script-compile" depends="test-compile" description="Compile all scripts">
<javac sourcepath="" srcdir="${base.dir}/scripts" failonerror="true" includes="*.java"
destdir="${script-build.dir}" release="${java.lang.version}" debug="on"
includeantruntime="false" encoding="UTF-8">
<classpath>
<pathelement path="${build.dir}"/>
<pathelement path="${test.dir}/build/unit"/>
<pathelement path="${commons-lang3.jar}"/>
</classpath>
</javac>
</target>
<macrodef name="_taginfo">
<attribute name="type"/>
<attribute name="output"/>
<sequential>
<echo message="Generating Taginfo for type @{type} to @{output}"/>
<java classname="TagInfoExtract" failonerror="true" fork="false">
<sysproperty key="java.awt.headless" value="true"/>
<classpath>
<pathelement path="${build.dir}"/>
<pathelement path="${script-build.dir}"/>
<pathelement path="${commons-lang3.jar}"/>
</classpath>
<arg value="--type"/>
<arg value="@{type}"/>
<arg value="--noexit"/>
<arg value="--imgurlprefix"/>
<arg value="http://josm.openstreetmap.de/download/taginfo/taginfo-img"/>
<arg value="--output"/>
<arg value="@{output}"/>
</java>
</sequential>
</macrodef>
<target name="taginfo" depends="script-compile" description="Generate project files Taginfo">
<_taginfo type="mappaint" output="taginfo_style.json"/>
<_taginfo type="presets" output="taginfo_presets.json"/>
<_taginfo type="external_presets" output="taginfo_external_presets.json"/>
</target>
<target name="imageryindex" depends="script-compile" description="Check editor imagery difference">
<echo message="Checking editor imagery difference"/>
<java classname="SyncEditorLayerIndex" failonerror="true" fork="false">
<classpath>
<pathelement path="${build.dir}"/>
<pathelement path="${script-build.dir}"/>
<pathelement path="${commons-lang3.jar}"/>
</classpath>
<arg value="--noeli"/>
<arg value="-p"/>
<arg value="imagery_eliout.imagery.xml"/>
<arg value="-q"/>
<arg value="imagery_josmout.imagery.xml"/>
</java>
</target>
<target name="imageryindexdownload" description="Download and check editor imagery">
<exec append="false" executable="wget" failifexecutionfails="true">
<arg value="https://josm.openstreetmap.de/maps"/>
<arg value="-O"/>
<arg value="imagery_josm.imagery.xml"/>
<arg value="--unlink"/>
</exec>
<exec append="false" executable="wget" failifexecutionfails="true">
<arg value="https://josm.openstreetmap.de/wiki/ImageryCompareIgnores?format=txt"/>
<arg value="-O"/>
<arg value="imagery_josm.ignores.txt"/>
<arg value="--unlink"/>
</exec>
<exec append="false" executable="wget" failifexecutionfails="true">
<arg value="https://raw.githubusercontent.com/osmlab/editor-layer-index/gh-pages/imagery.geojson"/>
<arg value="-O"/>
<arg value="imagery_eli.geojson"/>
<arg value="--unlink"/>
</exec>
<exec append="false" executable="wget" failifexecutionfails="true">
<arg value="https://raw.githubusercontent.com/openstreetmap/iD/develop/data/imagery.json"/>
<arg value="-O"/>
<arg value="imagery_id.geojson"/>
<arg value="--unlink"/>
</exec>
<exec append="false" executable="wget" failifexecutionfails="true">
<arg value="https://raw.githubusercontent.com/facebook/Rapid/main/data/imagery.json"/>
<arg value="-O"/>
<arg value="imagery_rapid.geojson"/>
<arg value="--unlink"/>
</exec>
<antcall target="imageryindex"/>
</target>
<target name="checkstyle-changed" depends="init" description="Run Checkstyle on SVN/Git-changed source files">
<ivy:cachepath log="download-only" file="${tools.ivy}" pathid="checkstyle.classpath" conf="checkstyle"/>
<exec append="false" osfamily="unix" executable="bash" failifexecutionfails="true">
<arg value="-c"/>
<arg value="(git ls-files src test --modified 2>/dev/null || svn status -q --ignore-externals src test) | grep -o '\(src\|test\)/.*' | xargs java -cp '${toString:checkstyle.classpath}' com.puppycrawl.tools.checkstyle.Main -c ${checkstyle.dir}/josm_checks.xml | sed -e 's:\([^ ]*\) [^:]*/\([^:/]*.java\:[^:]*\):(\2)\1:'"/>
</exec>
<exec append="false" osfamily="windows" executable="powershell" failifexecutionfails="true">
<arg value="/c"/>
<arg value="svn status -q --ignore-externals src test | ForEach-Object {java -cp '${toString:checkstyle.classpath}' com.puppycrawl.tools.checkstyle.Main -c ${checkstyle.dir}/josm_checks.xml $_.split(' ')[7]}"/>
</exec>
</target>
<target name="checkstyle" depends="init" description="Run Checkstyle on the source files">
<ivy:cachepath log="download-only" file="${tools.ivy}" pathid="checkstyle.classpath" conf="checkstyle"/>
<taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties">
<classpath refid="checkstyle.classpath"/>
</taskdef>
<checkstyle config="${checkstyle.dir}/josm_checks.xml">
<fileset dir="${base.dir}/src/org/openstreetmap/josm" includes="**/*.java"
excludes="gui/mappaint/mapcss/parsergen/*.java"/>
<fileset dir="${base.dir}/test" includes="**/*.java"/>
<fileset dir="${base.dir}/scripts" includes="**/*.java"/>
<formatter type="plain"/>
<formatter type="xml" toFile="checkstyle-josm.xml"/>
</checkstyle>
</target>
<target name="spotbugs" depends="dist" description="Run SpotBugs on the source files">
<ivy:cachepath log="download-only" file="${tools.ivy}" pathid="spotbugs.classpath" conf="spotbugs"/>
<taskdef name="spotbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="spotbugs.classpath"/>
<spotbugs output="xml"
outputFile="spotbugs-josm.xml"
sourcePath="${src.dir}"
classpath="${toString:spotbugs.classpath}"
pluginList=""
excludeFilter="${spotbugs.dir}/josm-filter.xml"
onlyAnalyze="org.openstreetmap.josm.-"
effort="max"
reportLevel="low"
>
<class location="${dist.jar}" />
</spotbugs>
</target>
<target name="pmd" depends="init" description="Run PMD on the source files">
<ivy:cachepath log="download-only" file="${tools.ivy}" pathid="pmd.classpath" conf="pmd"/>
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.classpath"/>
<pmd cacheLocation="${pmd.dir}/cache" encoding="UTF-8">
<sourceLanguage name="java" version="${java.lang.version}" />
<ruleset>${pmd.dir}/josm-ruleset.xml</ruleset>
<formatter type="text" toConsole="true" />
<formatter type="xml" toFile="pmd-josm.xml">
<param name="encoding" value="UTF-8" />
</formatter>
<fileset dir="${src.dir}">
<include name="org/openstreetmap/josm/**/*.java"/>
<exclude name="org/openstreetmap/josm/gui/mappaint/mapcss/parsergen/*.java" />
</fileset>
<fileset dir="${base.dir}/scripts" includes="**/*.java"/>
<relativizePathsWith><path path="${base.dir}"/></relativizePathsWith>
</pmd>
</target>
<target name="run" depends="dist" description="Run JOSM">
<java jar="${dist.jar}" fork="true">
<arg value="--set=expert=true"/>
<arg value="--set=iso.dates=true"/>
<jvmarg value="-Djosm.home=/tmp/.josm/"/>
</java>
</target>
<target name="epsg-compile" depends="init"
description="Compile build script for generating projection list">
<property name="proj-classpath" location="${build.dir}"/>
<mkdir dir="${proj-build.dir}"/>
<javac sourcepath="" srcdir="${base.dir}/scripts" failonerror="true" includes="BuildProjectionDefinitions.java"
destdir="${proj-build.dir}" release="${java.lang.version}" debug="on"
includeantruntime="false"
encoding="UTF-8" classpath="${proj-classpath}">
</javac>
</target>
<target name="epsg" unless="epsg.notRequired" depends="epsg-compile"
description="Generate projection list">
<touch file="${epsg.output}" mkdirs="true"/>
<java classname="BuildProjectionDefinitions" failonerror="true" fork="true">
<sysproperty key="java.awt.headless" value="true"/>
<classpath>
<pathelement path="${resources.dir}"/>
<pathelement path="${proj-classpath}"/>
<pathelement path="${proj-build.dir}"/>
<path refid="classpath"/>
</classpath>
<arg value="${base.dir}"/>
</java>
</target>
<target name="update-proj-files" depends="test-compile"
description="Update projection test files after an update of projection definitions">
<java classname="org.openstreetmap.josm.data.projection.ProjectionRefTest" failonerror="true" fork="true">
<classpath>
<path refid="test.classpath"/>
<pathelement path="${test.dir}/build/unit"/>
</classpath>
</java>
<java classname="org.openstreetmap.josm.data.projection.ProjectionRegressionTest" failonerror="true" fork="true">
<classpath>
<path refid="test.classpath"/>
<pathelement path="${test.dir}/build/unit"/>
</classpath>
</java>
</target>
<target name="jdeps" depends="compile" description="Generate jdeps dependency graph">
<delete dir="${modules.dir}"/>
<mkdir dir="${modules.dir}"/>
<!-- JOSM only -->
<jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-actions.jar" includes="org/openstreetmap/josm/actions/**/*.class"/>
<jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-cli.jar" includes="org/openstreetmap/josm/cli/**/*.class"/>
<jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-command.jar" includes="org/openstreetmap/josm/command/**/*.class"/>
<jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-data.jar" includes="org/openstreetmap/josm/data/**/*.class"/>
<jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-gui.jar" includes="org/openstreetmap/josm/gui/**/*.class"/>
<jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-io.jar" includes="org/openstreetmap/josm/io/**/*.class"/>
<jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-plugins.jar" includes="org/openstreetmap/josm/plugins/**/*.class"/>
<jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-spi.jar" includes="org/openstreetmap/josm/spi/**/*.class"/>
<jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/josm-tools.jar" includes="org/openstreetmap/josm/tools/**/*.class"/>
<path id="jar.files">
<fileset dir="${modules.dir}" includes="*.jar"/>
</path>
<pathconvert property="jar.files.string" refid="jar.files" pathsep=" "/>
<exec executable="jdeps" dir="${modules.dir}">
<arg line="-f 'java.*|org.xml.*|org.w3c.*|sun.*|com.*|oauth.*|org.apache.*|org.glassfish.*|org.openstreetmap.gui.*'"/>
<arg line="-dotoutput dots" />
<arg line="${jar.files.string}" />
</exec>
<exec executable="dot" dir="${modules.dir}/dots">
<arg line="-O -Tpng summary.dot"/>
</exec>
<move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-without-dependencies.png"/>
<!-- Direct dependencies -->
<copy todir="${modules.dir}" flatten="true">
<fileset refid="runtime.fileset" />
</copy>
<path id="jar-direct.files">
<fileset dir="${modules.dir}" includes="*.jar"/>
</path>
<pathconvert property="jar-direct.files.string" refid="jar-direct.files" pathsep=" "/>
<exec executable="jdeps" dir="${modules.dir}">
<arg line="-f 'java.*|org.xml.*|org.w3c.*|sun.*|com.sun.*|com.google.*|org.tukaani.*'"/>
<arg line="-dotoutput dots"/>
<arg line="--multi-release 11"/>
<arg line="${jar-direct.files.string}" />
</exec>
<exec executable="dot" dir="${modules.dir}/dots">
<arg line="-O -Tpng summary.dot"/>
</exec>
<move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-with-direct-dependencies.png"/>
<!-- All dependencies -->
<jar basedir="${build.dir}" level="${clevel}" destfile="${modules.dir}/google-gdata.jar" includes="com/google/**/*.class"/>
<path id="jar-all.files">
<fileset dir="${modules.dir}" includes="*.jar"/>
</path>
<pathconvert property="jar-all.files.string" refid="jar-direct.files" pathsep=" "/>
<exec executable="jdeps" dir="${modules.dir}">
<arg line="-dotoutput dots"/>
<arg line="--multi-release 11"/>
<arg line="${jar-all.files.string}" />
</exec>
<exec executable="dot" dir="${modules.dir}/dots">
<arg line="-O -Tpng summary.dot"/>
</exec>
<move file="${modules.dir}/dots/summary.dot.png" tofile="${modules.dir}/josm-with-all-dependencies.png"/>
</target>
<target name="resolve" depends="init-ivy" unless="resolve.notRequired" description="Resolve Ivy dependencies">
<!--
<ivy:settings file="${base.dir}/ivysettings.xml"/>
<ivy:resolve log="download-only" file="${base.dir}/ivy.xml" keep="true"/>
<ivy:cachepath log="download-only" pathid="compile.path" conf="compile"/>
<ivy:cachepath log="download-only" pathid="runtime.path" conf="runtime"/>
<ivy:cachefileset log="download-only" setid="runtime.fileset" conf="runtime"/>
<ivy:cachepath log="download-only" pathid="test.path" conf="test"/>
-->
</target>
<target name="extract-libraries" depends="resolve" description="Extract libraries to build dir">
<unzip dest="${build.dir}">
<fileset refid="runtime.fileset"/>
<patternset>
<exclude name="META-INF/*"/>
<exclude name="META-INF/maven/**"/>
<exclude name="META-INF/resources/webjars/tag2link/*/LICENSE"/>
<exclude name="META-INF/resources/webjars/tag2link/*/README.md"/>
<exclude name="META-INF/resources/webjars/tag2link/*/build.js"/>
<exclude name="META-INF/resources/webjars/tag2link/*/package.json"/>
<exclude name="META-INF/resources/webjars/tag2link/*/schema.json"/>
<exclude name="META-INF/resources/webjars/tag2link/*/tag2link.sophox.sparql"/>
<exclude name="META-INF/resources/webjars/tag2link/*/tag2link.wikidata.sparql"/>
<exclude name="META-INF/versions/**"/>
<exclude name="*"/>
<exclude name="org/openstreetmap/gui/jmapviewer/Demo*"/>
<exclude name="com/drew/imaging/FileTypeDetector*"/>
<exclude name="com/drew/imaging/ImageMetadataReader*"/>
<exclude name="com/drew/imaging/avi/**"/>
<exclude name="com/drew/imaging/bmp/**"/>
<exclude name="com/drew/imaging/eps/**"/>
<exclude name="com/drew/imaging/gif/**"/>
<exclude name="com/drew/imaging/heif/**"/>
<exclude name="com/drew/imaging/ico/**"/>
<exclude name="com/drew/imaging/mp3/**"/>
<exclude name="com/drew/imaging/mp4/**"/>
<exclude name="com/drew/imaging/pcx/**"/>
<exclude name="com/drew/imaging/psd/**"/>
<exclude name="com/drew/imaging/quicktime/**"/>
<exclude name="com/drew/imaging/raf/**"/>
<exclude name="com/drew/imaging/riff/**"/>
<exclude name="com/drew/imaging/wav/**"/>
<exclude name="com/drew/imaging/webp/**"/>
<exclude name="com/drew/metadata/avi/**"/>
<exclude name="com/drew/metadata/bmp/**"/>
<exclude name="com/drew/metadata/eps/**"/>
<exclude name="com/drew/metadata/gif/**"/>
<exclude name="com/drew/metadata/heif/**"/>
<exclude name="com/drew/metadata/ico/**"/>
<exclude name="com/drew/metadata/mov/**"/>
<exclude name="com/drew/metadata/mp3/**"/>
<exclude name="com/drew/metadata/mp4/**"/>
<exclude name="com/drew/metadata/pcx/**"/>
<exclude name="com/drew/metadata/wav/**"/>
<exclude name="com/drew/metadata/webp/**"/>
<exclude name="com/drew/tools/**"/>
<exclude name="com/kitfox/svg/app/ant/**"/>
<exclude name="com/kitfox/svg/app/*Dialog*"/>
<exclude name="com/kitfox/svg/app/*Frame*"/>
<exclude name="com/kitfox/svg/app/*Player*"/>
<exclude name="com/kitfox/svg/app/*Viewer*"/>
<exclude name="org/apache/commons/compress/PasswordRequiredException*"/>
<exclude name="org/apache/commons/compress/archivers/**"/>
<exclude name="org/apache/commons/compress/changes/**"/>
<exclude name="org/apache/commons/compress/compressors/bzip2/BZip2Utils*"/>
<exclude name="org/apache/commons/compress/compressors/brotli/**"/>
<exclude name="org/apache/commons/compress/compressors/CompressorStreamFactory*"/>
<exclude name="org/apache/commons/compress/compressors/CompressorStreamProvider*"/>
<exclude name="org/apache/commons/compress/compressors/CompressorException*"/>
<exclude name="org/apache/commons/compress/compressors/FileNameUtil*"/>
<exclude name="org/apache/commons/compress/compressors/deflate/**"/>
<exclude name="org/apache/commons/compress/compressors/gzip/**"/>
<exclude name="org/apache/commons/compress/compressors/lz4/**"/>
<exclude name="org/apache/commons/compress/compressors/lzma/**"/>
<exclude name="org/apache/commons/compress/compressors/lz77support/**"/>
<exclude name="org/apache/commons/compress/compressors/pack200/**"/>
<exclude name="org/apache/commons/compress/compressors/snappy/**"/>
<exclude name="org/apache/commons/compress/compressors/xz/XZUtils*"/>
<exclude name="org/apache/commons/compress/compressors/z/**"/>
<exclude name="org/apache/commons/compress/compressors/zstandard/**"/>
<exclude name="org/apache/commons/compress/java/util/jar/Pack200*"/>
<exclude name="org/apache/commons/compress/harmony/pack200/**"/>
<exclude name="org/apache/commons/compress/harmony/unpack200/**"/>
<exclude name="org/apache/commons/compress/parallel/**"/>
<exclude name="org/apache/commons/compress/utils/ArchiveUtils*"/>
<exclude name="org/apache/commons/jcs3/auxiliary/disk/jdbc/**"/>
<exclude name="org/apache/commons/jcs3/auxiliary/remote/http/client/**"/>
<exclude name="org/apache/commons/jcs3/auxiliary/remote/http/server/RemoteHttpCacheServlet*"/>
<exclude name="org/apache/commons/jcs3/auxiliary/remote/server/RemoteCacheStartupServlet*"/>
<exclude name="org/apache/commons/jcs3/log/Log4j2Factory*"/>
<exclude name="org/apache/commons/jcs3/log/Log4j2LogAdapter*"/>
<exclude name="org/apache/commons/jcs3/utils/servlet/**"/>
</patternset>
</unzip>
</target>
<target name="sources" description="Generate jar file of JOSM source files and its dependencies" depends="init,epsg,resolve">
<ivy:cachefileset log="download-only" setid="sources.fileset" conf="sources"/>
<jar destfile="${dist-sources.jar}" level="${clevel}">
<zipgroupfileset refid="sources.fileset"/>
<fileset dir="${src.dir}"/>
<fileset dir="${resources.dir}"/>
</jar>
</target>
<target name="bootstrap-workspace" description="Copy libraries from ivy cache to workspace folders for IDE" depends="resolve">
<delete dir="${lib.dir}"/>
<ivy:retrieve pattern="${lib.dir}/[conf]/[artifact]-[type].[ext]" conf="compile,runtime,sources,test"/>
<ivy:retrieve pattern="${lib.dir}/tools/[artifact]-[type].[ext]" conf="javacc,checkstyle,pmd,spotbugs,errorprone" file="${tools.ivy}"/>
</target>
<target name="ivy-report" description="Generate Ivy reports of dependency resolving" depends="resolve">
<ivy:report todir="${tools.dir}/ivy-report" graph="false"/>
</target>
<target name="ivy-checkdepsupdate" description="Display dependency updates on the console" depends="resolve">
<ivy:resolve log="quiet" file="${tools.ivy}" keep="true" conf="*"/>
<ivy:checkdepsupdate/>
<echo message="${line.separator}"/>
<ivy:resolve log="quiet" file="${base.dir}/ivy.xml" keep="true" conf="*"/>
<ivy:checkdepsupdate/>
</target>
<target name="api-dependency-tree" description="Displays Ivy dependency tree for JOSM API" depends="resolve">
<ivy:dependencytree conf="api"/>
</target>
<target name="test-dependency-tree" description="Displays Ivy dependency tree for JOSM tests" depends="resolve">
<ivy:dependencytree conf="test"/>
</target>
</project>
|