Skip to content

HTTPS clone URL

Subversion checkout URL

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