Author: hibou
Date: Wed Feb 18 11:01:10 2009
New Revision: 745477

URL: http://svn.apache.org/viewvc?rev=745477&view=rev
Log:
IVYDE-48:
 - add simple target to generate checkstyle report

Added:
    ant/ivy/ivyde/trunk/checkstyle/   (with props)
Modified:
    ant/ivy/ivyde/trunk/build.xml
    
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/etc/checkstyle/checkstyle-config

Modified: ant/ivy/ivyde/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/build.xml?rev=745477&r1=745476&r2=745477&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/build.xml (original)
+++ ant/ivy/ivyde/trunk/build.xml Wed Feb 18 11:01:10 2009
@@ -41,6 +41,9 @@
     <property name="dist.dir" value="${basedir}/dist" />
     <property name="eclipse-doc.dir" 
value="${basedir}/org.apache.ivyde.eclipse/doc" />
     <property name="src.doc.dir" value="${basedir}/doc" />
+    <property name="checkstyle.src.dir" 
value="${basedir}/org.apache.ivyde.eclipse/src/etc/checkstyle" />
+    <property name="checkstyle.report.dir" 
value="${basedir}/checkstyle/report" />
+    <property name="checkstyle.lib" value="${basedir}/checkstyle/lib" />
 
     <target name="/release" description="Make the build artifacts tagged with 
the release version">
         <property name="forceContextQualifier" 
value="${version.qualifier}-${DSTAMP}${TSTAMP}-RELEASE" />
@@ -322,10 +325,42 @@
     </target>
 
     <!--
-            
======================================================================================
-            Targets related to prepare the build environment of IvyDE on 
hudson.
-            
======================================================================================
-         -->
+        
======================================================================================
+        Targets related to checkstyle
+        
======================================================================================
+    -->
+
+    <target name="checkstyle-get-lib">
+        <mkdir dir="${checkstyle.lib}" />
+        <get 
src="http://repo1.maven.org/maven2/checkstyle/checkstyle/4.3/checkstyle-4.3.jar";
 dest="${checkstyle.lib}/checkstyle-4.3.jar" />
+        <get 
src="http://repo1.maven.org/maven2/antlr/antlr/2.7.6/antlr-2.7.6.jar"; 
dest="${checkstyle.lib}/antlr-2.7.6.jar" />
+        <get 
src="http://repo1.maven.org/maven2/commons-beanutils/commons-beanutils-core/1.7.0/commons-beanutils-core-1.7.0.jar";
 dest="${checkstyle.lib}/commons-beanutils-core-1.7.0.jar" />
+        <get 
src="http://repo1.maven.org/maven2/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar";
 dest="${checkstyle.lib}/commons-logging-1.0.3.jar" />
+    </target>
+
+    <target name="checkstyle" description="Generate checkstyle report">
+        <path id="checkstyle.classpath">
+            <fileset dir="${checkstyle.lib}" />
+        </path>
+        <taskdef resource="checkstyletask.properties" 
classpathref="checkstyle.classpath" />
+
+        <mkdir dir="${checkstyle.report.dir}" />
+        <checkstyle config="${checkstyle.src.dir}/checkstyle-config" 
failOnViolation="false" failureProperty="checkstyle.failed">
+            <classpath>
+                <path refid="checkstyle.classpath" />
+            </classpath>
+            <formatter type="xml" 
toFile="${checkstyle.report.dir}/checkstyle.xml" />
+            <fileset dir="org.apache.ivyde.eclipse/src/java">
+                <include name="**/*.java" />
+            </fileset>
+        </checkstyle>
+    </target>
+
+    <!--
+        
======================================================================================
+        Targets related to prepare the build environment of IvyDE on hudson.
+        
======================================================================================
+    -->
 
     <target name="hudson-prepare" 
depends="hudson-prepare-eclipse,hudson-prepare-properties,hudson-install-ivy" />
 

Propchange: ant/ivy/ivyde/trunk/checkstyle/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Feb 18 11:01:10 2009
@@ -0,0 +1,3 @@
+report
+lib
+

Modified: 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/etc/checkstyle/checkstyle-config
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/etc/checkstyle/checkstyle-config?rev=745477&r1=745476&r2=745477&view=diff
==============================================================================
--- 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/etc/checkstyle/checkstyle-config
 (original)
+++ 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/etc/checkstyle/checkstyle-config
 Wed Feb 18 11:01:10 2009
@@ -143,7 +143,7 @@
   </module>
   
   <module name="SuppressionFilter">
-    <property name="file" 
value="${basedir}/src/etc/checkstyle/checkstyle-suppress.xml"/>
+    <property name="file" 
value="${checkstyle.src.dir}/checkstyle-suppress.xml"/>
   </module>
   
 </module>


Reply via email to