(no commit message)
[utils] / build / trailer.xml
index 22b33953ed7dd4bdcbd974870eab90ba9b434f81..d210ff5ca3be533c87b7e58407231f383fc1f76b 100644 (file)
@@ -40,6 +40,9 @@
   <antcall target="test.d">
     <param name="download.dir" value="${test.lib.dir}"/>
   </antcall>
+  <antcall target="ant.d">
+    <param name="download.dir" value="${ant.downloaded.lib.dir}"/>
+  </antcall>
   <antcall target="module.test.deps">
     <param name="download.dir" value="${test.lib.dir}"/>
   </antcall>
        <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">
-  <delete dir="${external.lib.dir}"/>
-  <delete dir="${test.lib.dir}"/>
+  <delete>
+    <fileset dir="${external.lib.dir}" includes="*"/>
+  </delete>
+  <delete>
+    <fileset dir="${test.lib.dir}" includes="*"/>
+  </delete>
+  <delete>
+    <fileset dir="${ant.downloaded.lib.dir}" includes="*"/>
+  </delete>
 </target>
 
 <!-- ============================================================================
        <javadoc packagenames="*" author="true" version="true" private="yes"
                source="${javac.source}" doclet="com.tarsec.javadoc.pdfdoclet.PDFDoclet"
                docletpathref="pdfdoclet.path"
+               classpath="${module.classpath}"
+               sourcepath="${module.source.dir}"
                additionalparam="-pdf ${module.pdfdoc.dir}/${module.name}.pdf">
-               <fileset dir="${module.source.dir}">
+               <!-- fileset dir="${module.source.dir}">
                        <include name="**/*.java" />
-               </fileset>
+               </fileset -->
        </javadoc>
        <echo
                message="Unfortuantely, this target will have generated some errors but the pdf will still look fine" />
+       <echo>Result is available in ${module.pdfdoc.dir}"</echo>
 </target>
 
 <!-- ============================================================================
                docletpathref="doccheck.path" 
                classpath="${module.classpath}"
                sourcepath="${module.source.dir}">
-               <!-- fileset dir="${module.source.dir}">
-                       <include name="**/*.java" />
-               </fileset -->
        </javadoc>
+       <echo>Results are available in ${module.doccheck.dir}"</echo>
 </target>
 
 <!-- ============================================================================
   </delete> 
 </target>
        
-<target name="dist-lite-product" depends="jar">
+<target name="dist-lite-product" depends="deps,jar">
     <mkdir dir="${module.dist.dir}"/>
        <delete>
                <fileset dir="${module.dist.dir}" excludes="**/CVS" />
                        <include name="**/*.pdf" />
                </fileset>
        </copy>
+       <if>
+         <isset property="webroot.dir"/>
+         <then>
+           <jar destfile="${module.dist.dir}/${module.name}.war"
+                    basedir="${webroot.dir}"/>
+         </then>
+       </if>
 </target>
 
-<target name="dist-lite-test" depends="testclasses">
+<target name="dist-lite-test" depends="deps,testclasses">
     <jar destfile="${module.dist.dir}/${module.testjar.name}"
                basedir="${module.testclasses.dir}" 
                includes="**/*.class"/>
 </target>
 
 <target name="dist-lite" depends="clean,dist-lite-product,dist-lite-test">
+  <if> 
+    <isset property="post-dist-lite"/>
+       <then> 
+         <antcall target="post-dist-lite"/>
+       </then>
+  </if>
 </target>
 
 <target name="dist-javadoc" depends="javadoc,pdfdoc,testjavadoc">
        Check style, 
        ============================================================================ -->
 
-<target name="checkstyle" depends="testclasses">
-       <checkstyle config="${build.dir}/${checkstyle.rules}"
-               failOnViolation="false" classpathref="module.testbuild.path">
-               <fileset dir="${module.source.dir}" includes="**/*.java" />
-               <formatter type="plain" />
-       </checkstyle>
-       <checkstyle config="${build.dir}/${checkstyle.test.rules}"
-               failOnViolation="false" classpathref="module.testbuild.path">
-               <fileset dir="${module.test.dir}" includes="**/*.java" />
-               <formatter type="plain" />
+<target name="checkstyle-impl">
+   <checkstyle config="${build.dir}/${checkstyle.rules}"
+               failOnViolation="false">
+               <classpath>
+                 <pathelement path="${checkstyle.classpath}"/>
+               </classpath>
+               <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