forked from checkstyle/checkstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
186 lines (170 loc) · 7.33 KB
/
build.xml
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
174
175
176
177
178
179
180
181
182
183
184
185
186
<project name="checkstyle" default="checkstyle.checkstyle" basedir=".">
<!-- set global properties for this build -->
<property name="target.dir" value="${basedir}/target" />
<property name="version" value="5.4-SNAPSHOT" />
<property name="checkstyle.dir"
value="src/checkstyle/com/puppycrawl/tools/checkstyle" />
<!-- override using -Dgui.target= if you wish to load a source file from startup -->
<property name="gui.target" value=""/>
<path id="run.classpath">
<pathelement location="${target.dir}/checkstyle-${version}-all.jar"/>
</path>
<target name="checkstyle.checkstyle"
description="Runs checkstyle against it's own sources">
<taskdef name="checkstyle"
classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
<classpath refid="run.classpath"/>
</taskdef>
<delete file="${target.dir}/cachefile" />
<property name="checkstyle.pattern.todo" value="NOTHingWillMatCH_-"/>
<property name="check.config" location="checkstyle_checks.xml"/>
<property name="translation.severity" value="ignore"/>
<checkstyle config="${check.config}"
failOnViolation="false"
failureProperty="checkstyle.failure.property"
>
<fileset dir="src"
includes="checkstyle/**/*.java,checkstyle/**/*.properties,xdocs/**/*.xml,tests/**/*Test.java"
excludes="**/Generated*.java,**/gui/*"/>
<formatter type="plain"/>
<formatter type="xml" toFile="${target.dir}/cs_errors.xml"/>
<classpath refid="run.classpath"/>
<property key="checkstyle.cache.file" file="${target.dir}/cachefile"/>
<property key="checkstyle.header.file" file="java.header"/>
<property key="checkstyle.importcontrol.file" file="import-control.xml"/>
<property key="checkstyle.suppressions.file"
file="suppressions.xml"/>
</checkstyle>
<fail if="checkstyle.failure.property"
message="Checkstyle failed: ${checkstyle.failure.property}"
/>
</target>
<!-- Run the GUI -->
<target name="run.gui"
description="Run the GUI for displaying a tree">
<java classname="com.puppycrawl.tools.checkstyle.gui.Main"
fork="yes" classpathref="run.classpath">
<arg line="${gui.target}"/>
</java>
</target>
<target name="validate.xml"
description="Validates checkstyle XML file">
<xmlvalidate file="checkstyle_checks.xml">
<xmlcatalog>
<dtd
publicId="-//Puppy Crawl//DTD Check Configuration 1.1//EN"
location="${checkstyle.dir}/configuration_1_1.dtd"/>
</xmlcatalog>
</xmlvalidate>
</target>
<target name="checkstyle.sun_checks"
description="Runs checkstyle using sun_checks.xml">
<taskdef name="checkstyle"
classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
<classpath refid="run.classpath"/>
</taskdef>
<property name="check.config" location="sun_checks.xml"/>
<checkstyle config="${check.config}"
failOnViolation="true"
>
<fileset dir="src/checkstyle"
includes="**/*.java,**/*.properties"
excludes="**/Generated*.java,**/gui/*"/>
<formatter type="plain"/>
<classpath refid="run.classpath"/>
</checkstyle>
</target>
<target name="checkstyle.style"
description="Runs checkstyle against it's own sources to test generation of error reports">
<taskdef name="checkstyle"
classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
<classpath refid="run.classpath"/>
</taskdef>
<delete file="${target.dir}/cachefile" />
<property name="checkstyle.pattern.todo" value="NOTHingWillMatCH_-"/>
<property name="check.config" location="checkstyle_checks.xml"/>
<property name="translation.severity" value="ignore"/>
<checkstyle failonviolation="false" config="${check.config}">
<fileset dir="src/checkstyle"
includes="**/*.java,**/*.properties"
excludes="**/Generated*.java,**/gui/*"/>
<formatter type="xml" toFile="${target.dir}/cs_errors.xml"/>
<classpath refid="run.classpath"/>
<property key="checkstyle.cache.file" file="${target.dir}/cachefile"/>
<property key="checkstyle.header.file" file="java.header"/>
<property key="checkstyle.importcontrol.file" file="import-control.xml"/>
<property key="checkstyle.suppressions.file"
file="suppressions.xml"/>
</checkstyle>
<mkdir dir="${target.dir}/style/frames"/>
<mkdir dir="${target.dir}/style/noframes"/>
<mkdir dir="${target.dir}/style/noframes-sorted"/>
<mkdir dir="${target.dir}/style/simple"/>
<mkdir dir="${target.dir}/style/csv"/>
<mkdir dir="target/style/author"/>
<style basedir="${target.dir}"
destdir="${target.dir}/style/noframes"
includes="cs_errors.xml"
style="contrib/checkstyle-noframes.xsl"/>
<style basedir="${target.dir}"
destdir="${target.dir}/style/noframes-sorted"
includes="cs_errors.xml"
style="contrib/checkstyle-noframes-sorted.xsl"/>
<style basedir="${target.dir}"
destdir="${target.dir}/style/frames"
includes="cs_errors.xml"
style="contrib/checkstyle-frames.xsl"/>
<style basedir="${target.dir}"
destdir="${target.dir}/style/simple"
includes="cs_errors.xml"
style="contrib/checkstyle-simple.xsl"/>
<style out="${target.dir}/style/csv/report-csv.txt"
in="${target.dir}/cs_errors.xml"
style="contrib/checkstyle-csv.xsl"/>
<style basedir="target"
destdir="target/style/author"
includes="cs_errors.xml"
style="contrib/checkstyle-author.xsl"/>
</target>
<?ignore
<!-- A GRAVEYARD OF IDEAS BELOW -->
<!-- runs the command line version on a file -->
<target name="run.checkstyle"
description="Runs the command line version on a file">
<java classname="com.puppycrawl.tools.checkstyle.Main"
fork="yes"
dir="."
classpathref="run.classpath">
<sysproperty key="checkstyle.allow.tabs" value="yes"/>
<arg value="-c"/>
<arg file="checkstyle_checks.xml"/>
<arg value="src/testinputs/com/puppycrawl/tools/checkstyle/InputSimple.java"/>
</java>
<java classname="com.puppycrawl.tools.checkstyle.Main"
fork="yes"
dir="."
classpathref="run.classpath">
<arg value="-c"/>
<arg file="checkstyle_checks.xml"/>
<arg value="-r"/>
<arg file="src/checkstyle/com/puppycrawl/tools/checkstyle/api"/>
</java>
</target>
<target name="checkstyle.run" depends="compile.checkstyle"
description="Runs checkstyle.">
<taskdef name="checkstyle"
classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
<classpath refid="run.classpath"/>
</taskdef>
<delete file="${target.dir}/cachefile" />
<property name="checkstyle.pattern.todo" value="NOTHingWillMatCH_-"/>
<property name="check.config" location="checkstyle_checks.xml"/>
<property name="translation.severity" value="ignore"/>
<checkstyle config="${custom.config}" file="${file.to.check}">
<formatter type="plain"/>
<formatter type="xml" toFile="${target.dir}/cs_errors.xml"/>
<classpath refid="run.classpath"/>
</checkstyle>
</target>
?>
</project>