Document simple Ant Integration:

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Fixed
    • Priority: Medium
    • 2.4
    • Affects Version/s: None
    • Component/s: Documentation
    • None

      Ant 2 Line Integration

      To get Clover2 integrated into your build as quickly as possible, follow these very simple steps:
      NB: Only works if you are using Ant 1.7 or above

      #Download the clover.jar and save it in your home directory.

      1. Add the following lines to your build.xml
          <property name="clover.jar" value="${user.home}/clover.jar"/>
          <taskdef resource="cloverlib.xml" classpath="${clover.jar}"/>
          <clover-env/>
        

        NB. this will not work within an Ant target. It must be at the top level of the build file.

      2. Add the clover.jar to your test-time classpath
         <junit fork="true" forkmode="once">
                        <classpath>
                    	    <pathelement location="${clover.jar}"/>
                        </classpath>
          </junit>
        
      3. The following targets will then be available to you:
        NB: These are available also by running `ant -projecthelp`
        clover.all Runs clover.clean, with.clover, test, clover.report from a single target.
        clover.clean Deletes the clover database and the ${clover.dest} directory.
        clover.current Generates an HTML and XML report to ${clover.dest} using ${project.title}.
        clover.report Same as clover.current, however a history report will also be created, using the historypoints in ${clover.project.historydir}.
        clover.save-history Saves a history point to ${clover.project.historydir}
        with.clover Enables Clover on this build

        Any ${} properties may be defined on the command line e.g. -Dclover.project.historydir=/home/clover/historydir/

      4. If you have a target already called "test" you can simply run
        ant clover.all

        Otherwise, run:

        ant with.clover your.test.target clover.report

        or, define a property called "test.target" whose value is the name of your test target.

            Assignee:
            Edwin Dawson [Atlassian]
            Reporter:
            Nick
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: