Changeset 16171 in josm for trunk/build.xml


Ignore:
Timestamp:
2020-03-17T23:05:22+01:00 (2 years ago)
Author:
simon04
Message:

see #16860 - Resolve Checkstyle using Apache Ivy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r16170 r16171  
    920920
    921921    <target name="checkstyle-compile" depends="init-properties">
     922        <ivy:cachepath file="${tools.ivy}" pathid="checkstyle.classpath" conf="checkstyle"/>
    922923        <mkdir dir="${checkstyle-build.dir}"/>
    923924        <javac sourcepath="" srcdir="${checkstyle.dir}/src" failonerror="true"
    924925            destdir="${checkstyle-build.dir}" target="${java.lang.version}" source="${java.lang.version}" debug="on"
    925926            includeantruntime="false" createMissingPackageInfoClass="false"
    926             encoding="UTF-8" classpath="${checkstyle.dir}/checkstyle-all.jar">
     927            encoding="UTF-8" classpathref="checkstyle.classpath">
    927928        </javac>
    928929    </target>
     
    930931        <exec append="false" osfamily="unix" executable="bash" failifexecutionfails="true">
    931932            <arg value="-c"/>
    932             <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 '${checkstyle.dir}/checkstyle-all.jar:${checkstyle-build.dir}' com.puppycrawl.tools.checkstyle.Main -c ${checkstyle.dir}/josm_checks.xml | sed -e 's:\([^ ]*\) [^:]*/\([^:/]*.java\:[^:]*\):(\2)\1:'"/>
     933            <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}:${checkstyle-build.dir}' com.puppycrawl.tools.checkstyle.Main -c ${checkstyle.dir}/josm_checks.xml | sed -e 's:\([^ ]*\) [^:]*/\([^:/]*.java\:[^:]*\):(\2)\1:'"/>
    933934        </exec>
    934935        <exec append="false" osfamily="windows" executable="powershell" failifexecutionfails="true">
    935936            <arg value="/c"/>
    936             <arg value="svn status -q --ignore-externals src test | ForEach-Object {java -cp '${checkstyle.dir}/checkstyle-all.jar;${checkstyle-build.dir}' com.puppycrawl.tools.checkstyle.Main -c ${checkstyle.dir}/josm_checks.xml $_.split(' ')[7]}"/>
     937            <arg value="svn status -q --ignore-externals src test | ForEach-Object {java -cp '${toString:checkstyle.classpath};${checkstyle-build.dir}' com.puppycrawl.tools.checkstyle.Main -c ${checkstyle.dir}/josm_checks.xml $_.split(' ')[7]}"/>
    937938        </exec>
    938939    </target>
    939940    <target name="checkstyle" depends="checkstyle-compile">
    940         <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties"
    941              classpath="${checkstyle.dir}/checkstyle-all.jar:${checkstyle-build.dir}"/>
     941        <taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties">
     942            <classpath refid="checkstyle.classpath"/>
     943            <classpath path="${checkstyle-build.dir}"/>
     944        </taskdef>
    942945        <checkstyle config="${checkstyle.dir}/josm_checks.xml">
    943946            <fileset dir="${base.dir}/src/org/openstreetmap/josm" includes="**/*.java"
     
    11781181        <ivy:retrieve pattern="${lib.dir}/runtime/[artifact]-[type].[ext]" conf="runtime"/>
    11791182        <ivy:retrieve pattern="${lib.dir}/sources/[artifact]-[type].[ext]" conf="sources"/>
    1180         <ivy:retrieve pattern="${lib.dir}/tools/[artifact]-[type].[ext]" conf="javacc" file="${tools.ivy}"/>
     1183        <ivy:retrieve pattern="${lib.dir}/tools/[artifact]-[type].[ext]" conf="javacc,checkstyle" file="${tools.ivy}"/>
    11811184    </target>
    11821185</project>
Note: See TracChangeset for help on using the changeset viewer.