Incorporate patch 590931 from Vijay Aravamudhan.
This commit is contained in:
parent
e7c7215349
commit
5b91d31fda
67
build.xml
67
build.xml
|
|
@ -46,7 +46,7 @@
|
|||
<path refid="tests.buildpath" />
|
||||
</path>
|
||||
|
||||
<target name="display.classpath">
|
||||
<target name="display.classpath" description="Displays the run classpath">
|
||||
<property name="asd" refid="run.classpath" />
|
||||
<echo message="Classpath is ${asd}" />
|
||||
</target>
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
<!-- -->
|
||||
<!-- Cleanup targets -->
|
||||
<!-- -->
|
||||
<target name="clean">
|
||||
<target name="clean" description="Cleans any directories and generated files">
|
||||
<delete>
|
||||
<fileset dir="src/checkstyle">
|
||||
<include name="**/Generated*.java"/>
|
||||
|
|
@ -72,7 +72,8 @@
|
|||
<!-- -->
|
||||
|
||||
<!-- Checks whether the grammar file is newer that the generated code -->
|
||||
<target name="check.antlr">
|
||||
<target name="check.antlr"
|
||||
description="Checks whether the grammar file is newer that the generated code">
|
||||
<uptodate property="uptodate.antlr"
|
||||
targetfile="${checkstyle.dir}/GeneratedJava14Lexer.java" >
|
||||
<srcfiles dir= "${checkstyle.dir}" includes="java.g,java14.g"/>
|
||||
|
|
@ -82,7 +83,8 @@
|
|||
<!-- Conditionally will compile the grammar. Deliberately do not use the -->
|
||||
<!-- antlr task as it requirs the ANTLR classes to be in the classpath -->
|
||||
<!-- which creates lots of problems. -->
|
||||
<target name="build.antlr" depends="check.antlr" unless="uptodate.antlr">
|
||||
<target name="build.antlr" depends="check.antlr" unless="uptodate.antlr"
|
||||
description="Conditionally compiles the grammar files">
|
||||
<java classname="antlr.Tool"
|
||||
classpath="${antlr-tools.jar}"
|
||||
fork="yes"
|
||||
|
|
@ -102,7 +104,8 @@
|
|||
<!-- -->
|
||||
<!-- COMPILE TARGETS -->
|
||||
<!-- -->
|
||||
<target name="compile.checkstyle" depends="build.antlr">
|
||||
<target name="compile.checkstyle" depends="build.antlr"
|
||||
description="Compiles the source code">
|
||||
<mkdir dir="target/checkstyle" />
|
||||
<depend srcdir="src/checkstyle"
|
||||
destdir="target/checkstyle" closure="yes"/>
|
||||
|
|
@ -117,7 +120,8 @@
|
|||
<!-- Compiles only the test code. Input files are excluded from
|
||||
compilation, they contain code like assert statements
|
||||
that does not compile on all JDKs -->
|
||||
<target name="compile.tests" depends="compile.checkstyle">
|
||||
<target name="compile.tests" depends="compile.checkstyle"
|
||||
description="Compiles the test code">
|
||||
<mkdir dir="target/tests" />
|
||||
<depend srcdir="src/tests" destdir="target/tests" closure="yes"/>
|
||||
<!-- start of a change to turn on compilation of all input files -->
|
||||
|
|
@ -136,7 +140,8 @@
|
|||
<!-- -->
|
||||
|
||||
<!-- runs the command line version on a file -->
|
||||
<target name="run.checkstyle" depends="compile.tests">
|
||||
<target name="run.checkstyle" depends="compile.tests"
|
||||
description="Runs the command line version on a file">
|
||||
<java classname="com.puppycrawl.tools.checkstyle.Main"
|
||||
fork="yes"
|
||||
dir="src/tests/com/puppycrawl/tools/checkstyle"
|
||||
|
|
@ -153,14 +158,16 @@
|
|||
</java>
|
||||
</target>
|
||||
|
||||
<target name="checkstyle.simple" depends="compile.tests">
|
||||
<target name="checkstyle.simple" depends="compile.tests"
|
||||
description="Runs checkstyle on a file to test white spaces">
|
||||
<taskdef resource="checkstyletask.properties">
|
||||
<classpath refid="run.classpath"/>
|
||||
</taskdef>
|
||||
<checkstyle file="src/tests/com/puppycrawl/tools/checkstyle/InputWhitespace.java"/>
|
||||
</target>
|
||||
|
||||
<target name="checkstyle.import" depends="compile.tests">
|
||||
<target name="checkstyle.import" depends="compile.tests"
|
||||
description="Runs checkstyle on a file to test imports">
|
||||
<taskdef name="checkstyle"
|
||||
classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
|
||||
<classpath refid="run.classpath"/>
|
||||
|
|
@ -171,7 +178,8 @@
|
|||
<echo message="THIS IS THE EXPECTED MESSAGE"/>
|
||||
</target>
|
||||
|
||||
<target name="checkstyle.checkstyle" depends="compile.checkstyle">
|
||||
<target name="checkstyle.checkstyle" depends="compile.checkstyle"
|
||||
description="Runs checkstyle on a file to test various rules">
|
||||
<taskdef name="checkstyle"
|
||||
classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
|
||||
<classpath refid="run.classpath"/>
|
||||
|
|
@ -200,7 +208,8 @@
|
|||
</checkstyle>
|
||||
</target>
|
||||
|
||||
<target name="checkstyle.noargs" depends="compile.checkstyle">
|
||||
<target name="checkstyle.noargs" depends="compile.checkstyle"
|
||||
description="Runs checkstyle with no arguments">
|
||||
<taskdef name="checkstyle"
|
||||
classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
|
||||
<classpath refid="run.classpath"/>
|
||||
|
|
@ -209,7 +218,8 @@
|
|||
<checkstyle/>
|
||||
</target>
|
||||
|
||||
<target name="checkstyle.another" depends="compile.checkstyle">
|
||||
<target name="checkstyle.another" depends="compile.checkstyle"
|
||||
description="Runs checkstyle with missing properties file">
|
||||
<taskdef name="checkstyle"
|
||||
classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
|
||||
<classpath refid="run.classpath"/>
|
||||
|
|
@ -218,7 +228,8 @@
|
|||
<checkstyle properties="xzzaaqqwet3ad"/>
|
||||
</target>
|
||||
|
||||
<target name="checkstyle.style" depends="compile.checkstyle">
|
||||
<target name="checkstyle.style" depends="compile.checkstyle"
|
||||
description="Runs checkstyle to test generation of error reports">
|
||||
<taskdef name="checkstyle"
|
||||
classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
|
||||
<classpath refid="run.classpath"/>
|
||||
|
|
@ -250,16 +261,19 @@
|
|||
</target>
|
||||
|
||||
<!-- Targets to verify that JUnit is in the classpath -->
|
||||
<target name="check.junit">
|
||||
<target name="check.junit"
|
||||
description="Checks whether JUnit is in the classpath">
|
||||
<available property="have.junit"
|
||||
classname="junit.framework.TestListener"/>
|
||||
</target>
|
||||
<target name="require.junit" depends="check.junit" unless="have.junit">
|
||||
<target name="require.junit" depends="check.junit" unless="have.junit"
|
||||
description="Fails if JUnit is not present in the classpath">
|
||||
<fail message="Need to have JUnit in your CLASSPATH to run the tests. Consider using the one in the lib directory."/>
|
||||
</target>
|
||||
|
||||
<!-- Targets to verify that Xalan is in the classpath -->
|
||||
<target name="check.xalan">
|
||||
<target name="check.xalan"
|
||||
description="Checks whether xalan is in the classpath">
|
||||
<condition property="have.xalan">
|
||||
<or>
|
||||
<!-- jdk 1.3 with modern Xalan -->
|
||||
|
|
@ -272,13 +286,15 @@
|
|||
</condition>
|
||||
</target>
|
||||
|
||||
<target name="require.xalan" depends="check.xalan" unless="have.xalan">
|
||||
<target name="require.xalan" depends="check.xalan" unless="have.xalan"
|
||||
description="Fails if xalan is not present in the classpath">
|
||||
<fail message="Need to have Xalan in your CLASSPATH to run the tests. You can download it from http://xml.apache.org/."/>
|
||||
</target>
|
||||
|
||||
<!-- To run the tests need Xalan in the classpath -->
|
||||
<target name="run.tests"
|
||||
depends="compile.tests,require.junit,require.xalan">
|
||||
depends="compile.tests,require.junit,require.xalan"
|
||||
description="Runs the tests for checkstyle">
|
||||
|
||||
<mkdir dir="${testreport.dir}"/>
|
||||
<property name="tests.dir"
|
||||
|
|
@ -310,7 +326,8 @@
|
|||
|
||||
</target>
|
||||
|
||||
<target name="check.tests.failed" if="tests.have.failed">
|
||||
<target name="check.tests.failed" if="tests.have.failed"
|
||||
description="Fails if the unit tests have failed">
|
||||
<property name="report"
|
||||
value="${basedir}/${testreport.dir}/index.html"/>
|
||||
<fail message="Unit tests failed - Report is available in ${report}"/>
|
||||
|
|
@ -319,7 +336,8 @@
|
|||
<!-- -->
|
||||
<!-- DIST TARGETS -->
|
||||
<!-- -->
|
||||
<target name="build.bindist" depends="compile.checkstyle, javadoc">
|
||||
<target name="build.bindist" depends="compile.checkstyle, javadoc"
|
||||
description="Builds the compressed distribution files">
|
||||
<delete dir="${dist.dir}/checkstyle-${version}" />
|
||||
<mkdir dir="${dist.dir}/checkstyle-${version}" />
|
||||
<jar jarfile="${dist.dir}/checkstyle-${version}/checkstyle-${version}.jar"
|
||||
|
|
@ -375,7 +393,8 @@
|
|||
src="${dist.dir}/checkstyle-${version}.tar" />
|
||||
</target>
|
||||
|
||||
<target name="build.srcdist" depends="checkstyle.checkstyle">
|
||||
<target name="build.srcdist" depends="checkstyle.checkstyle"
|
||||
description="Builds the compressed source files for distribution">
|
||||
<delete dir="${dist.dir}/checkstyle-src-${version}" />
|
||||
<mkdir dir="${dist.dir}/checkstyle-src-${version}" />
|
||||
<copy todir="${dist.dir}/checkstyle-src-${version}">
|
||||
|
|
@ -406,7 +425,8 @@
|
|||
src="${dist.dir}/checkstyle-src-${version}.tar" />
|
||||
</target>
|
||||
|
||||
<target name="javadoc" depends="compile.checkstyle">
|
||||
<target name="javadoc" depends="compile.checkstyle"
|
||||
description="Creates the javadoc html files">
|
||||
<mkdir dir="docs/api" />
|
||||
<move toDir="src/checkstyle">
|
||||
<fileset dir="src/checkstyle" includes="**/Generated*.java" />
|
||||
|
|
@ -425,5 +445,6 @@
|
|||
</target>
|
||||
|
||||
<!-- Added for GUMP testing -->
|
||||
<target name="gump" depends="build.bindist,build.srcdist,run.tests"/>
|
||||
<target name="gump" depends="build.bindist,build.srcdist,run.tests"
|
||||
description="Runs the test for GUMP testing"/>
|
||||
</project>
|
||||
|
|
|
|||
Loading…
Reference in New Issue