Skip to content

HTTPS clone URL

Subversion checkout URL

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