CyVis Software Metrics Collection, Analysis and Visualisation Tool

 

SourceForge.net Logo

CyVis Ant Task

After downloading the CyVis-major.minor-bin.zip file, extract it to a desired location (it would be better to extract it into your lib directory).

The steps involved to integrate CyVis into your build script are as follows:

Step 1: Create a property to the extracted directory

  <property name="cyvis-home" value="${basedir}/lib/cyvis-0.8"/>

Note: Change the value field according to your directory structure, and the version of cyvis.

Step 2: Create a path to hold the jar files required to run CyVis.

   <path id="cyvis.path">
       <fileset dir="${cyvis-home}">
           <include name="**/*.jar"/>
       </fileset> 
   </path>

Step 3: Define the CyVis task.

    <taskdef name="cyvis" classname="cyvis.ant.CyvisTask" 
		                     classpathref="cyvis.path"/>

Step 4: Write the CyVis task

Now you are ready to use the CyVis task in Ant. The table below shows all the parameters & nested elements for CyVis Task.

Parameters for <cyvis>:

Attribute Description Required
Verbose
CyVis prints all its operations, if set to true
No, Default is false
home

Represents CyVis’s Home Directory (i.e. the directory that was created when it was extracted)

Yes

Nested elements for <cyvis>:

Element Description Required
<fileset>
Denotes the set of files for which you want to generate reports. Multiple file sets may also be given. It supports all the attributes of <fileset> as in Ant.
Yes
<report>
Helps specify the report details. Multiple <report> could be used to generate as many reports.
Yes

Parameters of <report> :

Attribute Description Required
type
Specifies the type of the report to be generated. It can either be ‘text’ or ‘html’.
Yes
outFile
This specifies the name of the report file.
Yes

Example: A Target with CyVis Task:

   <target name="cyvis">
     <cyvis verbose="false" home="${cyvis-home}">
       <fileset dir="${bin}">
           <exclude name="*.class"/>
        </fileset> 
        <report type="html"  outFile="${docs}/test.html"/>
        <report type="text"  outFile="${docs}/test.txt"/>
     </cyvis>
   </target>