diff options
author | Jeremias Maerki <jeremias@apache.org> | 2002-09-05 15:53:56 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2002-09-05 15:53:56 +0000 |
commit | 4c63fe8f04305da54b43417fa13d0549a8bcbbb7 (patch) | |
tree | 1681800f76f149f7dcb5b6ae8fd71f9bb4196c2d | |
parent | 21b96e895154ee6ff1053622104d87bec4caf4d0 (diff) | |
download | xmlgraphics-fop-4c63fe8f04305da54b43417fa13d0549a8bcbbb7.tar.gz xmlgraphics-fop-4c63fe8f04305da54b43417fa13d0549a8bcbbb7.zip |
Added an optional target to generate a Checkstyle report.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195153 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | build.xml | 25 | ||||
-rw-r--r-- | checkstyle.cfg | 10 | ||||
-rw-r--r-- | checkstyle.header | 6 |
3 files changed, 41 insertions, 0 deletions
@@ -169,6 +169,12 @@ Sometimes ant gives out this warnings, but the build is finished without any pro <include name="fop.jar"/> </fileset> </path> + + <path id="checkstylepath"> + <fileset dir="lib"> + <include name="checkstyle-all-*.jar"/> + </fileset> + </path> <!-- =================================================================== --> <!-- Initialization target --> @@ -682,6 +688,25 @@ Sometimes ant gives out this warnings, but the build is finished without any pro </target> <!-- =================================================================== --> + <!-- Checkstyle --> + <!-- =================================================================== --> + <target name="checkstyle" depends="prepare" description="Runs Checkstyle for a code quality report"> + <available property="checkstyle.available" classname="com.puppycrawl.tools.checkstyle.CheckStyleTask" classpathref="checkstylepath"/> + <fail message="Please put checkstyle-all-*.jar in the lib directory. Get it from http://checkstyle.sourceforge.net" unless="checkstyle.available"/> + <taskdef name="checkstyle" classname="com.puppycrawl.tools.checkstyle.CheckStyleTask" classpathref="checkstylepath"/> + <checkstyle properties="checkstyle.cfg" failonviolation="false"> + <fileset dir="${src.dir}" includes="org/apache/fop/**/*.java"/> + <formatter type="plain" toFile="${build.dir}/checkstyle_report.txt"/> + <formatter type="xml" toFile="${build.dir}/checkstyle_report.xml"/> + </checkstyle> + <available property="checkstyle.stylesheet.available" file="checkstyle-noframes.xsl"/> + <antcall target="checkstyle-html"/> + </target> + <target name="checkstyle-html" if="checkstyle.stylesheet.available"> + <style in="${build.dir}/checkstyle_report.xml" out="${build.dir}/checkstyle_report.html" style="checkstyle-noframes.xsl"/> + </target> + + <!-- =================================================================== --> <!-- Creates the distribution --> <!-- =================================================================== --> <target name="dist" depends="dist-src,dist-bin" description="Generates the distribution package"/> diff --git a/checkstyle.cfg b/checkstyle.cfg new file mode 100644 index 000000000..01342dfcb --- /dev/null +++ b/checkstyle.cfg @@ -0,0 +1,10 @@ +checkstyle.allow.tabs = no +checkstyle.tab.width = 4 +checkstyle.allow.noauthor = yes +checkstyle.maxlinelen = 100 +checkstyle.javadoc.scope = protected +checkstyle.ignore.importlength = yes +checkstyle.ignore.whitespace.cast = yes +checkstyle.allow.protected = yes +checkstyle.header.file = checkstyle.header +checkstyle.header.regexp = yes
\ No newline at end of file diff --git a/checkstyle.header b/checkstyle.header new file mode 100644 index 000000000..bd80d3f07 --- /dev/null +++ b/checkstyle.header @@ -0,0 +1,6 @@ +/\* + \* \$Id.*\$ + \* Copyright \(C\) [\d\-]*2002 The Apache Software Foundation. All rights reserved. + \* For details on use and redistribution please refer to the + \* LICENSE file included with these sources. + \*/
\ No newline at end of file |