File: checkstyle.xml

package info (click to toggle)
axis 1.4-29
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 52,100 kB
  • sloc: java: 129,124; xml: 10,602; jsp: 983; sh: 84; cs: 36; makefile: 18
file content (104 lines) | stat: -rw-r--r-- 3,617 bytes parent folder | download | duplicates (10)
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
<?xml version="1.0"?>
<!DOCTYPE project [
        <!ENTITY properties SYSTEM "file:xmls/properties.xml">
        <!ENTITY paths  SYSTEM "file:xmls/path_refs.xml">
]>
<project name="CheckStyle" default="usage">

  <description>
  this is a library task file that is only to be invoked in an ant task.
  </description>

    &properties;
    &paths;
    
  <!-- Load in all standard app-wide properties -->

  <property name="checkstyle.project" value="axis"/>

  <property name="checkstyle.src.dir" location="${axis.home}/src"/>
  <property name="checkstyle.dest.dir" location="${build.dir}/checkstyle/${checkstyle.project}"/>
  <property name="checkstyle-noframes.xsl"
            location="${axis.home}/xmls/checkstyle-noframes.xsl"/>

  <property name="checkstyle.failonerror" value="false"/>            
<!--   <path id="checkstyle.classpath">
    <path refid="ant.classpath" />
  </path>
   -->


  <!-- look for checkstyle; fail gracefully -->
  <target name="probe_checkstyle">
    <fail unless="axis.home">
      axis.home is not defined; this is required
    </fail>
    <!-- classpathref="checkstyle.classpath" -->
    <available property="checkstyle.found"
      resource="checkstyletask.properties" 
      />
    <fail unless="checkstyle.found">
      Unable to find the checkstyle jar on the classpath
    </fail>
  </target>

  <target name="init" depends="probe_checkstyle" >
    <taskdef resource="checkstyletask.properties" />
  </target>
  
  <target name="checkstyle" depends="init"
    description="Check the style of a project">
    <echo message="Checking style of ${checkstyle.project}"/>
    <mkdir dir="${checkstyle.dest.dir}"/>
    <property name="report.stem" value="checkstyle-${checkstyle.project}" />
    <property name="results.xml" value="${report.stem}.xml" />
    <property name="resultsfile.xml" 
      location="${checkstyle.dest.dir}/${results.xml}" />
    <property name="resultsfile.html" 
      location="${checkstyle.dest.dir}/${report.stem}.html" />
      <!-- 
        to keep the 5000+ errors manageable and so pick on the key issues 
          line length cranked up from apache's 68 rule.
          javadocs are unchecked
          whitespace is ignored
          protected data is allowed
        some time these can be cranked back, though protected vs accessors is a major 
        design issue, not a simple source layout problem. 
        -->
    <checkstyle failOnViolation="${checkstyle.failonerror}"
                maxLineLen="100"
                allowNoAuthor="true"
                ignoreWhitespace="true"
                allowProtected="true"
                javadocScope="nothing"
                cacheFile="${checkstyle.dest.dir}/checkstyle.cache">
      <formatter type="plain"/>
      <formatter type="xml" toFile="${resultsfile.xml}"/>
      <fileset dir="${checkstyle.src.dir}" includes="**/*.java"/>
    </checkstyle>
    
    <style basedir="${checkstyle.dest.dir}" destdir="${checkstyle.dest.dir}"
           includes="${results.xml}"
           style="${checkstyle-noframes.xsl}"/>
     <echo>
      Style checked, results are in ${resultsfile.html}
     </echo>
  </target>
  
  <target name="usage" >
  <echo>
This build file validates the source in a directory
    
Required properties:
  axis.home               base of axis java project
  checkstyle.project      name of the project
  checkstyle.src.dir      source directory
  checkstyle.dest.dir     dir for results

Optional
  checkstyle.failonerror  failonerror flag; default=false
  checkstyle.classpath    path to checkstyle.jar; default=ant classpath 

    </echo>
  </target>
</project>