Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 500 lines (420 sloc) 20.548 kB
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
1 <!-- $Id: build.xml,v 1.57 2009/07/23 06:48:27 jhunter Exp $ -->
2
3 <!--
4 For instructions on how to build JDOM, please view the README.txt file.
5 -->
6
7 <project default="package" basedir=".">
8
9 <!-- =================================================================== -->
10 <!-- Initialization target -->
11 <!-- =================================================================== -->
48e9b4a @rolfl Tidy up maven processes
rolfl authored
12 <tstamp >
13 <format property="snapshot.time" pattern="yyyy.MM.dd.HH.mm" />
14 </tstamp>
15
16 <!--
17 Give user a chance to override without editing this file
18 (and without using -D arguments each time they build).
19 The build properties a user is likely to override include:
20 - lib.dir The directory where to look for the default JAR
21 files. Defaults to ./lib
22 - xml-apis.jar The JAR containing the DOM, SAX and JAXP classes.
23 Defaults to ${lib.dir}/xml-apis.jar
24 - parser.jar The JAR containing the XML parser to use.
25 Defaults to ${lib.dir}/xerces.jar
26 - jaxen.lib.dir The directory containing the Jaxen JAR libraries.
27 Defaults to ${lib.dir}
28 -->
29 <property file="${user.home}/jdom.build.properties" />
30 <property file="${basedir}/build.properties" />
31
32 <property name="Name" value="JDOM2"/>
33 <property name="name" value="jdom2"/>
34 <property name="version" value="2.x-${snapshot.time}"/>
35 <property name="version.impl" value="${version}"/>
36 <property name="version.spec" value="2.alpha"/>
37 <property name="year" value="2011"/>
38
39 <property name="gpg" value="gpg"
40 description="Path to the GNU gpg program for maven target"/>
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
41
48e9b4a @rolfl Tidy up maven processes
rolfl authored
42 <property name="jarbase" value="${name}-${version}" />
43
44 <property name="instrument" value="true" />
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
45
48e9b4a @rolfl Tidy up maven processes
rolfl authored
46 <echo message="----------- ${Name} ${version} ------------"/>
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
47
48e9b4a @rolfl Tidy up maven processes
rolfl authored
48 <property name="compile.debug" value="true" />
49 <property name="compile.optimize" value="true" />
50 <property name="compile.target" value="1.5" />
51 <property name="compile.source" value="1.5" />
52 <property name="compile.deprecation" value="true" />
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
53
48e9b4a @rolfl Tidy up maven processes
rolfl authored
54 <property name="build" value="./build"/>
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
55
48e9b4a @rolfl Tidy up maven processes
rolfl authored
56 <property name="core" value="./core" />
57 <property name="core.src" value="${core}/src/java" />
58 <property name="core.build" value="${build}/core" />
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
59
48e9b4a @rolfl Tidy up maven processes
rolfl authored
60 <property name="about" value="./core/package" />
61 <property name="about.src" value="${about}" />
62 <property name="about.build" value="${build}/about" />
63
64 <property name="metainf" value="./core/package/META-INF" />
65 <property name="metainf.build" value="${build}/META-INF" />
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
66
48e9b4a @rolfl Tidy up maven processes
rolfl authored
67 <property name="contrib" value="./contrib" />
68 <property name="contrib.src" value="${contrib}/src/java" />
69 <property name="contrib.build" value="${build}/contrib" />
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
70
48e9b4a @rolfl Tidy up maven processes
rolfl authored
71 <property name="junit" value="./test" />
72 <property name="junit.src" value="${junit}/src/java" />
73 <property name="junit.build" value="${build}/junit" />
74 <property name="junit.xml" value="${build}/junit.xml" />
75 <property name="junit.report" value="${build}/junit.report" />
76 <property name="junit.instrumented" value="${build}/instrumented" />
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
77
78
48e9b4a @rolfl Tidy up maven processes
rolfl authored
79 <property name="samples" value="./core/samples/" />
80 <property name="samples.src" value="${samples}/" />
81 <property name="samples.build" value="${build}/samples"/>
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
82
48e9b4a @rolfl Tidy up maven processes
rolfl authored
83 <!-- Do not set a stax.dir
84 but it is available for override (for Java5 for example) -->
85 <property name="stax.dir" value="dummy" />
86
87 <property name="lib.dir" value="./lib"/>
88 <property name="packages" value="org.jdom2.*"/>
89
90 <property name="build.javadocs" value="${build}/apidocs"/>
91
92 <property name="package" value="${build}/package"/>
93
94 <property name="coverage.out" value="${build}/coverage" />
95
96 <property name="mavendir" value="${build}/maven" />
97
98 <filter token="year" value="${year}"/>
99 <filter token="version" value="${version}"/>
100 <filter token="date" value="${TODAY}"/>
101 <filter token="jdk" value="${compile.target}" />
102
103 <!-- Default JAR libraries -->
104 <property name="parser.jar" value="${lib.dir}/xercesImpl.jar" />
105 <property name="xmlapi.jar" value="${lib.dir}/xml-apis.jar" />
106 <property name="jaxen.jar" value="${lib.dir}/jaxen-1.1.3.jar" />
107 <property name="junit.jar" value="${lib.dir}/junit-4.8.2.jar" />
108 <property name="isorelax.jar" value="${contrib}/lib/isorelax.jar" />
109 <property name="xalan.jar" value="${lib.dir}/xalan/xalan-2.7.1.jar" />
110 <property name="xalanser.jar" value="${lib.dir}/xalan/serializer-2.7.1.jar" />
111
112 <!-- Compilation class path -->
113 <path id="base.class.path">
114 <pathelement location="${jaxen.jar}" />
115 <pathelement location="${parser.jar}" />
116 <pathelement location="${xmlapi.jar}" />
117 <pathelement location="${junit.jar}" />
118 <pathelement location="${isorelax.jar}" />
119 <pathelement location="${xalan.jar}" />
120 <pathelement location="${xalanser.jar}" />
121 <!-- normally these stax jars will not be found -->
122 <!-- this is used for testing Java5 (the test sets stax.dir) -->
123 <pathelement location="${stax.dir}/jsr173_1.0_api.jar" />
124 <pathelement location="${stax.dir}/sjsxp.jar" />
125 </path>
126
127 <path id="core.class.path">
128 <path refid="base.class.path"/>
129 <pathelement location="${core.build}"/>
130 </path>
131
132 <path id="contrib.class.path">
133 <path refid="core.class.path"/>
134 <pathelement location="${contrib.build}"/>
135 </path>
136
137 <path id="junit.class.path">
138 <pathelement location="${junit.instrumented}" />
139 <pathelement location="${junit.build}"/>
140 <path refid="contrib.class.path"/>
141 <fileset dir="${lib.dir}/cobertura" includes="*.jar" />
142 </path>
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
143
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
144
145 <!-- =================================================================== -->
146 <!-- Help on usage -->
147 <!-- =================================================================== -->
148 <target name="usage">
149 <echo message=""/>
150 <echo message=""/>
151 <echo message="JDOM Build file"/>
152 <echo message="-------------------------------------------------------------"/>
153 <echo message=""/>
154 <echo message=" available targets are:"/>
155 <echo message=""/>
cb64bd6 @hunterhacker Made the README.txt a bit more modern. Added the new usage commands t…
authored
156 <echo message=" - package [default] -> generates ./build/jdom2.jar and other supporting files"/>
157 <echo message=" - compile -> compiles the source code"/>
158 <echo message=" - javadoc -> generates the API documentation in ./build/javadocs"/>
159 <echo message=" - junit -> runs the JUnit tests"/>
160 <echo message=" - coverage -> generates test coverage metrics"/>
161 <echo message=" - eclipse -> generates an Eclipse project (source folders, jars, etc)"/>
162 <echo message=" - clean -> restores the distribution to its original and clean state"/>
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
163 <echo message=" - maven -> Prepares a package-upload for maven-central"/>
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
164 <echo message=""/>
165 <echo message=" See the comments inside the build.xml file for more details."/>
166 <echo message="-------------------------------------------------------------"/>
167 <echo message=""/>
168 <echo message=""/>
169 </target>
170
171 <!-- =================================================================== -->
172 <!-- Prepares the build directory -->
173 <!-- =================================================================== -->
48e9b4a @rolfl Tidy up maven processes
rolfl authored
174 <target name="prepare">
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
175 <mkdir dir="${build}"/>
176 <mkdir dir="${core.build}"/>
177 <mkdir dir="${about.build}"/>
178 <mkdir dir="${samples.build}"/>
179 <mkdir dir="${junit.build}"/>
180 <mkdir dir="${contrib.build}"/>
181 <mkdir dir="${metainf.build}"/>
182 </target>
183
184 <!-- =================================================================== -->
185 <!-- Compiles the source directory -->
186 <!-- =================================================================== -->
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
187 <target name="compile.core" depends="prepare"
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
188 description="Compiles the core source code">
189
e270fd0 @rolfl Fixes #24 - Descendant iterator (and by proxy, FilterIterator) broken
rolfl authored
190 <!-- Copy resources and stuff - everything except Java code -->
191 <copy todir="${core.build}" >
192 <fileset dir="${core.src}" excludes="**/*.java" />
193 </copy>
194
18d95b2 @rolfl Clean up the build again. Fix compile-time warnings, and remove the
rolfl authored
195 <javac srcdir="${core.src}"
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
196 destdir="${core.build}"
197 debug="${compile.debug}"
198 optimize="${compile.optimize}"
199 target="${compile.target}"
200 source="${compile.source}"
c85cad9 @rolfl Tidy up build messages.
rolfl authored
201 deprecation="${compile.deprecation}"
202 includeantruntime="false">
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
203 <classpath refid="base.class.path"/>
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
204 </javac>
205 </target>
206
327a789 @rolfl Make samples build after contrib
rolfl authored
207 <target name="compile.samples" depends="compile.core, compile.contrib"
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
208 description="Compiles the sample source code">
209
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
210 <!-- Copy resources and stuff - everything except Java code -->
211 <copy todir="${samples.build}" >
e270fd0 @rolfl Fixes #24 - Descendant iterator (and by proxy, FilterIterator) broken
rolfl authored
212 <fileset dir="${samples.src}" excludes="**/*.java" />
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
213 </copy>
214
215 <javac srcdir="${samples.src}"
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
216 destdir="${samples.build}"
217 debug="${compile.debug}"
218 optimize="${compile.optimize}"
219 target="${compile.target}"
220 source="${compile.source}"
c85cad9 @rolfl Tidy up build messages.
rolfl authored
221 deprecation="${compile.deprecation}"
222 includeantruntime="false">
327a789 @rolfl Make samples build after contrib
rolfl authored
223 <classpath refid="contrib.class.path" />
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
224 </javac>
225 </target>
226
227 <target name="compile.contrib" depends="compile.core"
228 description="Compiles the contrib source code">
229
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
230 <!-- Copy resources and stuff - everything except Java code -->
231 <copy todir="${contrib.build}" >
e270fd0 @rolfl Fixes #24 - Descendant iterator (and by proxy, FilterIterator) broken
rolfl authored
232 <fileset dir="${contrib.src}" excludes="**/*.java" />
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
233 </copy>
234
235 <javac srcdir="${contrib.src}"
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
236 destdir="${contrib.build}"
237 debug="${compile.debug}"
238 optimize="${compile.optimize}"
239 target="${compile.target}"
240 source="${compile.source}"
c85cad9 @rolfl Tidy up build messages.
rolfl authored
241 deprecation="${compile.deprecation}"
242 includeantruntime="false">
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
243 <classpath refid="core.class.path" />
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
244 </javac>
245 </target>
246
5074cc7 @rolfl Change the build order and classpaths to include Xalan libraries.
rolfl authored
247 <target name="compile.junit" depends="compile.core, compile.contrib"
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
248 description="Compiles the junit source code">
249
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
250 <!-- Copy resources and stuff - everything except Java code -->
18d95b2 @rolfl Clean up the build again. Fix compile-time warnings, and remove the
rolfl authored
251 <copy todir="${junit.build}" >
e270fd0 @rolfl Fixes #24 - Descendant iterator (and by proxy, FilterIterator) broken
rolfl authored
252 <fileset dir="${junit.src}" excludes="**/*.java" />
18d95b2 @rolfl Clean up the build again. Fix compile-time warnings, and remove the
rolfl authored
253 </copy>
254
c85cad9 @rolfl Tidy up build messages.
rolfl authored
255 <!-- ignore deprecation warnings in jUnit -->
18d95b2 @rolfl Clean up the build again. Fix compile-time warnings, and remove the
rolfl authored
256 <javac srcdir="${junit.src}"
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
257 destdir="${junit.build}"
258 debug="${compile.debug}"
259 optimize="${compile.optimize}"
260 target="${compile.target}"
261 source="${compile.source}"
c85cad9 @rolfl Tidy up build messages.
rolfl authored
262 deprecation="no"
18d95b2 @rolfl Clean up the build again. Fix compile-time warnings, and remove the
rolfl authored
263 includeantruntime="false">
5074cc7 @rolfl Change the build order and classpaths to include Xalan libraries.
rolfl authored
264 <classpath refid="contrib.class.path" />
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
265 </javac>
266 </target>
267
b46e7b9 @rolfl Remove default-package classes (JDOMAbout) from main jar.
rolfl authored
268 <target name="compile" depends="compile.core, compile.junit, compile.contrib, compile.samples"
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
269 description="Compiles all JDOM code (core, samples, junit, contrib)" />
270
271 <!-- =================================================================== -->
c47a272 @rolfl Create a 'package' properly
rolfl authored
272 <!-- Creates the API documentation -->
273 <!-- =================================================================== -->
274 <target name="javadoc" depends="prepare"
275 description="Creates the API documentation">
276 <mkdir dir="${build.javadocs}"/>
277 <javadoc packagenames="${packages}"
278 sourcepath="${core.src}"
279 destdir="${build.javadocs}"
280 author="true"
281 version="true"
282 use="true"
283 splitindex="true"
284 noindex="false"
285 windowtitle="${Name} v${version}"
286 doctitle="${Name} v${version}&lt;br&gt;API Specification"
287 header="&lt;b&gt;${Name}&lt;br&gt;&lt;font size='-1'&gt;${version}&lt;/font&gt;&lt;/b&gt;"
288 bottom="Copyright &#169; ${year} Jason Hunter, Brett McLaughlin. All Rights Reserved.">
289 <classpath refid="base.class.path"/>
290 </javadoc>
291 </target>
292
293 <!-- =================================================================== -->
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
294 <!-- Creates the class package -->
295 <!-- =================================================================== -->
6e96bfd @rolfl Add coverage, and thus junit results to be build, makes syncing the j…
rolfl authored
296 <target name="package" depends="compile, javadoc, coverage"
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
297 description="Creates the class package">
298 <fixcrlf srcdir="." includes="**/*.bat" excludes="build*.*" eol="crlf"/>
299 <fixcrlf srcdir="." includes="**/*.sh" excludes="build*.*" eol="lf"/>
300
301 <!-- Filters defined specifically for updating the manifest -->
302 <filter token="version.spec" value="${version.spec}"/>
303 <filter token="version.impl" value="${version.impl}"/>
c47a272 @rolfl Create a 'package' properly
rolfl authored
304
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
305 <copy todir="${metainf.build}/META-INF" filtering="yes">
306 <fileset dir="${metainf}"/>
307 <fileset dir=".">
308 <include name="LICENSE.txt"/>
309 </fileset>
310 </copy>
c47a272 @rolfl Create a 'package' properly
rolfl authored
311
312 <jar jarfile="${package}/${jarbase}.jar" manifest="${metainf.build}/META-INF/MANIFEST.MF">
fbd7fe3 @rolfl Clean up build artifacts.
rolfl authored
313 <fileset dir="${core.build}" includes="**/*.class" />
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
314 <fileset dir="${metainf.build}" excludes="**/MANIFEST.MF" />
315 </jar>
c47a272 @rolfl Create a 'package' properly
rolfl authored
316 <jar jarfile="${package}/${jarbase}-contrib.jar" >
317 <fileset dir="${contrib.build}" includes="**/*" />
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
318 <fileset dir="${metainf.build}" excludes="**/MANIFEST.MF" />
319 </jar>
c47a272 @rolfl Create a 'package' properly
rolfl authored
320 <jar jarfile="${package}/${jarbase}-junit.jar" >
321 <fileset dir="${junit.build}" includes="**/*" />
322 <fileset dir="${metainf.build}" excludes="**/MANIFEST.MF" />
323 </jar>
324 <jar destfile="${package}/${jarbase}-javadoc.jar"
325 basedir="${build.javadocs}" includes="**/*" />
326 <jar jarfile="${package}/${jarbase}-sources.jar" >
327 <fileset dir="${core.src}" includes="**/*" />
328 <fileset dir="${junit.src}" includes="**/*" />
329 <fileset dir="${contrib.src}" includes="**/*" />
330 </jar>
331 <zip destfile="${package}/${jarbase}.zip">
332 <fileset dir="${package}" includes="${jarbase}*.jar" />
59ef5bb @rolfl Smaller Package zip file (exclude dev-only jars).
rolfl authored
333 <fileset dir="${basedir}" includes="lib/xerces* lib/jaxen* lib/xml*" />
c47a272 @rolfl Create a 'package' properly
rolfl authored
334 </zip>
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
335 </target>
336
337 <!-- =================================================================== -->
338 <!-- Clean targets -->
339 <!-- =================================================================== -->
48e9b4a @rolfl Tidy up maven processes
rolfl authored
340 <target name="clean" description="Removes build files">
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
341 <delete dir="${build}" failonerror="false"/>
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
342 </target>
343
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
344 <!-- =================================================================== -->
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
345 <!-- JUnit and Test Coverage targets -->
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
346 <!-- =================================================================== -->
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
347 <target name="coverage.setup" description="Set up code-coverage metrics" depends="compile.core">
348 <taskdef classpathref="junit.class.path" resource="tasks.properties"/>
349
b2ee3b6 @rolfl Remove calls to deprecated deltree task and replace with 'delete'
rolfl authored
350 <delete dir="${junit.instrumented}"/>
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
351 <mkdir dir="${junit.instrumented}" />
fbd7fe3 @rolfl Clean up build artifacts.
rolfl authored
352 <property name="cobertura.datafile" value="${junit.instrumented}/cobertura.ser"/>
353 <cobertura-instrument todir="${junit.instrumented}" datafile="${cobertura.datafile}">
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
354 <fileset dir="${core.build}">
355 <include name="**/*.class"/>
65a7b4c @rolfl Add implementation o Jaxen XPath library Navigator for supporting JDOM2.
rolfl authored
356 <!-- exclude name="**/**/jaxen/**/*.class"/ -->
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
357 </fileset>
358 </cobertura-instrument>
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
359
360 <property name="forkjunit" value="true" />
361
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
362 </target>
363
14757e2 @rolfl Make it easier to test JDOM on different Java versions.
rolfl authored
364
48e9b4a @rolfl Tidy up maven processes
rolfl authored
365 <target name="junit.nodeps"
14757e2 @rolfl Make it easier to test JDOM on different Java versions.
rolfl authored
366 description="Run all the JUnit tests, but do not compile anything first">
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
367
368 <delete dir="${junit.report}" />
369 <mkdir dir="${junit.report}" />
370
371 <delete dir="${junit.xml}" />
372 <mkdir dir="${junit.xml}" />
373
e270fd0 @rolfl Fixes #24 - Descendant iterator (and by proxy, FilterIterator) broken
rolfl authored
374 <!-- We need to fork to get the resources on the classpath -->
375 <!-- Otherwise we rely on ant's ClassLoader which does not do resources nicely -->
376 <junit fork="true" forkmode="once" haltonerror="false" haltonfailure="false"
b93332b @rolfl Include xml-apis jar in classpath for junit/eclipse targets.
rolfl authored
377 failureproperty="junit.failed" printsummary="true" timeout="100000"
378 showoutput="true" includeantruntime="true" >
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
379
fbd7fe3 @rolfl Clean up build artifacts.
rolfl authored
380 <sysproperty key="net.sourceforge.cobertura.datafile"
381 file="${cobertura.datafile}" />
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
382 <classpath refid="junit.class.path" />
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
383
384 <formatter type="xml"/>
385
386 <batchtest haltonerror="false" haltonfailure="false"
387 failureproperty="junit.failed" todir="${junit.xml}" >
e270fd0 @rolfl Fixes #24 - Descendant iterator (and by proxy, FilterIterator) broken
rolfl authored
388 <sort>
389 <name />
390 <fileset dir="${junit.src}">
391 <include name="**/Test*.java"/>
392 <exclude name="**/generate/**" />
393 </fileset>
394 </sort>
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
395 </batchtest>
396
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
397 </junit>
18d95b2 @rolfl Clean up the build again. Fix compile-time warnings, and remove the
rolfl authored
398
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
399 <junitreport todir="${junit.report}">
400 <fileset dir="${junit.xml}">
401 <include name="TEST-*.xml"/>
402 </fileset>
403
404 <report format="frames" todir="${junit.report}"/>
405 </junitreport>
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
406 </target>
407
14757e2 @rolfl Make it easier to test JDOM on different Java versions.
rolfl authored
408 <target name="junit" depends="compile.core, compile.junit, junit.nodeps"
409 description="Compile code required for JUnit, then run JUnit tests"/>
410
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
411 <target name="coverage" depends="coverage.setup, junit"
412 description="Run the code coverage tool.">
b2ee3b6 @rolfl Remove calls to deprecated deltree task and replace with 'delete'
rolfl authored
413 <delete dir="${coverage.out}"/>
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
414 <mkdir dir="${coverage.out}" />
18d95b2 @rolfl Clean up the build again. Fix compile-time warnings, and remove the
rolfl authored
415 <cobertura-report srcdir="${core.src}" destdir="${coverage.out}" datafile="${cobertura.datafile}"/>
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
416 <echo message="See ${coverage.out}/index.html for results." />
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
417 </target>
418
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
419 <!-- =================================================================== -->
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
420 <!-- Eclipse targets -->
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
421 <!-- =================================================================== -->
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
422 <target name="eclipse" description="Set up your eclipse project (source folders, jars, etc.)">
423 <echo file="./.classpath" xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
424 <classpath>
425 <classpathentry kind="src" path="core/src/java"/>
426 <classpathentry kind="src" path="core/package"/>
427 <classpathentry kind="src" path="core/samples"/>
428 <classpathentry kind="src" path="test/src/java"/>
429 <classpathentry kind="src" path="test/resources"/>
48e9b4a @rolfl Tidy up maven processes
rolfl authored
430 <classpathentry kind="src" path="contrib/src/java" excluding="org/jdom/contrib/ids/doc-files/|org/jdom/contrib/input/scanner/doc-files/|org/jdom2/contrib/ids/doc-files/|org/jdom2/contrib/ids/doc-files/|org/jdom2/contrib/input/scanner/doc-files/|org/jdom2/contrib/input/scanner/doc-files/"/>
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
431 <classpathentry kind="src" path="contrib/samples"/>
432 <classpathentry kind="src" path="contrib/src/java/org/jdom2/contrib/ids/doc-files"/>
433 <classpathentry kind="src" path="contrib/src/java/org/jdom2/contrib/input/scanner/doc-files"/>
434 <classpathentry kind="lib" path="lib/junit-4.8.2.jar"/>
435 <classpathentry kind="lib" path="lib/xercesImpl.jar"/>
b9c2593 @rolfl Add xml-apis to eclipse path
rolfl authored
436 <classpathentry kind="lib" path="lib/xml-apis.jar"/>
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
437 <classpathentry kind="lib" path="lib/jaxen-1.1.3.jar"/>
48e9b4a @rolfl Tidy up maven processes
rolfl authored
438 <classpathentry kind="lib" path="contrib/lib/isorelax.jar"/>
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
439 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
440 <classpathentry kind="output" path="ebuild"/>
441 </classpath>
442 ]]>
443 </echo>
444 </target>
445
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
446 <!-- =================================================================== -->
447 <!-- Maven targets -->
448 <!-- =================================================================== -->
449
450
451 <target name="maven.clean">
48e9b4a @rolfl Tidy up maven processes
rolfl authored
452 <delete dir="${mavendir}" includes="**/*" failonerror="false"/>
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
453 </target>
454
48e9b4a @rolfl Tidy up maven processes
rolfl authored
455 <target name="maven" depends="maven.clean, package"
456 description="Prepares Maven bundle to load on to Sonatype Nexus for Maven-Central">
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
457 <mkdir dir="${mavendir}" />
c47a272 @rolfl Create a 'package' properly
rolfl authored
458 <mkdir dir="${mavendir}/core" />
459 <mkdir dir="${mavendir}/test" />
460 <mkdir dir="${mavendir}/contrib" />
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
461 <!-- copy the build jar -->
c47a272 @rolfl Create a 'package' properly
rolfl authored
462 <copy todir="${mavendir}/core" file="${package}/${jarbase}.jar"/>
463 <copy todir="${mavendir}/core" file="${package}/${jarbase}-javadoc.jar"/>
464 <copy todir="${mavendir}/core" file="${package}/${jarbase}-sources.jar"/>
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
465 <!-- copy/rename the pom template -->
c47a272 @rolfl Create a 'package' properly
rolfl authored
466 <copy filtering="true" file="maven/maven.pom" tofile="${mavendir}/core/${jarbase}.pom">
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
467 <filterset>
468 <filter token="artifactID" value="${name}"/>
469 <filter token="version" value="${version}" />
48e9b4a @rolfl Tidy up maven processes
rolfl authored
470 <filter token="jdk" value="${compile.target}" />
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
471 </filterset>
472 </copy>
473
48e9b4a @rolfl Tidy up maven processes
rolfl authored
474 <exec dir="${mavendir}/core" executable="${gpg}">
475 <arg value="-abv"/>
476 <arg value="${jarbase}.pom"/>
477 </exec>
478 <exec dir="${mavendir}/core" executable="${gpg}">
479 <arg value="-abv"/>
480 <arg value="${jarbase}.jar"/>
481 </exec>
482 <exec dir="${mavendir}/core" executable="${gpg}">
483 <arg value="-abv"/>
484 <arg value="${jarbase}-sources.jar"/>
485 </exec>
486 <exec dir="${mavendir}/core" executable="${gpg}">
487 <arg value="-abv"/>
488 <arg value="${jarbase}-javadoc.jar"/>
489 </exec>
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
490
491 <jar destfile="${mavendir}/${jarbase}-maven-bundle.jar"
c47a272 @rolfl Create a 'package' properly
rolfl authored
492 basedir="${mavendir}/core"
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
493 includes="${jarbase}*" excludes="*maven-bundle*" />
494
495 </target>
496
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
497 </project>
498
499 <!-- End of file -->
Something went wrong with that request. Please try again.