Changeset 17338 in josm for trunk


Ignore:
Timestamp:
2020-11-23T20:25:06+01:00 (3 years ago)
Author:
simon04
Message:

build.xml: add descriptions to Ant tasks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r17254 r17338  
    1616         xmlns:unless="ant:unless"
    1717>
    18     <target name="init-ivy">
     18    <target name="init-ivy" description="Initialize dependency management system Apache Ivy">
    1919        <property name="ivy.version" value="2.5.0"/>
    2020        <dirname property="base.dir" file="${ant.file.josm}"/>
     
    3131        <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.jar.file}"/>
    3232    </target>
    33     <target name="init-properties">
     33    <target name="init-properties" description="Initialize properties for the build">
    3434        <property environment="env"/>
    3535        <!-- Load properties in a target and not at top level, so this build file can be
     
    100100        </condition>
    101101    </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">
    106104        <exec append="false" output="${base.dir}/REVISION.XML" executable="svn" dir="${base.dir}" resultproperty="svn.info.result">
    107105            <env key="LANG" value="C"/>
     
    111109        </exec>
    112110    </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">
    117113        <exec append="false" output="${base.dir}/REVISION.XML" executable="git" dir="${base.dir}">
    118114            <arg value="log"/>
     
    131127                       replace="&lt;info&gt;&lt;entry&gt;&lt;commit revision=&quot;\1&quot;&gt;&lt;date&gt;\2&lt;/date&gt;&lt;/commit&gt;&lt;/entry&gt;&lt;/info&gt;"/>
    132128    </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">
    137131        <xmlproperty file="${base.dir}/REVISION.XML" prefix="version" keepRoot="false" collapseAttributes="true"/>
    138132        <delete file="${base.dir}/REVISION.XML"/>
     
    150144</echo>
    151145    </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">
    156148        <schemavalidate file="${resources.dir}/data/defaultpresets.xml" >
    157149            <schema namespace="http://josm.openstreetmap.de/tagging-preset-1.0" file="${resources.dir}/data/tagging-preset.xsd" />
    158150        </schemavalidate>
    159151    </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">
    164154        <echo>Revision ${version.entry.commit.revision}</echo>
    165155        <copy file="CONTRIBUTION" todir="${build.dir}"/>
     
    244234        </exec>
    245235    </target>
    246     <target name="javacc" depends="init" unless="javacc.notRequired">
     236    <target name="javacc" depends="init" unless="javacc.notRequired" description="Compile the MapCSS compiler">
    247237        <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="javacc.classpath" conf="javacc"/>
    248238        <mkdir dir="${mapcss.dir}/parsergen"/>
     
    258248        </java>
    259249    </target>
    260     <target name="compile-cots" depends="init" description="Compiles third-party dependencies not retrieved with Ivy">
     250    <target name="compile-cots" depends="init" description="Compile third-party dependencies not retrieved with Ivy">
    261251        <!-- COTS -->
    262252        <javac srcdir="${src.dir}" includes="com/kitfox/**" excludes="**/package-info.java" nowarn="on" encoding="iso-8859-1"
     
    269259        </javac>
    270260    </target>
    271     <target name="compile" depends="init,javacc,compile-cots" unless="compile.notRequired" description="Compiles JOSM">
     261    <target name="compile" depends="init,javacc,compile-cots" unless="compile.notRequired" description="Compile JOSM">
    272262        <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="errorprone.classpath" conf="errorprone"/>
    273263        <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="errorprone_javac.classpath" conf="errorprone_javac"/>
     
    312302        </copy>
    313303    </target>
    314     <target name="init" depends="init-properties,resolve">
     304    <target name="init" depends="init-properties,resolve" description="Initialize the build">
    315305        <uptodate property="javacc.notRequired" targetfile="${mapcss.dir}/parsergen/MapCSSParser.java" >
    316306            <srcfiles dir="${mapcss.dir}" includes="MapCSSParser.jj"/>
     
    323313        <mkdir dir="${dist.dir}"/>
    324314    </target>
    325     <target name="javadoc" depends="init">
     315    <target name="javadoc" depends="init" description="Generate API documentation from JOSM source files">
    326316        <javadoc destdir="javadoc"
    327317                sourcepath="${src.dir}"
     
    349339        </javadoc>
    350340    </target>
    351     <target name="clean" depends="init-properties">
     341    <target name="clean" depends="init-properties" description="Delete all build files">
    352342        <delete dir="${build.dir}"/>
    353343        <delete dir="${proj-build.dir}"/>
     
    369359        </sequential>
    370360    </macrodef>
    371     <target name="test-init" depends="init">
     361    <target name="test-init" depends="init" description="Initialize the tests">
    372362        <mkdir dir="${test.dir}/build"/>
    373363        <mkdir dir="${test.dir}/build/unit"/>
     
    388378        <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="${tools.dir}/jacocoant.jar" />
    389379    </target>
    390     <target name="test-clean" depends="init-properties">
     380    <target name="test-clean" depends="init-properties" description="Delete all built test files">
    391381        <delete dir="${test.dir}/build"/>
    392382        <delete dir="${test.dir}/report"/>
     
    413403        </sequential>
    414404    </macrodef>
    415     <target name="test-compile" depends="test-init,compile,extract-libraries,epsg,copy-resources" description="Compiles all tests">
     405    <target name="test-compile" depends="test-init,compile,extract-libraries,epsg,copy-resources" description="Compile all tests">
    416406        <call-javac testfamily="unit">
    417407            <cp-elements>
     
    558548        </jacoco:report>
    559549    </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">
    561551        <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="proguard.classpath" conf="proguard"/>
    562552        <taskdef resource="proguard/ant/task.properties" classpathref="proguard.classpath"/>
     
    789779    </target>
    790780
    791     <target name="script-compile" depends="test-compile" description="Compiles all scripts">
     781    <target name="script-compile" depends="test-compile" description="Compile all scripts">
    792782        <javac sourcepath="" srcdir="${base.dir}/scripts" failonerror="true" includes="*.java"
    793783               destdir="${script-build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on"
     
    824814    </macrodef>
    825815
    826     <target name="taginfo" depends="script-compile">
     816    <target name="taginfo" depends="script-compile" description="Generate project files Taginfo">
    827817        <_taginfo type="mappaint" output="taginfo_style.json"/>
    828818        <_taginfo type="presets" output="taginfo_presets.json"/>
     
    830820    </target>
    831821
    832     <target name="imageryindex" depends="script-compile">
     822    <target name="imageryindex" depends="script-compile"  description="Check editor imagery difference">
    833823        <echo message="Checking editor imagery difference"/>
    834824        <java classname="SyncEditorLayerIndex" failonerror="true" fork="false">
     
    846836    </target>
    847837
    848     <target name="imageryindexdownload">
     838    <target name="imageryindexdownload" description="Download and check editor imagery">
    849839        <exec append="false" executable="wget" failifexecutionfails="true">
    850840            <arg value="https://josm.openstreetmap.de/maps"/>
     
    868858    </target>
    869859
    870     <target name="checkstyle-compile" depends="init">
     860    <target name="checkstyle-compile" depends="init" description="Compile Checkstyle rules">
    871861        <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="checkstyle.classpath" conf="checkstyle"/>
    872862        <mkdir dir="${checkstyle-build.dir}"/>
     
    877867        </javac>
    878868    </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">
    880870        <exec append="false" osfamily="unix" executable="bash" failifexecutionfails="true">
    881871            <arg value="-c"/>
     
    887877        </exec>
    888878    </target>
    889     <target name="checkstyle" depends="checkstyle-compile">
     879    <target name="checkstyle" depends="checkstyle-compile" description="Run Checkstyle on the source files">
    890880        <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties">
    891881            <classpath refid="checkstyle.classpath"/>
     
    902892    </target>
    903893
    904     <target name="spotbugs" depends="dist">
     894    <target name="spotbugs" depends="dist" description="Run SpotBugs on the source files">
    905895        <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="spotbugs.classpath" conf="spotbugs"/>
    906896        <taskdef name="spotbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="spotbugs.classpath"/>
     
    918908    </target>
    919909
    920     <target name="pmd" depends="init">
     910    <target name="pmd" depends="init" description="Run PMD on the source files">
    921911        <ivy:cachepath log="download-only" file="${tools.ivy}" pathid="pmd.classpath" conf="pmd"/>
    922912        <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.classpath"/>
     
    936926    </target>
    937927
    938     <target name="run" depends="dist">
     928    <target name="run" depends="dist" description="Run JOSM">
    939929        <java jar="${dist.jar}" fork="true">
    940930            <arg value="--set=expert=true"/>
     
    943933        </java>
    944934    </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">
    949937        <property name="proj-classpath" location="${build.dir}"/>
    950938        <mkdir dir="${proj-build.dir}"/>
     
    955943        </javac>
    956944    </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">
    961947        <touch file="${epsg.output}" mkdirs="true"/>
    962948        <java classname="BuildProjectionDefinitions" failonerror="true" fork="true">
     
    970956        </java>
    971957    </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">
    976960        <java classname="org.openstreetmap.josm.data.projection.ProjectionRefTest" failonerror="true" fork="true">
    977961            <classpath>
     
    987971        </java>
    988972    </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">
    993974        <delete dir="${modules.dir}"/>
    994975        <mkdir dir="${modules.dir}"/>
     
    10451026        <ivy:cachepath log="download-only" pathid="test.path" conf="test"/>
    10461027    </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">
    10481029        <unzip dest="${build.dir}">
    10491030            <fileset refid="runtime.fileset"/>
     
    11171098        </unzip>
    11181099    </target>
    1119     <target name="sources" description="Generates jar 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">
    11201101        <ivy:cachefileset log="download-only" setid="sources.fileset" conf="sources"/>
    11211102        <jar destfile="${dist-sources.jar}" level="${clevel}">
     
    11301111        <ivy:retrieve pattern="${lib.dir}/tools/[artifact]-[type].[ext]" conf="javacc,checkstyle,pmd,spotbugs,errorprone" file="${tools.ivy}"/>
    11311112    </target>
    1132     <target name="ivy-report" description="Generates Ivy reports of dependency resolving" depends="resolve">
     1113    <target name="ivy-report" description="Generate Ivy reports of dependency resolving" depends="resolve">
    11331114        <ivy:report todir="${tools.dir}/ivy-report" graph="false"/>
    11341115    </target>
Note: See TracChangeset for help on using the changeset viewer.