- Timestamp:
- 2020-11-23T20:25:06+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/build.xml
r17254 r17338 16 16 xmlns:unless="ant:unless" 17 17 > 18 <target name="init-ivy" >18 <target name="init-ivy" description="Initialize dependency management system Apache Ivy"> 19 19 <property name="ivy.version" value="2.5.0"/> 20 20 <dirname property="base.dir" file="${ant.file.josm}"/> … … 31 31 <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.jar.file}"/> 32 32 </target> 33 <target name="init-properties" >33 <target name="init-properties" description="Initialize properties for the build"> 34 34 <property environment="env"/> 35 35 <!-- Load properties in a target and not at top level, so this build file can be … … 100 100 </condition> 101 101 </target> 102 <!-- 103 ** Initializes the REVISION.XML file from SVN information 104 --> 105 <target name="init-svn-revision-xml" if="svn.present" depends="init-properties"> 102 <target name="init-svn-revision-xml" if="svn.present" depends="init-properties" 103 description="Initialize the REVISION.XML file from SVN information"> 106 104 <exec append="false" output="${base.dir}/REVISION.XML" executable="svn" dir="${base.dir}" resultproperty="svn.info.result"> 107 105 <env key="LANG" value="C"/> … … 111 109 </exec> 112 110 </target> 113 <!-- 114 ** Initializes the REVISION.XML file from git information 115 --> 116 <target name="init-git-revision-xml" if="git.present" depends="init-properties"> 111 <target name="init-git-revision-xml" if="git.present" depends="init-properties" 112 description="Initialize the REVISION.XML file from git information"> 117 113 <exec append="false" output="${base.dir}/REVISION.XML" executable="git" dir="${base.dir}"> 118 114 <arg value="log"/> … … 131 127 replace="<info><entry><commit revision="\1"><date>\2</date></commit></entry></info>"/> 132 128 </target> 133 <!-- 134 ** Creates the REVISION file to be included in the distribution 135 --> 136 <target name="create-revision" depends="init-properties,init-svn-revision-xml,init-git-revision-xml"> 129 <target name="create-revision" depends="init-properties,init-svn-revision-xml,init-git-revision-xml" 130 description="Create the REVISION file to be included in the distribution based on the latest SVN/Git commit"> 137 131 <xmlproperty file="${base.dir}/REVISION.XML" prefix="version" keepRoot="false" collapseAttributes="true"/> 138 132 <delete file="${base.dir}/REVISION.XML"/> … … 150 144 </echo> 151 145 </target> 152 <!-- 153 ** Check internal XML files against their XSD 154 --> 155 <target name="check-schemas" unless="check-schemas.notRequired" depends="init-properties"> 146 <target name="check-schemas" unless="check-schemas.notRequired" depends="init-properties" 147 description="Check internal XML files against their XSD"> 156 148 <schemavalidate file="${resources.dir}/data/defaultpresets.xml" > 157 149 <schema namespace="http://josm.openstreetmap.de/tagging-preset-1.0" file="${resources.dir}/data/tagging-preset.xsd" /> 158 150 </schemavalidate> 159 151 </target> 160 <!-- 161 ** Main target that builds JOSM and checks XML against schemas 162 --> 163 <target name="dist" depends="compile,extract-libraries,epsg,copy-resources,check-schemas"> 152 <target name="dist" depends="compile,extract-libraries,epsg,copy-resources,check-schemas" 153 description="Main target that builds JOSM and checks XML against schemas"> 164 154 <echo>Revision ${version.entry.commit.revision}</echo> 165 155 <copy file="CONTRIBUTION" todir="${build.dir}"/> … … 244 234 </exec> 245 235 </target> 246 <target name="javacc" depends="init" unless="javacc.notRequired" >236 <target name="javacc" depends="init" unless="javacc.notRequired" description="Compile the MapCSS compiler"> 247 237 <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="javacc.classpath" conf="javacc"/> 248 238 <mkdir dir="${mapcss.dir}/parsergen"/> … … 258 248 </java> 259 249 </target> 260 <target name="compile-cots" depends="init" description="Compile sthird-party dependencies not retrieved with Ivy">250 <target name="compile-cots" depends="init" description="Compile third-party dependencies not retrieved with Ivy"> 261 251 <!-- COTS --> 262 252 <javac srcdir="${src.dir}" includes="com/kitfox/**" excludes="**/package-info.java" nowarn="on" encoding="iso-8859-1" … … 269 259 </javac> 270 260 </target> 271 <target name="compile" depends="init,javacc,compile-cots" unless="compile.notRequired" description="Compile sJOSM">261 <target name="compile" depends="init,javacc,compile-cots" unless="compile.notRequired" description="Compile JOSM"> 272 262 <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="errorprone.classpath" conf="errorprone"/> 273 263 <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="errorprone_javac.classpath" conf="errorprone_javac"/> … … 312 302 </copy> 313 303 </target> 314 <target name="init" depends="init-properties,resolve" >304 <target name="init" depends="init-properties,resolve" description="Initialize the build"> 315 305 <uptodate property="javacc.notRequired" targetfile="${mapcss.dir}/parsergen/MapCSSParser.java" > 316 306 <srcfiles dir="${mapcss.dir}" includes="MapCSSParser.jj"/> … … 323 313 <mkdir dir="${dist.dir}"/> 324 314 </target> 325 <target name="javadoc" depends="init" >315 <target name="javadoc" depends="init" description="Generate API documentation from JOSM source files"> 326 316 <javadoc destdir="javadoc" 327 317 sourcepath="${src.dir}" … … 349 339 </javadoc> 350 340 </target> 351 <target name="clean" depends="init-properties" >341 <target name="clean" depends="init-properties" description="Delete all build files"> 352 342 <delete dir="${build.dir}"/> 353 343 <delete dir="${proj-build.dir}"/> … … 369 359 </sequential> 370 360 </macrodef> 371 <target name="test-init" depends="init" >361 <target name="test-init" depends="init" description="Initialize the tests"> 372 362 <mkdir dir="${test.dir}/build"/> 373 363 <mkdir dir="${test.dir}/build/unit"/> … … 388 378 <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="${tools.dir}/jacocoant.jar" /> 389 379 </target> 390 <target name="test-clean" depends="init-properties" >380 <target name="test-clean" depends="init-properties" description="Delete all built test files"> 391 381 <delete dir="${test.dir}/build"/> 392 382 <delete dir="${test.dir}/report"/> … … 413 403 </sequential> 414 404 </macrodef> 415 <target name="test-compile" depends="test-init,compile,extract-libraries,epsg,copy-resources" description="Compile sall tests">405 <target name="test-compile" depends="test-init,compile,extract-libraries,epsg,copy-resources" description="Compile all tests"> 416 406 <call-javac testfamily="unit"> 417 407 <cp-elements> … … 558 548 </jacoco:report> 559 549 </target> 560 <target name="dist-optimized" depends="dist" unless="isJava13" >550 <target name="dist-optimized" depends="dist" unless="isJava13" description="Build an optimized JOSM distribution file"> 561 551 <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="proguard.classpath" conf="proguard"/> 562 552 <taskdef resource="proguard/ant/task.properties" classpathref="proguard.classpath"/> … … 789 779 </target> 790 780 791 <target name="script-compile" depends="test-compile" description="Compile sall scripts">781 <target name="script-compile" depends="test-compile" description="Compile all scripts"> 792 782 <javac sourcepath="" srcdir="${base.dir}/scripts" failonerror="true" includes="*.java" 793 783 destdir="${script-build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on" … … 824 814 </macrodef> 825 815 826 <target name="taginfo" depends="script-compile" >816 <target name="taginfo" depends="script-compile" description="Generate project files Taginfo"> 827 817 <_taginfo type="mappaint" output="taginfo_style.json"/> 828 818 <_taginfo type="presets" output="taginfo_presets.json"/> … … 830 820 </target> 831 821 832 <target name="imageryindex" depends="script-compile" >822 <target name="imageryindex" depends="script-compile" description="Check editor imagery difference"> 833 823 <echo message="Checking editor imagery difference"/> 834 824 <java classname="SyncEditorLayerIndex" failonerror="true" fork="false"> … … 846 836 </target> 847 837 848 <target name="imageryindexdownload" >838 <target name="imageryindexdownload" description="Download and check editor imagery"> 849 839 <exec append="false" executable="wget" failifexecutionfails="true"> 850 840 <arg value="https://josm.openstreetmap.de/maps"/> … … 868 858 </target> 869 859 870 <target name="checkstyle-compile" depends="init" >860 <target name="checkstyle-compile" depends="init" description="Compile Checkstyle rules"> 871 861 <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="checkstyle.classpath" conf="checkstyle"/> 872 862 <mkdir dir="${checkstyle-build.dir}"/> … … 877 867 </javac> 878 868 </target> 879 <target name="checkstyle-changed" depends="checkstyle-compile" >869 <target name="checkstyle-changed" depends="checkstyle-compile" description="Run Checkstyle on SVN/Git-changed source files"> 880 870 <exec append="false" osfamily="unix" executable="bash" failifexecutionfails="true"> 881 871 <arg value="-c"/> … … 887 877 </exec> 888 878 </target> 889 <target name="checkstyle" depends="checkstyle-compile" >879 <target name="checkstyle" depends="checkstyle-compile" description="Run Checkstyle on the source files"> 890 880 <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties"> 891 881 <classpath refid="checkstyle.classpath"/> … … 902 892 </target> 903 893 904 <target name="spotbugs" depends="dist" >894 <target name="spotbugs" depends="dist" description="Run SpotBugs on the source files"> 905 895 <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="spotbugs.classpath" conf="spotbugs"/> 906 896 <taskdef name="spotbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="spotbugs.classpath"/> … … 918 908 </target> 919 909 920 <target name="pmd" depends="init" >910 <target name="pmd" depends="init" description="Run PMD on the source files"> 921 911 <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="pmd.classpath" conf="pmd"/> 922 912 <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.classpath"/> … … 936 926 </target> 937 927 938 <target name="run" depends="dist" >928 <target name="run" depends="dist" description="Run JOSM"> 939 929 <java jar="${dist.jar}" fork="true"> 940 930 <arg value="--set=expert=true"/> … … 943 933 </java> 944 934 </target> 945 <!-- 946 ** Compile build script for generating projection list. 947 --> 948 <target name="epsg-compile" depends="init"> 935 <target name="epsg-compile" depends="init" 936 description="Compile build script for generating projection list"> 949 937 <property name="proj-classpath" location="${build.dir}"/> 950 938 <mkdir dir="${proj-build.dir}"/> … … 955 943 </javac> 956 944 </target> 957 <!-- 958 ** generate projection list. 959 --> 960 <target name="epsg" unless="epsg.notRequired" depends="epsg-compile"> 945 <target name="epsg" unless="epsg.notRequired" depends="epsg-compile" 946 description="Generate projection list"> 961 947 <touch file="${epsg.output}" mkdirs="true"/> 962 948 <java classname="BuildProjectionDefinitions" failonerror="true" fork="true"> … … 970 956 </java> 971 957 </target> 972 <!-- 973 ** update projection test files after an update of projection definitions 974 --> 975 <target name="update-proj-files" depends="test-compile"> 958 <target name="update-proj-files" depends="test-compile" 959 description="Update projection test files after an update of projection definitions"> 976 960 <java classname="org.openstreetmap.josm.data.projection.ProjectionRefTest" failonerror="true" fork="true"> 977 961 <classpath> … … 987 971 </java> 988 972 </target> 989 <!-- 990 ** generate jdeps dependency graph 991 --> 992 <target name="jdeps" depends="compile"> 973 <target name="jdeps" depends="compile" description="Generate jdeps dependency graph"> 993 974 <delete dir="${modules.dir}"/> 994 975 <mkdir dir="${modules.dir}"/> … … 1045 1026 <ivy:cachepath log="download-only" pathid="test.path" conf="test"/> 1046 1027 </target> 1047 <target name="extract-libraries" depends="resolve" description=" extract libraries to build dir">1028 <target name="extract-libraries" depends="resolve" description="Extract libraries to build dir"> 1048 1029 <unzip dest="${build.dir}"> 1049 1030 <fileset refid="runtime.fileset"/> … … 1117 1098 </unzip> 1118 1099 </target> 1119 <target name="sources" description="Generate sjar file of JOSM source files and its dependencies" depends="init,epsg,resolve">1100 <target name="sources" description="Generate jar file of JOSM source files and its dependencies" depends="init,epsg,resolve"> 1120 1101 <ivy:cachefileset log="download-only" setid="sources.fileset" conf="sources"/> 1121 1102 <jar destfile="${dist-sources.jar}" level="${clevel}"> … … 1130 1111 <ivy:retrieve pattern="${lib.dir}/tools/[artifact]-[type].[ext]" conf="javacc,checkstyle,pmd,spotbugs,errorprone" file="${tools.ivy}"/> 1131 1112 </target> 1132 <target name="ivy-report" description="Generate sIvy reports of dependency resolving" depends="resolve">1113 <target name="ivy-report" description="Generate Ivy reports of dependency resolving" depends="resolve"> 1133 1114 <ivy:report todir="${tools.dir}/ivy-report" graph="false"/> 1134 1115 </target>
Note:
See TracChangeset
for help on using the changeset viewer.