You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by vg...@apache.org on 2004/02/23 03:33:58 UTC

cvs commit: xml-xindice build.xml

vgritsenko    2004/02/22 18:33:58

  Modified:    .        build.xml
  Log:
  turn on clover coverage if clover is present in classpath
  
  Revision  Changes    Path
  1.74      +69 -36    xml-xindice/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-xindice/build.xml,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- build.xml	12 Feb 2004 03:12:18 -0000	1.73
  +++ build.xml	23 Feb 2004 02:33:58 -0000	1.74
  @@ -41,18 +41,17 @@
   
   <project name="xml-xindice" default="release" basedir=".">
   
  -   <!--
  -     - Give the chance to overwrite the definitions by setting the
  -     - build.properties file.
  -     -->
  +    <!--
  +      - Give the chance to overwrite the definitions by setting the
  +      - build.properties file.
  +      -->
       <property environment="ENVIRONMENT"/>
       <property file="local.build.properties"/>
       <property file="build.properties"/>
   
  -    <!-- =================================================================== -->
  -    <!-- Build definitions                                                   -->
  -    <!-- =================================================================== -->
  -
  +    <!--
  +      - Build definitions
  +      -->
       <fileset dir="${jar.dir}" id="core.jars">
           <include name="*.jar"/>
           <exclude name="servlet*.jar"/>
  @@ -64,7 +63,9 @@
           <include name="*.jar"/>
       </fileset>
   
  -    <!-- classpath to use within project -->
  +    <!--
  +      - Classpath to use within project
  +      -->
       <path id="project.class.path">
           <!-- compiled classes directory -->
           <pathelement location="${src.build.dir}"/>
  @@ -79,9 +80,9 @@
           <filter token="VERSION" value="${project.version}"/>
       </target>
   
  -    <!-- =================================================================== -->
  -    <!-- Definition of the main targets                                      -->
  -    <!-- =================================================================== -->
  +    <!--
  +      - Definition of the main targets
  +      -->
       <target name="build" depends="src-build, test-build, guide-build"
               description="Compiles the source and test code">
       </target>
  @@ -93,10 +94,10 @@
           <delete dir="${dist.dir}"/>
       </target>
   
  -    <!-- =================================================================== -->
  -    <!-- Compiles the source code                                            -->
  -    <!-- =================================================================== -->
  -    <target name="src-build" depends="init">
  +    <!-- 
  +      - Compiles the source code
  +      -->
  +    <target name="src-build" depends="init, clover.on">
           <mkdir dir="${src.build.dir}"/>
           <javac srcdir="${src.dir}" destdir="${src.build.dir}" debug="${compile.debug}" optimize="${compile.optimize}" nowarn="${compile.nowarn}" deprecation="${compile.deprecation}" verbose="${compile.verbose}">
               <classpath>
  @@ -109,9 +110,9 @@
           <antcall target="test-clean"/>
       </target>
   
  -    <!-- =================================================================== -->
  -    <!-- Compiles and create the release for the guide code                  -->
  -    <!-- =================================================================== -->
  +    <!--
  +      - Compiles and create the release for the guide code
  +      -->
       <target name="guide-build" depends="init">
           <mkdir dir="${guide.build.dir}"/>
           <javac srcdir="${guide.src.dir}" destdir="${guide.build.dir}" debug="${compile.debug}" optimize="${compile.optimize}" nowarn="${compile.nowarn}" deprecation="${compile.deprecation}" verbose="${compile.verbose}">
  @@ -135,10 +136,10 @@
           <delete dir="${guide.build.dir}"/>
       </target>
   
  -    <!-- =================================================================== -->
  -    <!-- Compiles and executes the tests                                     -->
  -    <!-- =================================================================== -->
  -    <target name="test-build" depends="src-build">
  +    <!--
  +      - Compiles and executes the tests
  +      -->
  +    <target name="test-build" depends="src-build, clover.off">
           <mkdir dir="${test.build.dir}"/>
           <mkdir dir="${test.result.dir}"/>
           <javac srcdir="${test.src.dir}" destdir="${test.build.dir}" debug="${compile.debug}" optimize="${compile.optimize}" nowarn="${compile.nowarn}" deprecation="${compile.deprecation}" verbose="${compile.verbose}">
  @@ -264,9 +265,9 @@
           <delete dir="${test.build.dir}"/>
       </target>
   
  -    <!-- =================================================================== -->
  -    <!-- Build the Xindice archives (jar and war)                            -->
  -    <!-- =================================================================== -->
  +    <!--
  +      - Build the Xindice archives (jar and war)
  +      -->
       <target name="jar-release" depends="src-build, test-build">
           <jar jarfile="${dist.dir}/${project.filename}-${project.version}.jar" basedir="${src.build.dir}">
               <manifest>
  @@ -320,9 +321,9 @@
           <delete file="${tomcat.home}/webapps/${project.filename}-${project.version}.xml"/>
       </target>
   
  -    <!-- =================================================================== -->
  -    <!-- Documentation Build Targets                                         -->
  -    <!-- =================================================================== -->
  +    <!--
  +      - Documentation Build Targets
  +      -->
       <target name="javadoc" depends="init" description="Creates Javadoc API documentation">
           <delete dir="${api.dir}"/>
           <mkdir dir="${api.dir}"/>
  @@ -357,16 +358,48 @@
   
       <target name="gump-target" depends="release"/>
   
  -    <!-- clover -->
  -    <target name="with.clover">
  +
  +    <!--
  +      - Clover Setup
  +      -->
  +    <target name="clover">
  +      <available property="clover.present"
  +                 classname="com.cortexeb.tools.clover.tasks.CloverTask">
  +        <classpath refid="project.class.path"/>
  +      </available>
  +    </target>
  +
  +    <target name="clover.init" depends="clover" if="clover.present">
           <taskdef resource="clovertasks"/>
  -        <clover-setup initString="${build.dir}/coverage.db"/>
  +        <clover-setup initString="${build.dir}/clover/coverage.db"
  +                      tmpdir="${build.dir}/clover/src"
  +                      preserve="false"/>
  +    </target>
  +
  +    <target name="clover.on" depends="clover.init" if="clover.present">
  +        <clover-setup initString="${build.dir}/clover/coverage.db"
  +                      tmpdir="${build.dir}/clover/src"
  +                      preserve="false"
  +                      enabled="true"/>
       </target>
  -    <target name="clover.report" depends="with.clover">
  +
  +    <target name="clover.off" depends="clover.init" if="clover.present">
  +        <clover-setup enabled="false"/>
  +    </target>
  +
  +    <target name="clover.historypoint" depends="clover.init" if="clover.present">
  +        <clover-historypoint historyDir="${build.dir}/clover/history"/>
  +    </target>
  +
  +    <target name="clover.report" depends="clover.init" if="clover.present">
           <clover-report>
  -            <current outfile="${build.dir}/clover_report">
  +            <current outfile="${build.dir}/clover-report">
                   <format type="html"/>
               </current>
  +            <historical outfile="${build.dir}/clover-history"
  +                        historyDir="${build.dir}/clover/history">
  +                <format type="html"/>
  +            </historical>
           </clover-report>
       </target>
   </project>