Browse Source

1. Make checkstyle target work independently of CWD.

2. Add a target to display the text report inline, for easy hyperlink navigation.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277174 13f79535-47bb-0310-9956-ffa450edef68
master
Jesse N. Glick 20 years ago
parent
commit
503492da23
1 changed files with 13 additions and 8 deletions
  1. +13
    -8
      check.xml

+ 13
- 8
check.xml View File

@@ -18,13 +18,13 @@
</description> </description>


<import file="build.xml"/> <import file="build.xml"/>
<property name="config.dir" value="${etc.dir}/checkstyle"/>
<property name="config.dir" location="${etc.dir}/checkstyle"/>


<property name="checkstyle.reportdir" value="${build.dir}/reports/checkstyle"/>
<property name="checkstyle.raw" value="${checkstyle.reportdir}/raw.xml"/>
<property name="stylesheet.html" value="${config.dir}/checkstyle-frames.xsl"/>
<property name="stylesheet.text" value="${config.dir}/checkstyle-text.xsl"/>
<property name="stylesheet.xdoc" value="${config.dir}/checkstyle-xdoc.xsl"/>
<property name="checkstyle.reportdir" location="${build.dir}/reports/checkstyle"/>
<property name="checkstyle.raw" location="${checkstyle.reportdir}/raw.xml"/>
<property name="stylesheet.html" location="${config.dir}/checkstyle-frames.xsl"/>
<property name="stylesheet.text" location="${config.dir}/checkstyle-text.xsl"/>
<property name="stylesheet.xdoc" location="${config.dir}/checkstyle-xdoc.xsl"/>


<property name="checkstyle.basedir" location="${java.dir}"/> <property name="checkstyle.basedir" location="${java.dir}"/>


@@ -35,7 +35,7 @@
<taskdef resource="simiantask.properties"/> <taskdef resource="simiantask.properties"/>
<taskdef resource="checkstyletask.properties"/> <taskdef resource="checkstyletask.properties"/>


<target name="checkstyle" description="--> checks Ant codebase according to ${config.dir}/chestyle-config">
<target name="checkstyle" description="--> checks Ant codebase according to ${config.dir}/checkstyle-config">
<mkdir dir="${checkstyle.reportdir}"/> <mkdir dir="${checkstyle.reportdir}"/>
<checkstyle config="${config.dir}/checkstyle-config" failOnViolation="false"> <checkstyle config="${config.dir}/checkstyle-config" failOnViolation="false">
<formatter type="xml" toFile="${checkstyle.raw}"/> <formatter type="xml" toFile="${checkstyle.raw}"/>
@@ -60,6 +60,11 @@
out="${checkstyle.reportdir}/report.txt"> out="${checkstyle.reportdir}/report.txt">
</style> </style>
</target> </target>
<target name="textreport-display" depends="textreport" description="--> generates a text checkstyle report and displays it immediately">
<loadfile property="report" srcfile="${checkstyle.reportdir}/report.txt"/>
<echo>${report}</echo>
</target>


<target name="xdocreport" description="--> generates a xdoc checkstyle report"> <target name="xdocreport" description="--> generates a xdoc checkstyle report">
<style in="${checkstyle.raw}" style="${stylesheet.xdoc}" <style in="${checkstyle.raw}" style="${stylesheet.xdoc}"
@@ -80,4 +85,4 @@
</simian> </simian>
</target> </target>


</project>
</project>

Loading…
Cancel
Save