File: gmetrics-ant-task.html

package info (click to toggle)
gmetrics 0.7-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,948 kB
  • sloc: xml: 12,897; java: 64; makefile: 13
file content (173 lines) | stat: -rw-r--r-- 10,976 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Generated by Apache Maven Doxia at Jan 31, 2015 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>GMetrics - GMetrics Ant Task</title>
    <style type="text/css" media="all">
      @import url("./css/maven-base.css");
      @import url("./css/maven-theme.css");
      @import url("./css/site.css");
    </style>
    <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
    <meta name="Date-Revision-yyyymmdd" content="20150131" />
    <meta http-equiv="Content-Language" content="en" />
                  
  </head>
  <body class="composite">
    <div id="banner">
                  <a href="" id="bannerLeft">
                GMetrics
                </a>
                    <div class="clear">
        <hr/>
      </div>
    </div>
    <div id="breadcrumbs">
            
        
                <div class="xleft">
        <span id="publishDate">Last Published: 31 Jan 2015</span>
                  &nbsp;| <span id="projectVersion">Version: 0.7</span>
                      </div>
            <div class="xright">        
        
      </div>
      <div class="clear">
        <hr/>
      </div>
    </div>
    <div id="leftColumn">
      <div id="navcolumn">
             
        
                                <h5>General</h5>
                  <ul>
                  <li class="none">
                          <a href="index.html" title="Home">Home</a>
            </li>
                  <li class="none">
                          <a href="http://sourceforge.net/projects/gmetrics/files/" class="externalLink" title="Downloads">Downloads</a>
            </li>
                  <li class="none">
                          <a href="apidocs/index.html" title="Javadocs">Javadocs</a>
            </li>
                  <li class="none">
                          <a href="http://sourceforge.net/projects/gmetrics" class="externalLink" title="SourceForge Project">SourceForge Project</a>
            </li>
          </ul>
                       <h5>Running</h5>
                  <ul>
                  <li class="none">
            <strong>Ant Task Usage</strong>
          </li>
                  <li class="none">
                          <a href="gmetrics-other-tools-frameworks.html" title="Other Tools/Frameworks">Other Tools/Frameworks</a>
            </li>
          </ul>
                       <h5>Using</h5>
                  <ul>
                  <li class="none">
                          <a href="gmetrics-creating-metricset.html" title="Creating a MetricSet">Creating a MetricSet</a>
            </li>
                  <li class="none">
                          <a href="gmetrics-DefaultMetricSet.html" title="The Default MetricSet">The Default MetricSet</a>
            </li>
          </ul>
                       <h5>Reports</h5>
                  <ul>
                  <li class="none">
                          <a href="gmetrics-BasicHtmlReportWriter.html" title="BasicHtmlReportWriter">BasicHtmlReportWriter</a>
            </li>
                  <li class="none">
                          <a href="gmetrics-SingleSeriesHtmlReportWriter.html" title="SingleSeriesHtmlReportWriter">SingleSeriesHtmlReportWriter</a>
            </li>
                  <li class="none">
                          <a href="gmetrics-XmlReportWriter.html" title="XmlReportWriter">XmlReportWriter</a>
            </li>
                  <li class="none">
                          <a href="gmetrics-sampleReports.html" title="Sample Reports">Sample Reports</a>
            </li>
          </ul>
                       <h5>Metrics</h5>
                  <ul>
                  <li class="none">
                          <a href="gmetrics-AbcMetric.html" title="ABC">ABC</a>
            </li>
                  <li class="none">
                          <a href="gmetrics-AfferentCouplingMetric.html" title="AfferentCoupling">AfferentCoupling</a>
            </li>
                  <li class="none">
                          <a href="gmetrics-ClassCountMetric.html" title="ClassCount">ClassCount</a>
            </li>
                  <li class="none">
                          <a href="gmetrics-ClassLineCountMetric.html" title="ClassLineCount">ClassLineCount</a>
            </li>
                  <li class="none">
                          <a href="gmetrics-CoberturaBranchCoverageMetric.html" title="CoberturaBranchCoverageMetric">CoberturaBranchCoverageMetric</a>
            </li>
                  <li class="none">
                          <a href="gmetrics-CoberturaLineCoverageMetric.html" title="CoberturaLineCoverageMetric">CoberturaLineCoverageMetric</a>
            </li>
                  <li class="none">
                          <a href="gmetrics-CrapMetric.html" title="CrapMetric">CrapMetric</a>
            </li>
                  <li class="none">
                          <a href="gmetrics-CyclomaticComplexityMetric.html" title="CyclomaticComplexity">CyclomaticComplexity</a>
            </li>
                  <li class="none">
                          <a href="gmetrics-EfferentCouplingMetric.html" title="EfferentCoupling">EfferentCoupling</a>
            </li>
                  <li class="none">
                          <a href="gmetrics-FieldCountMetric.html" title="FieldCount">FieldCount</a>
            </li>
                  <li class="none">
                          <a href="gmetrics-MethodLineCountMetric.html" title="MethodLineCount">MethodLineCount</a>
            </li>
                  <li class="none">
                          <a href="gmetrics-MethodCountMetric.html" title="MethodCount">MethodCount</a>
            </li>
          </ul>
                                                                                                                   <a href="http://sourceforge.net" title="Hosted on SourceForge.net" class="poweredBy">
        <img class="poweredBy"  alt="Hosted on SourceForge.net" src="http://sflogo.sourceforge.net/sflogo.php?group_id=208647&type=2"    />
      </a>
                                                                                                          <a href="http://maven.apache.org" title="Build with Maven 2" class="poweredBy">
        <img class="poweredBy"  alt="Build with Maven 2" src="images/logos/maven-feather.png"    />
      </a>
                       
        
            </div>
    </div>
    <div id="bodyColumn">
      <div id="contentBox">
        <div class="section"><h2>GMetrics - Ant Task<a name="GMetrics_-_Ant_Task"></a></h2><!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --><div class="section"><h3>Description<a name="Description"></a></h3><!-- ~~~~~~~~~~~ --><p>The <b>GMetrics</b> Ant Task is implemented by the <tt>org.gmetrics.ant.GMetricsTask</tt> class.</p></div><div class="section"><h3>Attributes<a name="Attributes"></a></h3><!-- ~~~~~~~~~~ --><table border="1" class="bodyTable"><tr class="a"><td align="left"><b>Attribute</b></td><td align="left"><b>Description</b></td><td align="left"><b>Required</b></td></tr><tr class="b"><td align="left">metricSetFile</td><td align="left">The paths to a Groovy <i>MetricSet</i> DSL file. By default, the path specified is relative to the classpath, but it may be optionally prefixed by any of the valid <tt>java.net.URL</tt> prefixes, such as &quot;file:&quot; (to load from a relative or absolute filesystem path), or &quot;http:&quot;. If not specified, it uses the set of <tt>Metric</tt>s defined by the <a href="./gmetrics-DefaultMetricSet.html">Default MetricSet</a>.</td><td align="left">NO</td></tr></table></div><div class="section"><h3>Report Nested Element<a name="Report_Nested_Element"></a></h3><!-- ~~~~~~~~~~~~~~~~~~~~~ --><p>The <b>&lt;report&gt;</b> nested element defines the type and options for a report. It includes a <b>type</b> attribute and contains optional nested <b>&lt;option&gt;</b> elements.</p><p>NOTE: Currently, <tt>org.gmetrics.report.BasicHtmlReportWriter</tt> is the only report provided with <b>GMetrics</b>.</p><table border="1" class="bodyTable"><tr class="a"><td align="left"><b>Attribute</b></td><td align="left"><b>Description</b></td><td align="left"><b>Required</b></td></tr><tr class="b"><td align="left">type</td><td align="left">The fully-qualified class name for the report class. This class must implement the <tt>org.gmetrics.report.ReportWriter</tt> interface.</td><td align="left">Yes</td></tr></table><div class="section"><h4>Option Nested Element<a name="Option_Nested_Element"></a></h4><!-- ~~~~~~~~~~~~~~~~~~~~~~ --><p>The <b>&lt;option&gt;</b> element is a child of the <b>&lt;report&gt;</b> element and defines a report-specific option for a report. See the <a href="#Example">Example</a> below.</p></div></div><div class="section"><h3>Fileset Nested Element<a name="Fileset_Nested_Element"></a></h3><!-- ~~~~~~~~~~~~~~~~~~~~~ --><p>At least one <b>fileset</b> nested element is required, and is used to specify the source files that <b>GMetrics</b> should analyze. This is the standard Ant <i>FileSet</i>, and is quite powerful and flexible. See the <a class="externalLink" href="http://ant.apache.org/manual/index.html">Apache Ant Manual</a> for more information on <i>FileSets</i>.</p></div><div class="section"><h3><a name="Example">Example</a><a name="Example"></a></h3><!-- ~~~~~~~~~ --><p>Here is an example Ant XML build file.</p><div class="source"><pre>&lt;taskdef name=&quot;gmetrics&quot; classname=&quot;org.gmetrics.ant.GMetricsTask&quot;&gt;
&lt;target name=&quot;runGMetrics&quot;&gt;

    &lt;gmetrics metricSetFile=&quot;config/metricset.groovy&quot;&gt;
        &lt;report type=&quot;org.gmetrics.report.BasicHtmlReportWriter&quot;&gt;
            &lt;option name=&quot;outputFile&quot; value=&quot;SampleGMetricsReport.html&quot; /&gt;
            &lt;option name=&quot;title&quot; value=&quot;Sample&quot; /&gt;
        &lt;/report&gt;
        &lt;fileset dir=&quot;src&quot;&gt;
            &lt;include name=&quot;**/*.groovy&quot;/&gt;
        &lt;/fileset&gt;
    &lt;/gmetrics&gt;

&lt;/target&gt;
</pre></div><p>Things to note:</p><ul><li>The <i>fileset</i> specifies that all &quot;.groovy&quot; files are analyzed.</li><li>Remember that you need the <b>log4j</b> jar (and possibly a &quot;log4j.properties&quot; file) on the classpath.</li></ul></div></div>
      </div>
    </div>
    <div class="clear">
      <hr/>
    </div>
    <div id="footer">
      <div class="xright">Copyright &#169;                   2015.
          All Rights Reserved.      
        
      </div>
      <div class="clear">
        <hr/>
      </div>
    </div>
  </body>
</html>