(no commit message)
[utils] / build / trailer.xml
index a57b7da32c38c10f7affaaefb5b0008028a4e7c5..f5b63efc525de30f63ae580da051afd905c631bd 100644 (file)
@@ -56,6 +56,7 @@
        <delete dir="${module.docbase.dir}" />
        <delete dir="${module.report.dir}" />
        <delete dir="${module.sql.dir}" />
+       <delete dir="${module.build.dir}"/>
 </target>
 
 <target name="clean-deps" depends="init_directory_properties">
        Check style, 
        ============================================================================ -->
 
-<target name="checkstyle" depends="testclasses">
-       <checkstyle config="${build.dir}/${checkstyle.rules}"
-               failOnViolation="false">
-               <classpath>
-                 <path refid="module.build.path"/>
-               </classpath>
-               <fileset dir="${module.source.dir}" includes="**/*.java" />
-               <formatter type="plain" />
-       </checkstyle>
-       <checkstyle config="${build.dir}/${checkstyle.rules}"
+<target name="checkstyle-impl">
+   <checkstyle config="${build.dir}/${checkstyle.rules}"
                failOnViolation="false">
                <classpath>
-                 <pathelement path="${module.testbuild.path}"/>
+                 <pathelement path="${checkstyle.classpath}"/>
                </classpath>
-               <fileset dir="${module.test.dir}" includes="**/*.java" />
-               <formatter type="plain" />
+               <fileset dir="${checkstyle.srcdir}" includes="**/*.java"/>
+               <formatter type="xml" tofile="${module.checkstyle.dir}/${checkstyle.report}.xml"/>
        </checkstyle>
+       <style style="${build.dir}/checkstyle-simple.xsl"
+                  in="${module.checkstyle.dir}/${checkstyle.report}.xml"
+                  out="${module.checkstyle.dir}/${checkstyle.report}.html"/>
+       <echo>Results are available at ${module.checkstyle.dir}/${checkstyle.report}.html</echo>
+</target>
+
+<target name="checkstyle" depends="testclasses">
+    <mkdir dir="${module.checkstyle.dir}"/>
+       <antcall target="checkstyle-impl">
+         <param name="checkstyle.classpath" refid="module.build.path"/>
+         <param name="checkstyle.srcdir" value="${module.source.dir}"/>
+         <param name="checkstyle.report" value="source-results"/>
+       </antcall>
+       <antcall target="checkstyle-impl">
+         <param name="checkstyle.classpath" refid="module.testbuild.path"/>
+         <param name="checkstyle.srcdir" value="${module.test.dir}"/>
+         <param name="checkstyle.report" value="test-results"/>
+       </antcall>
 </target>
 
 <!-- ============================================================================
     </emma>
   </target>
 
+<!-- =======================================================================
+   FORREST
+   ======================================================================-->
+  <target name="forrest" description="runs Forrest">
+    <property name="forrest.home" location="${env.FORREST_HOME}" />
+    <property name="forrest.ant.home" location="${forrest.home}/tools/ant" />
+    <java classname="org.apache.tools.ant.Main" fork="true" failonerror="true" maxmemory="128M">
+      <classpath>
+        <fileset dir="${forrest.ant.home}/lib">
+          <include name="*.jar" />
+        </fileset>
+        <pathelement path="${java.home}/../lib/tools.jar" />
+      </classpath>
+      <sysproperty key="ant.home" value="${forrest.ant.home}" />
+      <sysproperty key="forrest.home" value="${forrest.home}" />
+      <sysproperty key="basedir" value="${basedir}" />
+      <sysproperty key="java.endorsed.dirs" value="${forrest.home}/lib/endorsed" />
+      <arg line="-f ${forrest.home}/main/forrest.build.xml" />
+    </java>
+  </target> 
 
 <!--  ============================================================================
       Database targets