File: build.xml

package info (click to toggle)
doctorj 5.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 6,196 kB
  • sloc: java: 30,027; xml: 331; makefile: 41; sh: 16
file content (404 lines) | stat: -rw-r--r-- 16,624 bytes parent folder | download | duplicates (5)
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
<?xml version="1.0"?>

<project name="DoctorJ" default="compile" basedir=".">
  
    <property name="debug"          value="true"                  />
    <property name="deprecation"    value="false"                 />
    <property name="optimize"       value="true"                  />
  
    <property name="basedir"        value="."                     />
  
    <property name="src.dir"        value="${basedir}"            />
    <property name="lib.dir"        value="lib"                   />
    <property name="docs.dir"       value="docs"                  />
    <property name="test.dir"       value="${basedir}/test"       />
  
    <property name="build.dir"      value="${basedir}"            />
    <property name="build.classes"  value="${build.dir}/classes"  />
    <property name="build.lib"      value="${build.dir}/lib"      />
    <property name="build.javadocs" value="${build.dir}/javadocs" />

    <property name="version"        value="5.0.0"                 />

    <!-- the top directory, equivalent to DESTDIR                -->
    <property name="destdir"        value="/tmp/drjtgt"           />

    <property name="prefix"         value="/usr"                  />
    <property name="mandir"         value="${prefix}/share/man"   />
    <property name="datadir"        value="${prefix}/share"       />
    <property name="bindir"         value="${prefix}/bin"         />
  
    <path id="classpath">
        <pathelement location="${build.classes}" />
    </path>
  
    <path id="run-classpath">
        <pathelement location="${test.dir}/classes" />
        <path refid="classpath" />
        <pathelement location="/home/jpace/lib/java/junit.jar" />
    </path>
  
    <target name="compile" 
            depends=""
            description="--> compiles the core code">
        <mkdir dir="${build.dir}"/>
        <mkdir dir="${build.classes}"/>
      
        <javac srcdir="${src.dir}"
               destdir="${build.classes}"
               debug="${debug}"
               deprecation="${deprecation}"
               optimize="${optimize}" >
            <classpath refid="classpath" />
            <include name="org/**/*.java" />
        </javac>
    </target>
  
    <target name="compile-tests" 
            depends="compile"
            description="--> compiles the tests">
        <mkdir dir="${build.dir}"        />
        <mkdir dir="${build.classes}"    />
        <mkdir dir="${test.dir}/classes" />
      
        <javac srcdir="${test.dir}"
               destdir="${test.dir}/classes"
               debug="${debug}"
               deprecation="${deprecation}"
               optimize="${optimize}" >
            <classpath refid="classpath" />
        </javac>
    </target>
  
    <target name="run-ast-dump-commented" 
            depends="compile"
            description="--> runs the AST dump">
        <java classname="org.incava.java.Main" fork="true">
            <classpath refid="run-classpath" />
            <arg value="--dump" />
            <arg value="testfiles/Commented.java" />
        </java>
    </target>
  
    <target name="run-ast-dump-tiny" 
            depends="compile"
            description="--> runs the AST dump">
        <java classname="org.incava.java.Main" fork="true">
            <classpath refid="run-classpath" />
            <arg value="--dump" />
            <arg value="testfiles/Tiny.java" />
        </java>
    </target>
  
    <target name="run-javadoc-analyzer" 
            depends="compile"
            description="--> runs the AST dump">
        <java classname="org.incava.doctorj.Main" fork="true">
            <classpath refid="run-classpath" />
            <arg value="testfiles/Tiny.java" />
         </java>
    </target>
  
    <target name="run-doc" 
            depends="compile"
            description="--> runs the Javadoc analyzer">
        <java classname="org.incava.doctorj.Main" fork="true">
            <classpath refid="run-classpath" />
            <arg value="testfiles/Tiny.java" />
        </java>
    </target>
  
    <target name="remake" 
            depends="clean,compile"
            description="--> rebuild the application">
    </target>
  
    <target name="clean" 
            depends=""
            description="--> removes compiled code">
        <delete>
            <fileset dir="${basedir}" includes="**/*.class" /> 
        </delete>
    </target>

    <!-- unit tests -->
  
    <target name="test-spell-checker" 
            description="--> runs the test of the spell checker">
        <antcall target="run-test"><param name="classname" value="org.incava.text.TestSpellChecker"/></antcall>
    </target>
  
    <target name="test-nocase-spell-checker" 
            description="--> runs the test of the spell checker">
        <antcall target="run-test"><param name="classname" value="org.incava.text.TestNoCaseSpellChecker"/></antcall>
    </target>
  
    <target name="test-javadoc-parser" 
            description="--> runs the test of the Javadoc parser">
        <antcall target="run-test"><param name="classname" value="org.incava.java.TestJavadocParser"/></antcall>
    </target>
  
    <target name="test-javadoc-node" 
            description="--> runs the test of the Javadoc Node">
        <antcall target="run-test"><param name="classname" value="org.incava.java.TestJavadocNode"/></antcall>
    </target>
  
    <target name="test-javadoc-tagged-node" 
            description="--> runs the test of the Javadoc Tagged Node">
        <antcall target="run-test"><param name="classname" value="org.incava.java.TestJavadocTaggedNode"/></antcall>
    </target>
  
    <target name="test-violation" 
            description="--> runs the test of the violations">
        <antcall target="run-test"><param name="classname" value="org.incava.analysis.TestViolation"/></antcall>
    </target>
  
    <target name="test-report" 
            description="--> runs the test of the report">
        <antcall target="run-test"><param name="classname" value="org.incava.analysis.TestReport"/></antcall>
    </target>
  
    <target name="test-terse-report" 
            description="--> runs the test of the terse report">
        <antcall target="run-test"><param name="classname" value="org.incava.analysis.TestTerseReport"/></antcall>
    </target>
  
    <target name="test-context-report" 
            description="--> runs the test of the context report">
        <antcall target="run-test"><param name="classname" value="org.incava.analysis.TestContextReport"/></antcall>
    </target>
  
    <target name="test-collect" 
            description="--> runs the test of the Collect class">
        <antcall target="run-test"><param name="classname" value="org.incava.util.TestCollect"/></antcall>
    </target>
  
    <!-- jagol unit tests -->
  
    <target name="test-jagol-option" 
            description="--> runs the test of the jagol option">
        <antcall target="run-test"><param name="classname" value="org.incava.jagol.TestOption"/></antcall>
    </target>
  
    <target name="test-jagol-integer-option" 
            description="--> runs the test of the jagol integer option">
        <antcall target="run-test"><param name="classname" value="org.incava.jagol.TestIntegerOption"/></antcall>
    </target>
  
    <target name="test-jagol-nonboolean-option" 
            description="--> runs the test of the jagol nonboolean option">
        <antcall target="run-test"><param name="classname" value="org.incava.jagol.TestNonBooleanOption"/></antcall>
    </target>
  
    <target name="test-jagol-double-option" 
            description="--> runs the test of the jagol double option">
        <antcall target="run-test"><param name="classname" value="org.incava.jagol.TestDoubleOption"/></antcall>
    </target>
  
    <target name="test-jagol-float-option" 
            description="--> runs the test of the jagol float option">
        <antcall target="run-test"><param name="classname" value="org.incava.jagol.TestFloatOption"/></antcall>
    </target>
  
    <target name="test-jagol-string-option" 
            description="--> runs the test of the jagol string option">
        <antcall target="run-test"><param name="classname" value="org.incava.jagol.TestStringOption"/></antcall>
    </target>
  
    <target name="test-jagol-boolean-option" 
            description="--> runs the test of the jagol boolean option">
        <antcall target="run-test"><param name="classname" value="org.incava.jagol.TestBooleanOption"/></antcall>
    </target>
  
    <target name="test-jagol-list-option" 
            description="--> runs the test of the jagol list option">
        <antcall target="run-test"><param name="classname" value="org.incava.jagol.TestListOption"/></antcall>
    </target>
  
    <target name="test-jagol-option-set" 
            description="--> runs the test of the jagol option set">
        <antcall target="run-test"><param name="classname" value="org.incava.jagol.TestOptionSet"/></antcall>
    </target>
  
    <!-- javadoc analysis unit tests -->
  
    <target name="test-comment-spell-check" 
            description="--> runs the test of the comment spell checker">
        <antcall target="run-javadoc-test"><param name="classname" value="TestCommentSpellCheck"/></antcall>
    </target>

    <target name="test-exception-doc-analyzer" 
            description="--> runs the test of the Javadoc exceptions">
        <antcall target="run-javadoc-test"><param name="classname" value="TestExceptionDocAnalyzer"/></antcall>
    </target>
  
    <target name="test-item-doc-analyzer" 
            description="--> runs the test of an Item ">
        <antcall target="run-javadoc-test"><param name="classname" value="TestItemDocAnalyzer"/></antcall>
    </target>
  
    <target name="test-parameter-doc-analyzer" 
            description="--> runs the test of the Javadoc @param tag">
        <antcall target="run-javadoc-test"><param name="classname" value="TestParameterDocAnalyzer"/></antcall>
    </target>

    <target name="test-function-doc-analyzer" 
            description="--> runs the test of the Javadoc function analyzer">
        <antcall target="run-javadoc-test"><param name="classname" value="TestFunctionDocAnalyzer"/></antcall>
    </target>

    <target name="test-method-doc-analyzer" 
            description="--> runs the test of the Javadoc method analyzer">
        <antcall target="run-javadoc-test"><param name="classname" value="TestMethodDocAnalyzer"/></antcall>
    </target>

    <target name="test-ctor-doc-analyzer" 
            description="--> runs the test of the Javadoc ctor analyzer">
        <antcall target="run-javadoc-test"><param name="classname" value="TestMethodDocAnalyzer"/></antcall>
    </target>

    <target name="test-field-doc-analyzer" 
            description="--> runs the test of the Javadoc field analyzer">
        <antcall target="run-javadoc-test"><param name="classname" value="TestFieldDocAnalyzer"/></antcall>
    </target>

    <target name="test-type-doc-analyzer" 
            description="--> runs the test of the Javadoc type analyzer">
        <antcall target="run-javadoc-test"><param name="classname" value="TestTypeDocAnalyzer"/></antcall>
    </target>

    <target name="test-class-doc-analyzer" 
            description="--> runs the test of the Javadoc class analyzer">
        <antcall target="run-javadoc-test"><param name="classname" value="TestClassDocAnalyzer"/></antcall>
    </target>

    <target name="test-interface-doc-analyzer" 
            description="--> runs the test of the Javadoc interface analyzer">
        <antcall target="run-javadoc-test"><param name="classname" value="TestInterfaceDocAnalyzer"/></antcall>
    </target>

    <target name="test-options" 
            description="--> runs the test of the effect of options on the analyzers">
        <antcall target="run-javadoc-test"><param name="classname" value="TestOptions"/></antcall>
    </target>

    <!-- generic testing targets -->

    <target name="run-javadoc-test" 
            description="--> runs a Javadoc test">
        <antcall target="run-test"><param name="classname" value="org.incava.doctorj.${classname}"/></antcall>
    </target>
  
    <target name="run-test" 
            depends="compile-tests"
            description="--> runs a unit test">
        <junit printsummary="no" haltonfailure="yes" fork="yes" filtertrace="true" showoutput="no">
            <classpath refid="run-classpath" />
            <formatter type="plain" usefile="false" />
            <test name="${classname}" />
        </junit>
    </target>
  
    <target name="tests" 
            depends="compile-tests"
            description="--> runs all tests">
        <junit printsummary="yes" haltonfailure="yes" fork="yes" filtertrace="true" showoutput="no">
            <classpath refid="run-classpath" />
            <formatter type="plain" usefile="false" />
            <batchtest fork="yes">
                <fileset dir="test">
                    <include name="**/Test*.java"/>
                    <exclude name="**/Tester.java"/>
                </fileset>
            </batchtest>
            <sysproperty key="verbose" value="false" />
        </junit>
    </target>
  
    <target name="test-jagol" 
            depends="compile-tests"
            description="--> runs all Jagol tests">
        <junit printsummary="yes" haltonfailure="yes" fork="yes" filtertrace="true" showoutput="no">
            <classpath refid="run-classpath" />
            <formatter type="plain" usefile="false" />
            <batchtest fork="yes">
                <fileset dir="test">
                    <include name="org/incava/jagol/**/Test*.java"/>
                </fileset>
            </batchtest>
            <sysproperty key="verbose" value="false" />
        </junit>
    </target>
  
    <target name="jarfile" 
            depends="compile"
            description="--> builds the .jar file">
        <mkdir dir="lib"/>
        <jar destfile="lib/doctorj.jar" basedir="classes" includes="org/incava/**/*.class">
            <manifest>
                <attribute name="Main-Class" value="org.incava.doctorj.Main" />
            </manifest>
        </jar>
    </target>
  
    <target name="dist" 
            depends="jarfile, manpage"
            description="--> builds the distribution tarball">
        <property name="tarball" value="${build.dir}/doctorj-${version}.tar" />
        <tar tarfile="${tarball}">
            <tarfileset dir="${src.dir}" prefix="doctorj-${version}">
                <include name="Makefile"           />
                <include name="build.xml"          />
                <include name="AUTHORS"            />
                <include name="ChangeLog"          />
                <include name="COPYING"            />
                <include name="INSTALL"            />
                <include name="NEWS"               />
                <include name="README"             />
                <include name="bin/doctorj"        />
                <include name="doc/doctorj.1"      />
                <include name="doctorj.spec"       />
                <include name="org/**/*.java"      />
                <include name="org/**/*.jj*"       />
                <include name="etc/words.*"        />
                <include name="test/org/**/*.java" />
            </tarfileset>
        </tar>
        <gzip zipfile="${tarball}.gz" src="${tarball}" />
        <delete file="${tarball}" />
    </target>
  
    <target name="manpage" 
            description="--> builds the man page from the XML source">
        <exec dir="." executable="xmlto">
            <arg value="-o"/>
            <arg value="doc"/>
            <arg value="man"/>
            <arg value="doc/doctorj.xml"/>
        </exec>
    </target>
  
    <target name="install" 
            depends="jarfile"
            description="--> installs the program">
        <mkdir dir="${destdir}${bindir}"           />
	<mkdir dir="${destdir}${datadir}/doctorj"  />
	<mkdir dir="${destdir}${mandir}/man1"      />

        <!-- can't use the copy task, since permissions are not retained -->
	<exec executable="cp">
            <arg value="bin/doctorj"               />
            <arg value="${destdir}${bindir}"       />
        </exec>

	<copy todir="${destdir}${datadir}/doctorj">
            <fileset dir="etc">
                <include name="words.*" />
            </fileset>
	</copy>

	<copy file="lib/doctorj.jar" todir="${destdir}${datadir}/doctorj" />
       	<copy file="doc/doctorj.1"   todir="${destdir}${mandir}/man1"     />
    </target>
  
</project>