Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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