Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 562 lines (469 sloc) 23.176 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}/assets" />
358 <arg value="${android}/${android.project}Test/src" />
359 </java>
360
361 <mkdir dir="${android}/${android.project}Test/src/org/jdom2/test/util" />
362 <copy todir="${android}/${android.project}Test/src/org/jdom2/test/util"
363 file="test/android/AndroidFetch.java" />
364
365 <!-- Create a Jar file with just the JUnit4 tests, not the resources. -->
366 <jar jarfile="${android.libs}/${jarbase}-android-junit4.jar" >
367 <fileset dir="${junit.build}" includes="**/*.class" />
368 </jar>
369
370 <copy todir="${android.libs}">
371 <fileset dir="${package}" includes="${jarbase}.jar, ${jarbase}-contrib.jar" />
372 </copy>
373
374 <copy todir="${android.libs}" file="${jaxen.jar}"/>
375 <copy todir="${android.libs}" file="${xalan.jar}"/>
376 <copy todir="${android.libs}" file="${xalanser.jar}"/>
377 <copy todir="${android.libs}" file="${junit.jar}"/>
378 </target>
379
380 <!-- =================================================================== -->
381 <!-- Creates the class package -->
382 <!-- =================================================================== -->
383 <target name="package" depends="coverage, jars"
384 description="Creates the class package">
c47a272 @rolfl Create a 'package' properly
rolfl authored
385 <zip destfile="${package}/${jarbase}.zip">
386 <fileset dir="${package}" includes="${jarbase}*.jar" />
59ef5bb @rolfl Smaller Package zip file (exclude dev-only jars).
rolfl authored
387 <fileset dir="${basedir}" includes="lib/xerces* lib/jaxen* lib/xml*" />
6ebedbf @rolfl Update Package to contain LICENSE.txt and README.txt
rolfl authored
388 <fileset dir="${basedir}" includes="LICENSE.txt README.txt" />
c47a272 @rolfl Create a 'package' properly
rolfl authored
389 </zip>
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
390 </target>
391
392 <!-- =================================================================== -->
393 <!-- Clean targets -->
394 <!-- =================================================================== -->
48e9b4a @rolfl Tidy up maven processes
rolfl authored
395 <target name="clean" description="Removes build files">
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
396 <delete dir="${build}" failonerror="false"/>
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
397 </target>
398
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
399 <!-- =================================================================== -->
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
400 <!-- JUnit and Test Coverage targets -->
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
401 <!-- =================================================================== -->
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
402 <target name="coverage.setup" description="Set up code-coverage metrics" depends="compile.core">
403 <taskdef classpathref="junit.class.path" resource="tasks.properties"/>
404
b2ee3b6 @rolfl Remove calls to deprecated deltree task and replace with 'delete'
rolfl authored
405 <delete dir="${junit.instrumented}"/>
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
406 <mkdir dir="${junit.instrumented}" />
fbd7fe3 @rolfl Clean up build artifacts.
rolfl authored
407 <property name="cobertura.datafile" value="${junit.instrumented}/cobertura.ser"/>
408 <cobertura-instrument todir="${junit.instrumented}" datafile="${cobertura.datafile}">
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
409 <fileset dir="${core.build}">
410 <include name="**/*.class"/>
65a7b4c @rolfl Add implementation o Jaxen XPath library Navigator for supporting JDOM2.
rolfl authored
411 <!-- exclude name="**/**/jaxen/**/*.class"/ -->
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
412 </fileset>
413 </cobertura-instrument>
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
414
415 <property name="forkjunit" value="true" />
416
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
417 </target>
418
14757e2 @rolfl Make it easier to test JDOM on different Java versions.
rolfl authored
419
48e9b4a @rolfl Tidy up maven processes
rolfl authored
420 <target name="junit.nodeps"
14757e2 @rolfl Make it easier to test JDOM on different Java versions.
rolfl authored
421 description="Run all the JUnit tests, but do not compile anything first">
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
422
423 <delete dir="${junit.report}" />
424 <mkdir dir="${junit.report}" />
425
426 <delete dir="${junit.xml}" />
427 <mkdir dir="${junit.xml}" />
428
e270fd0 @rolfl Fixes #24 - Descendant iterator (and by proxy, FilterIterator) broken
rolfl authored
429 <!-- We need to fork to get the resources on the classpath -->
430 <!-- Otherwise we rely on ant's ClassLoader which does not do resources nicely -->
431 <junit fork="true" forkmode="once" haltonerror="false" haltonfailure="false"
b93332b @rolfl Include xml-apis jar in classpath for junit/eclipse targets.
rolfl authored
432 failureproperty="junit.failed" printsummary="true" timeout="100000"
433 showoutput="true" includeantruntime="true" >
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
434
fbd7fe3 @rolfl Clean up build artifacts.
rolfl authored
435 <sysproperty key="net.sourceforge.cobertura.datafile"
436 file="${cobertura.datafile}" />
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
437 <classpath refid="junit.class.path" />
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
438
439 <formatter type="xml"/>
440
441 <batchtest haltonerror="false" haltonfailure="false"
442 failureproperty="junit.failed" todir="${junit.xml}" >
e270fd0 @rolfl Fixes #24 - Descendant iterator (and by proxy, FilterIterator) broken
rolfl authored
443 <sort>
444 <name />
445 <fileset dir="${junit.src}">
446 <include name="**/Test*.java"/>
447 <exclude name="**/generate/**" />
448 </fileset>
449 </sort>
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
450 </batchtest>
451
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
452 </junit>
18d95b2 @rolfl Clean up the build again. Fix compile-time warnings, and remove the
rolfl authored
453
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
454 <junitreport todir="${junit.report}">
455 <fileset dir="${junit.xml}">
456 <include name="TEST-*.xml"/>
457 </fileset>
458
459 <report format="frames" todir="${junit.report}"/>
460 </junitreport>
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
461 </target>
462
14757e2 @rolfl Make it easier to test JDOM on different Java versions.
rolfl authored
463 <target name="junit" depends="compile.core, compile.junit, junit.nodeps"
464 description="Compile code required for JUnit, then run JUnit tests"/>
465
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
466 <target name="coverage" depends="coverage.setup, junit"
467 description="Run the code coverage tool.">
b2ee3b6 @rolfl Remove calls to deprecated deltree task and replace with 'delete'
rolfl authored
468 <delete dir="${coverage.out}"/>
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
469 <mkdir dir="${coverage.out}" />
18d95b2 @rolfl Clean up the build again. Fix compile-time warnings, and remove the
rolfl authored
470 <cobertura-report srcdir="${core.src}" destdir="${coverage.out}" datafile="${cobertura.datafile}"/>
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
471 <echo message="See ${coverage.out}/index.html for results." />
7cb8614 @rolfl Include JUnit ant target and code coverage tool cobertura.
rolfl authored
472 </target>
473
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
474 <!-- =================================================================== -->
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
475 <!-- Eclipse targets -->
e0af7b6 @rolfl Tidy up the ant junit process.
rolfl authored
476 <!-- =================================================================== -->
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
477 <target name="eclipse" description="Set up your eclipse project (source folders, jars, etc.)">
478 <echo file="./.classpath" xml:space="preserve"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
479 <classpath>
480 <classpathentry kind="src" path="core/src/java"/>
481 <classpathentry kind="src" path="core/package"/>
482 <classpathentry kind="src" path="core/samples"/>
483 <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
484 <classpathentry kind="src" path="test/src/resources"/>
48e9b4a @rolfl Tidy up maven processes
rolfl authored
485 <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
486 <classpathentry kind="src" path="contrib/samples"/>
487 <classpathentry kind="src" path="contrib/src/java/org/jdom2/contrib/ids/doc-files"/>
488 <classpathentry kind="src" path="contrib/src/java/org/jdom2/contrib/input/scanner/doc-files"/>
489 <classpathentry kind="lib" path="lib/junit-4.8.2.jar"/>
490 <classpathentry kind="lib" path="lib/xercesImpl.jar"/>
b9c2593 @rolfl Add xml-apis to eclipse path
rolfl authored
491 <classpathentry kind="lib" path="lib/xml-apis.jar"/>
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
492 <classpathentry kind="lib" path="lib/jaxen-1.1.3.jar"/>
48e9b4a @rolfl Tidy up maven processes
rolfl authored
493 <classpathentry kind="lib" path="contrib/lib/isorelax.jar"/>
8c304c2 @rolfl Tidy up the eclipse ant task.
rolfl authored
494 <classpathentry kind="lib" path="lib/xalan/serializer-2.7.1.jar"/>
495 <classpathentry kind="lib" path="lib/xalan/xalan-2.7.1.jar"/>
34397dd @rolfl create an 'eclipse' target for ant.
rolfl authored
496 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
497 <classpathentry kind="output" path="ebuild"/>
498 </classpath>
499 ]]>
500 </echo>
501 </target>
502
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
503 <!-- =================================================================== -->
504 <!-- Maven targets -->
505 <!-- =================================================================== -->
506
507
508 <target name="maven.clean">
48e9b4a @rolfl Tidy up maven processes
rolfl authored
509 <delete dir="${mavendir}" includes="**/*" failonerror="false"/>
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
510 </target>
511
48e9b4a @rolfl Tidy up maven processes
rolfl authored
512 <target name="maven" depends="maven.clean, package"
513 description="Prepares Maven bundle to load on to Sonatype Nexus for Maven-Central">
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
514 <mkdir dir="${mavendir}" />
c47a272 @rolfl Create a 'package' properly
rolfl authored
515 <mkdir dir="${mavendir}/core" />
516 <mkdir dir="${mavendir}/test" />
517 <mkdir dir="${mavendir}/contrib" />
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
518 <!-- copy the build jar -->
c47a272 @rolfl Create a 'package' properly
rolfl authored
519 <copy todir="${mavendir}/core" file="${package}/${jarbase}.jar"/>
520 <copy todir="${mavendir}/core" file="${package}/${jarbase}-javadoc.jar"/>
521 <copy todir="${mavendir}/core" file="${package}/${jarbase}-sources.jar"/>
23295c9 @rolfl Include the JDOM License directly in the POM
rolfl authored
522
523 <!-- load the license in to the ${license} property -->
524 <loadfile property="license" srcfile="LICENSE.txt" />
525
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
526 <!-- copy/rename the pom template -->
c47a272 @rolfl Create a 'package' properly
rolfl authored
527 <copy filtering="true" file="maven/maven.pom" tofile="${mavendir}/core/${jarbase}.pom">
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
528 <filterset>
529 <filter token="artifactID" value="${name}"/>
530 <filter token="version" value="${version}" />
48e9b4a @rolfl Tidy up maven processes
rolfl authored
531 <filter token="jdk" value="${compile.target}" />
23295c9 @rolfl Include the JDOM License directly in the POM
rolfl authored
532 <filter token="license" value="${license}" />
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
533 </filterset>
534 </copy>
535
48e9b4a @rolfl Tidy up maven processes
rolfl authored
536 <exec dir="${mavendir}/core" executable="${gpg}">
537 <arg value="-abv"/>
538 <arg value="${jarbase}.pom"/>
539 </exec>
540 <exec dir="${mavendir}/core" executable="${gpg}">
541 <arg value="-abv"/>
542 <arg value="${jarbase}.jar"/>
543 </exec>
544 <exec dir="${mavendir}/core" executable="${gpg}">
545 <arg value="-abv"/>
546 <arg value="${jarbase}-sources.jar"/>
547 </exec>
548 <exec dir="${mavendir}/core" executable="${gpg}">
549 <arg value="-abv"/>
550 <arg value="${jarbase}-javadoc.jar"/>
551 </exec>
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
552
553 <jar destfile="${mavendir}/${jarbase}-maven-bundle.jar"
c47a272 @rolfl Create a 'package' properly
rolfl authored
554 basedir="${mavendir}/core"
5f7bf05 @rolfl Include Maven target in build.
rolfl authored
555 includes="${jarbase}*" excludes="*maven-bundle*" />
556
557 </target>
558
0a76492 @rolfl Create an initial build.xml for the combined core/contrib/test code.
rolfl authored
559 </project>
560
561 <!-- End of file -->
Something went wrong with that request. Please try again.