Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 510 lines (428 sloc) 21.042 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>
294
295 <!-- =================================================================== -->
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
296 <!-- Creates the class package -->
297 <!-- =================================================================== -->
6e96bfd @rolfl Add coverage, and thus junit results to be build, makes syncing the j…
rolfl authored
298 <target name="package" depends="compile, javadoc, coverage"
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
299 description="Creates the class package">
300 <fixcrlf srcdir="." includes="**/*.bat" excludes="build*.*" eol="crlf"/>
301 <fixcrlf srcdir="." includes="**/*.sh" excludes="build*.*" eol="lf"/>
302
303 <!-- Filters defined specifically for updating the manifest -->
304 <filter token="version.spec" value="${version.spec}"/>
305 <filter token="version.impl" value="${version.impl}"/>
c47a272 @rolfl Create a 'package' properly
rolfl authored
306
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
307 <copy todir="${metainf.build}/META-INF" filtering="yes">
308 <fileset dir="${metainf}"/>
309 <fileset dir=".">
310 <include name="LICENSE.txt"/>
311 </fileset>
312 </copy>
c47a272 @rolfl Create a 'package' properly
rolfl authored
313
314 <jar jarfile="${package}/${jarbase}.jar" manifest="${metainf.build}/META-INF/MANIFEST.MF">
fbd7fe3 @rolfl Clean up build artifacts.
rolfl authored
315 <fileset dir="${core.build}" includes="**/*.class" />
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
316 <fileset dir="${metainf.build}" excludes="**/MANIFEST.MF" />
317 </jar>
c47a272 @rolfl Create a 'package' properly
rolfl authored
318 <jar jarfile="${package}/${jarbase}-contrib.jar" >
319 <fileset dir="${contrib.build}" includes="**/*" />
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
320 <fileset dir="${metainf.build}" excludes="**/MANIFEST.MF" />
321 </jar>
c47a272 @rolfl Create a 'package' properly
rolfl authored
322 <jar jarfile="${package}/${jarbase}-junit.jar" >
323 <fileset dir="${junit.build}" includes="**/*" />
324 <fileset dir="${metainf.build}" excludes="**/MANIFEST.MF" />
325 </jar>
326 <jar destfile="${package}/${jarbase}-javadoc.jar"
327 basedir="${build.javadocs}" includes="**/*" />
328 <jar jarfile="${package}/${jarbase}-sources.jar" >
329 <fileset dir="${core.src}" includes="**/*" />
330 <fileset dir="${junit.src}" includes="**/*" />
331 <fileset dir="${contrib.src}" includes="**/*" />
332 </jar>
333 <zip destfile="${package}/${jarbase}.zip">
334 <fileset dir="${package}" includes="${jarbase}*.jar" />
59ef5bb @rolfl Smaller Package zip file (exclude dev-only jars).
rolfl authored
335 <fileset dir="${basedir}" includes="lib/xerces* lib/jaxen* lib/xml*" />
6ebedbf @rolfl Update Package to contain LICENSE.txt and README.txt
rolfl authored
336 <fileset dir="${basedir}" includes="LICENSE.txt README.txt" />
c47a272 @rolfl Create a 'package' properly
rolfl authored
337 </zip>
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
338 </target>
339
340 <!-- =================================================================== -->
341 <!-- Clean targets -->
342 <!-- =================================================================== -->
48e9b4a @rolfl Tidy up maven processes
rolfl authored
343 <target name="clean" description="Removes build files">
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
344 <delete dir="${build}" failonerror="false"/>
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
345 </target>
346
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
347 <!-- =================================================================== -->
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
348 <!-- JUnit and Test Coverage targets -->
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
349 <!-- =================================================================== -->
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
350 <target name="coverage.setup" description="Set up code-coverage metrics" depends="compile.core">
351 <taskdef classpathref="junit.class.path" resource="tasks.properties"/>
352
b2ee3b6 @rolfl Remove calls to deprecated deltree task and replace with 'delete'
rolfl authored
353 <delete dir="${junit.instrumented}"/>
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
354 <mkdir dir="${junit.instrumented}" />
fbd7fe3 @rolfl Clean up build artifacts.
rolfl authored
355 <property name="cobertura.datafile" value="${junit.instrumented}/cobertura.ser"/>
356 <cobertura-instrument todir="${junit.instrumented}" datafile="${cobertura.datafile}">
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
357 <fileset dir="${core.build}">
358 <include name="**/*.class"/>
65a7b4c @rolfl Add implementation o Jaxen XPath library Navigator for supporting JDOM2.
rolfl authored
359 <!-- exclude name="**/**/jaxen/**/*.class"/ -->
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
360 </fileset>
361 </cobertura-instrument>
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
362
363 <property name="forkjunit" value="true" />
364
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
365 </target>
366
14757e2 @rolfl Make it easier to test JDOM on different Java versions.
rolfl authored
367
48e9b4a @rolfl Tidy up maven processes
rolfl authored
368 <target name="junit.nodeps"
14757e2 @rolfl Make it easier to test JDOM on different Java versions.
rolfl authored
369 description="Run all the JUnit tests, but do not compile anything first">
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
370
371 <delete dir="${junit.report}" />
372 <mkdir dir="${junit.report}" />
373
374 <delete dir="${junit.xml}" />
375 <mkdir dir="${junit.xml}" />
376
e270fd0 @rolfl Fixes #24 - Descendant iterator (and by proxy, FilterIterator) broken
rolfl authored
377 <!-- We need to fork to get the resources on the classpath -->
378 <!-- Otherwise we rely on ant's ClassLoader which does not do resources nicely -->
379 <junit fork="true" forkmode="once" haltonerror="false" haltonfailure="false"
b93332b @rolfl Include xml-apis jar in classpath for junit/eclipse targets.
rolfl authored
380 failureproperty="junit.failed" printsummary="true" timeout="100000"
381 showoutput="true" includeantruntime="true" >
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
382
fbd7fe3 @rolfl Clean up build artifacts.
rolfl authored
383 <sysproperty key="net.sourceforge.cobertura.datafile"
384 file="${cobertura.datafile}" />
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
385 <classpath refid="junit.class.path" />
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
386
387 <formatter type="xml"/>
388
389 <batchtest haltonerror="false" haltonfailure="false"
390 failureproperty="junit.failed" todir="${junit.xml}" >
e270fd0 @rolfl Fixes #24 - Descendant iterator (and by proxy, FilterIterator) broken
rolfl authored
391 <sort>
392 <name />
393 <fileset dir="${junit.src}">
394 <include name="**/Test*.java"/>
395 <exclude name="**/generate/**" />
396 </fileset>
397 </sort>
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
398 </batchtest>
399
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
400 </junit>
18d95b2 @rolfl Clean up the build again. Fix compile-time warnings, and remove the
rolfl authored
401
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
402 <junitreport todir="${junit.report}">
403 <fileset dir="${junit.xml}">
404 <include name="TEST-*.xml"/>
405 </fileset>
406
407 <report format="frames" todir="${junit.report}"/>
408 </junitreport>
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
409 </target>
410
14757e2 @rolfl Make it easier to test JDOM on different Java versions.
rolfl authored
411 <target name="junit" depends="compile.core, compile.junit, junit.nodeps"
412 description="Compile code required for JUnit, then run JUnit tests"/>
413
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
414 <target name="coverage" depends="coverage.setup, junit"
415 description="Run the code coverage tool.">
b2ee3b6 @rolfl Remove calls to deprecated deltree task and replace with 'delete'
rolfl authored
416 <delete dir="${coverage.out}"/>
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
417 <mkdir dir="${coverage.out}" />
18d95b2 @rolfl Clean up the build again. Fix compile-time warnings, and remove the
rolfl authored
418 <cobertura-report srcdir="${core.src}" destdir="${coverage.out}" datafile="${cobertura.datafile}"/>
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
419 <echo message="See ${coverage.out}/index.html for results." />
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
420 </target>
421
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
422 <!-- =================================================================== -->
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
423 <!-- Eclipse targets -->
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
424 <!-- =================================================================== -->
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
425 <target name="eclipse" description="Set up your eclipse project (source folders, jars, etc.)">
426 <echo file="./.classpath" xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
427 <classpath>
428 <classpathentry kind="src" path="core/src/java"/>
429 <classpathentry kind="src" path="core/package"/>
430 <classpathentry kind="src" path="core/samples"/>
431 <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
432 <classpathentry kind="src" path="test/src/resources"/>
48e9b4a @rolfl Tidy up maven processes
rolfl authored
433 <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
434 <classpathentry kind="src" path="contrib/samples"/>
435 <classpathentry kind="src" path="contrib/src/java/org/jdom2/contrib/ids/doc-files"/>
436 <classpathentry kind="src" path="contrib/src/java/org/jdom2/contrib/input/scanner/doc-files"/>
437 <classpathentry kind="lib" path="lib/junit-4.8.2.jar"/>
438 <classpathentry kind="lib" path="lib/xercesImpl.jar"/>
b9c2593 @rolfl Add xml-apis to eclipse path
rolfl authored
439 <classpathentry kind="lib" path="lib/xml-apis.jar"/>
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
440 <classpathentry kind="lib" path="lib/jaxen-1.1.3.jar"/>
48e9b4a @rolfl Tidy up maven processes
rolfl authored
441 <classpathentry kind="lib" path="contrib/lib/isorelax.jar"/>
8c304c2 @rolfl Tidy up the eclipse ant task.
rolfl authored
442 <classpathentry kind="lib" path="lib/xalan/serializer-2.7.1.jar"/>
443 <classpathentry kind="lib" path="lib/xalan/xalan-2.7.1.jar"/>
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
444 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
445 <classpathentry kind="output" path="ebuild"/>
446 </classpath>
447 ]]>
448 </echo>
449 </target>
450
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
451 <!-- =================================================================== -->
452 <!-- Maven targets -->
453 <!-- =================================================================== -->
454
455
456 <target name="maven.clean">
48e9b4a @rolfl Tidy up maven processes
rolfl authored
457 <delete dir="${mavendir}" includes="**/*" failonerror="false"/>
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
458 </target>
459
48e9b4a @rolfl Tidy up maven processes
rolfl authored
460 <target name="maven" depends="maven.clean, package"
461 description="Prepares Maven bundle to load on to Sonatype Nexus for Maven-Central">
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
462 <mkdir dir="${mavendir}" />
c47a272 @rolfl Create a 'package' properly
rolfl authored
463 <mkdir dir="${mavendir}/core" />
464 <mkdir dir="${mavendir}/test" />
465 <mkdir dir="${mavendir}/contrib" />
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
466 <!-- copy the build jar -->
c47a272 @rolfl Create a 'package' properly
rolfl authored
467 <copy todir="${mavendir}/core" file="${package}/${jarbase}.jar"/>
468 <copy todir="${mavendir}/core" file="${package}/${jarbase}-javadoc.jar"/>
469 <copy todir="${mavendir}/core" file="${package}/${jarbase}-sources.jar"/>
23295c9 @rolfl Include the JDOM License directly in the POM
rolfl authored
470
471 <!-- load the license in to the ${license} property -->
472 <loadfile property="license" srcfile="LICENSE.txt" />
473
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
474 <!-- copy/rename the pom template -->
c47a272 @rolfl Create a 'package' properly
rolfl authored
475 <copy filtering="true" file="maven/maven.pom" tofile="${mavendir}/core/${jarbase}.pom">
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
476 <filterset>
477 <filter token="artifactID" value="${name}"/>
478 <filter token="version" value="${version}" />
48e9b4a @rolfl Tidy up maven processes
rolfl authored
479 <filter token="jdk" value="${compile.target}" />
23295c9 @rolfl Include the JDOM License directly in the POM
rolfl authored
480 <filter token="license" value="${license}" />
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
481 </filterset>
482 </copy>
483
48e9b4a @rolfl Tidy up maven processes
rolfl authored
484 <exec dir="${mavendir}/core" executable="${gpg}">
485 <arg value="-abv"/>
486 <arg value="${jarbase}.pom"/>
487 </exec>
488 <exec dir="${mavendir}/core" executable="${gpg}">
489 <arg value="-abv"/>
490 <arg value="${jarbase}.jar"/>
491 </exec>
492 <exec dir="${mavendir}/core" executable="${gpg}">
493 <arg value="-abv"/>
494 <arg value="${jarbase}-sources.jar"/>
495 </exec>
496 <exec dir="${mavendir}/core" executable="${gpg}">
497 <arg value="-abv"/>
498 <arg value="${jarbase}-javadoc.jar"/>
499 </exec>
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
500
501 <jar destfile="${mavendir}/${jarbase}-maven-bundle.jar"
c47a272 @rolfl Create a 'package' properly
rolfl authored
502 basedir="${mavendir}/core"
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
503 includes="${jarbase}*" excludes="*maven-bundle*" />
504
505 </target>
506
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
507 </project>
508
509 <!-- End of file -->
Something went wrong with that request. Please try again.