Skip to content

HTTPS clone URL

Subversion checkout URL

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