Changeset 16171 in josm


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

see #16860 - Resolve Checkstyle using Apache Ivy

Location:
trunk
Files:
1 deleted
2 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>
  • trunk/tools/ivy.xml

    r16170 r16171  
    55    <configurations>
    66        <conf name="javacc" description="Everything needed for running JavaCC"/>
     7        <conf name="checkstyle" description="Everything needed for running Checkstyle"/>
    78        <conf name="proguard" description="Everything needed for running ProGuard"/>
    89        <conf name="pmd" description="Everything needed for running PMD"/>
     
    1213        <!-- javacc->default -->
    1314        <dependency org="net.java.dev.javacc" name="javacc" rev="7.0.3" conf="javacc->default"/>
     15        <!-- checkstyle->default -->
     16        <dependency org="com.puppycrawl.tools" name="checkstyle" rev="8.27" conf="checkstyle->default"/>
    1417        <!-- proguard->default -->
    1518        <dependency org="net.sf.proguard" name="proguard-anttask" rev="6.2.2" conf="proguard->default"/>
Note: See TracChangeset for help on using the changeset viewer.