Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 13 files changed
  • 0 commit comments
  • 1 contributor
View
7 COMMITTERS.txt
@@ -1,10 +1,9 @@
-The following people are committers on the "jdom" core module, listed
-alphabetically by last name.
+The following people are committers on the "jdom" repo.
DO NOT WRITE THESE PEOPLE FOR TECH SUPPORT. THEY WILL NOT ANSWER.
WRITE THE jdom-interest MAILING LIST AT http://jdom.org.
-Jason Hunter is code captains for this module.
+Jason Hunter <jhunter_AT_jdom_DOT_org> is project maintainer.
-Jason Hunter <jhunter_AT_jdom_DOT_org>
+Rolf Lear <jdom_AT_tuis_DOT_net> is leading the JDOM 2.0 work.
View
4 LICENSE.txt
@@ -1,8 +1,6 @@
/*--
- $Id: LICENSE.txt,v 1.11 2004/02/06 09:32:57 jhunter Exp $
-
- Copyright (C) 2000-2004 Jason Hunter & Brett McLaughlin.
+ Copyright (C) 2000-2011 Jason Hunter & Brett McLaughlin.
All rights reserved.
Redistribution and use in source and binary forms, with or without
View
55 README.txt
@@ -1,7 +1,8 @@
Introduction to the JDOM project
================================
-Please see the JDOM web site at http://jdom.org/.
+Please see the JDOM web site at http://jdom.org/
+and GitHub repository at https://github.com/hunterhacker/jdom/
How to use JDOM
@@ -14,20 +15,22 @@ numerous articles and books covering JDOM.
Installing the build tools
==========================
-The JDOM build system is based on Jakarta Ant, which is a Java building tool
-originally developed for the Jakarta Tomcat project but now used in many other
-Apache projects and extended by many developers.
-
-Ant is a little but very handy tool that uses a build file written in XML
-(build.xml) as building instructions. For more information refer to
-"http://ant.apache.org".
+The JDOM build system is based on Apache Ant. Ant is a little but very
+handy tool that uses a build file written in XML (build.xml) as building
+instructions. For more information refer to "http://ant.apache.org".
The only thing that you have to make sure of is that the "JAVA_HOME"
environment property is set to match the top level directory containing the
JVM you want to use. For example:
-C:\> set JAVA_HOME=C:\jdk1.2.2
- (or jdk1.3.1, etc.)
+C:\> set JAVA_HOME=C:\jdk1.6
+
+or on Mac:
+
+% setenv JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
+ (csh)
+> JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home; export JAVA_HOME
+ (ksh, bash)
or on Unix:
@@ -43,21 +46,13 @@ Building instructions
=====================
Ok, let's build the code. First, make sure your current working directory is
-where the build.xml file is located. Then type
+where the build.xml file is located. Then run "ant".
- ./build.sh (unix)
- .\build.bat (win32)
-
-if everything is right and all the required packages are visible, this action
-will generate a file called "jdom.jar" in the "./build" directory. Note, that
+If everything is right and all the required packages are visible, this action
+will generate a file called "jdom2.jar" in the "./build" directory. Note, that
if you do further development, compilation time is reduced since Ant is able
to detect which files have changed and recompile them as needed.
-If for some crazy reason you're still using JDK 1.1, please note that JDOM no
-longer supports JDK 1.1 compiles. If you're despreate for JDK 1.1 support,
-you can retrieve the CVS code from April 2nd, 2003, (use the -D flag). This
-was the last day JDK 1.1 was supported. Then run the "build11" scripts.
-
If something went wrong, go to the FAQ at http://www.jdom.org/docs/faq.html.
@@ -70,20 +65,14 @@ javadocs.
These are the meaningful targets for this build file:
- - package [default] -> creates ./build/jdom.jar
+ - package [default] -> generates ./build/jdom2.jar and other supporting files
- compile -> compiles the source code
- - samples -> compiles example code
- javadoc -> generates the API documentation in ./build/javadocs
+ - junit -> runs the JUnit tests
+ - coverage -> generates test coverage metrics
+ - eclipse -> generates an Eclipse project (source folders, jars, etc)
- clean -> restores the distribution to its original and clean state
-For example, to build the samples, type
-
-build samples
-(Windows)
-
-build.sh samples
-(Unix)
-
To learn the details of what each target does, read the build.xml file. It is
quite understandable.
@@ -92,10 +81,10 @@ Bug Reports
===========
Bug reports go to the jdom-interest list at jdom.org. But *BEFORE YOU POST*
-make sure you've tested against the LATEST code available from CVS (or the
+make sure you've tested against the LATEST code available from GitHub (or the
daily snapshot). Odds are good your bug has already been fixed. If it hasn't
been fixed in the latest version, then when posting *BE SURE TO SAY* which
-code version you tested against. For example, "CVS from October 3rd". Also
+code version you tested against. For example, "GitHub from October 3rd". Also
be sure to include enough information to reproduce the bug and full exception
stack traces. You might also want to read the FAQ at http://jdom.org to find
out if your problem is not really a bug and just a common misunderstanding
View
13 build.xml
@@ -29,7 +29,7 @@ For instructions on how to build JDOM, please view the README.txt file.
<property file="${basedir}/build.properties" />
<property name="Name" value="JDOM"/>
- <property name="name" value="jdom"/>
+ <property name="name" value="jdom2"/>
<property name="version" value="2.alpha"/>
<property name="version.impl" value="${version}"/>
<property name="version.spec" value="2.alpha"/>
@@ -130,10 +130,13 @@ For instructions on how to build JDOM, please view the README.txt file.
<echo message=""/>
<echo message=" available targets are:"/>
<echo message=""/>
- <echo message=" package --> generates the jdom.jar file (default)"/>
- <echo message=" compile --> compiles the source code"/>
- <echo message=" javadoc --> generates the API documentation"/>
- <echo message=" clean --> cleans up the directory"/>
+ <echo message=" - package [default] -> generates ./build/jdom2.jar and other supporting files"/>
+ <echo message=" - compile -> compiles the source code"/>
+ <echo message=" - javadoc -> generates the API documentation in ./build/javadocs"/>
+ <echo message=" - junit -> runs the JUnit tests"/>
+ <echo message=" - coverage -> generates test coverage metrics"/>
+ <echo message=" - eclipse -> generates an Eclipse project (source folders, jars, etc)"/>
+ <echo message=" - clean -> restores the distribution to its original and clean state"/>
<echo message=""/>
<echo message=" See the comments inside the build.xml file for more details."/>
<echo message="-------------------------------------------------------------"/>
View
26 contrib/build.bat
@@ -1,26 +0,0 @@
-@echo off
-
-echo Building...
-
-if "%JAVA_HOME%" == "" goto error
-
-set LOCALCLASSPATH=%JAVA_HOME%\lib\tools.jar;..\jdom\lib\ant.jar;..\jdom\lib\xml-apis.jar;..\jdom\lib\xerces.jar
-set ANT_HOME=../jdom/lib
-
-echo Building with classpath %LOCALCLASSPATH%;%ADDITIONALCLASSPATH%
-
-echo Starting Ant...
-
-"%JAVA_HOME%\bin\java.exe" -Dant.home="%ANT_HOME%" -classpath "%LOCALCLASSPATH%;%ADDITIONALCLASSPATH%" org.apache.tools.ant.Main %1 %2 %3 %4 %5
-
-goto end
-
-:error
-
-echo ERROR: JAVA_HOME not found in your environment.
-echo Please, set the JAVA_HOME variable in your environment to match the
-echo location of the Java Virtual Machine you want to use.
-
-:end
-
-set LOCALCLASSPATH=
View
32 contrib/build.sh
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-echo
-echo "Building..."
-echo
-
-if [ "$JAVA_HOME" = "" ] ; then
- echo "ERROR: JAVA_HOME not found in your environment."
- echo
- echo "Please, set the JAVA_HOME variable in your environment to match the"
- echo "location of the Java Virtual Machine you want to use."
- exit 1
-fi
-
-if [ `uname | grep -n CYGWIN` ]; then
- PS=";"
-elif [ `uname | grep -n Windows` ]; then
- PS=";"
-else
- PS=":"
-fi
-
-LOCALCLASSPATH=$JAVA_HOME/lib/tools.jar${PS}$JAVA_HOME/lib/dev.jar${PS}../jdom/lib/ant.jar${PS}../jdom/lib/xml-apis.jar${PS}../jdom/lib/xerces.jar
-ANT_HOME=../jdom/lib
-
-echo Building with classpath $LOCALCLASSPATH${PS}$ADDITIONALCLASSPATH
-echo
-
-echo Starting Ant...
-echo
-
-$JAVA_HOME/bin/java -Dant.home=$ANT_HOME -classpath $LOCALCLASSPATH${PS}$ADDITIONALCLASSPATH org.apache.tools.ant.Main $*
View
290 contrib/build.xml
@@ -1,290 +0,0 @@
-<!-- ===========================================================================
-
-
-Introduction
-============
-
-To Be Written
-
-
-Installing the build tools
-==========================
-
-For instructions on JDOM use of Ant see the build.xml find in the "jdom"
-module (../jdom).
-
-Build targets
-=============
-
-These are the meaningful targets for this build file:
-
- - package [default] -> creates ./build/jdom-contrib.jar
- - compile -> compiles the contributed source code
- - samples -> compiles the contributed samples
- - javadoc -> generates the API documentation in ./build/javadocs
- - clean -> restores the distribution to its original and clean state
-
--->
-
-<project default="package" basedir=".">
-
- <!-- =================================================================== -->
- <!-- Initialization target -->
- <!-- =================================================================== -->
- <target name="init">
- <tstamp/>
-
- <!--
- Give user a chance to override without editing this file
- (and without using -D arguments each time they build).
- The build properties a user is likely to override include:
- - jdom.dir The directory where the JDOM distribution is
- installed. Defaults to ../jdom
- - jdom.lib.dir The directory where to look for the default JAR
- files. Defaults to ${jdom.dir}/lib
- - jdom-core.jar The JAR containing the core JDOM API.
- Defaults to ${jdom.lib}/build/jdom.jar
- - xml-apis.jar The JAR containing the DOM, SAX and JAXP classes.
- Defaults to ${jdom.lib.dir}/xml-apis.jar
- - parser.jar The JAR containing the XML parser to use.
- Defaults to ${jdom.lib.dir}/xerces.jar
- - jakarta-regexp.jar The JAR containing the Jakarta RegExp classes.
- Defaults to ${lib.dir}/jakarta-regexp-1.1.jar
-
- Note that any build.properties files located in the user home directory
- (${user.home}) and in the JDOM directory (${jdom.dir}) are also taken
- into account. Thus, JAR settings defined in these files do not need to
- be redefined in the local build.properties.
- -->
- <property file="${user.home}/jdom.build.properties" />
- <property file="${basedir}/build.properties" />
-
- <!-- JDOM home & libraries -->
- <property name="jdom.dir" value="../jdom"/>
- <property name="jdom.lib.dir" value="${jdom.dir}/lib"/>
- <property name="jdom.build.dir" value="${jdom.dir}/build"/>
-
- <!-- Load custom build configuration from JDOM home too. -->
- <property file="${jdom.dir}/build.properties" />
-
- <property name="Name" value="JDOM Contributions"/>
- <property name="name" value="jdom-contrib"/>
- <property name="version" value="1.1.1"/>
- <property name="year" value="2007"/>
-
- <echo message="----------- ${Name} ${version} ------------"/>
-
- <property name="compile.debug" value="true" />
- <property name="compile.optimize" value="true" />
- <property name="compile.target" value="1.2" />
- <property name="compile.source" value="1.2" />
- <property name="compile.deprecation" value="true" />
-
- <property name="src.dir" value="./src/java"/>
- <property name="samples.dir" value="./samples"/>
- <property name="samples.dest" value="./build/samples"/>
- <property name="lib.dir" value="./lib"/>
- <property name="packages" value="org.jdom.*"/>
-
- <property name="build.dir" value="./build"/>
- <property name="build.src" value="./build/src"/>
- <property name="build.dest" value="./build/classes"/>
- <property name="build.javadocs" value="./build/apidocs"/>
-
- <property name="dist.root" value="./dist"/>
- <property name="dist.dir" value="${dist.root}/${name}-${version}"/>
-
- <filter token="year" value="${year}"/>
- <filter token="version" value="${version}"/>
- <filter token="date" value="${TODAY}"/>
- <filter token="log" value="true"/>
- <filter token="verbose" value="true"/>
-
- <!-- Default JAR libraries -->
- <property name="xml-apis.jar" value="${jdom.lib.dir}/xml-apis.jar"/>
- <property name="parser.jar" value="${jdom.lib.dir}/xerces.jar"/>
- <property name="jdom-core.jar" value="${jdom.build.dir}/jdom.jar"/>
- <property name="jdom-contrib" value="${build.dest}"/>
-
- <property name="jakarta-regexp.jar" value="${lib.dir}/jakarta-regexp-1.1.jar"/>
- <property name="iso-relax-api.jar" value="${lib.dir}/isorelax.jar"/>
-
- <!-- Compilation class path -->
- <path id="compile.class.path">
- <pathelement location="${xml-apis.jar}"/>
- <pathelement location="${parser.jar}"/>
- <pathelement location="${jdom-core.jar}"/>
- <pathelement location="${jakarta-regexp.jar}"/>
- <pathelement location="${iso-relax-api.jar}"/>
-
- <!-- We used to include the CLASSPATH environment variable in
- compilation path as it might contain the path to the JDK 1.1
- collections. That's not needed anymore. We'll keep it here
- in case there's a future need to include the CLASSPATH.
- <pathelement path="${java.class.path}" />
- -->
- </path>
-
- <path id="run.class.path">
- <path refid="compile.class.path"/>
- <pathelement location="${jdom-contrib}"/>
- </path>
-
- </target>
-
- <!-- =================================================================== -->
- <!-- Help on usage -->
- <!-- =================================================================== -->
- <target name="usage">
- <echo message=""/>
- <echo message=""/>
- <echo message="JDOM Contributions Build file"/>
- <echo message="-------------------------------------------------------------"/>
- <echo message=""/>
- <echo message=" available targets are:"/>
- <echo message=""/>
- <echo message=" package --> generates the jdom-contrib.jar file (default)"/>
- <echo message=" compile --> compiles the contributed source code"/>
- <echo message=" samples --> compiles the contributed samples"/>
- <echo message=" javadoc --> generates the API documentation (java 1.2 only)"/>
- <echo message=" clean --> restores the distribution to its clean state"/>
- <echo message=""/>
- <echo message=" See the comments inside the build.xml file for more details."/>
- <echo message="-------------------------------------------------------------"/>
- <echo message=""/>
- <echo message=""/>
- </target>
-
- <!-- =================================================================== -->
- <!-- Prepares the build directory -->
- <!-- =================================================================== -->
- <target name="prepare" depends="init">
- <mkdir dir="${build.dir}"/>
- </target>
-
- <!-- =================================================================== -->
- <!-- Prepares the source code -->
- <!-- =================================================================== -->
- <target name="prepare-src" depends="prepare">
- <!-- create directories -->
- <mkdir dir="${build.dest}"/>
-
- <!-- copy src files -->
- <copy todir="${build.src}"
- filtering="yes">
- <fileset dir="${src.dir}"/>
- </copy>
- </target>
-
- <!-- =================================================================== -->
- <!-- Prepares the example code -->
- <!-- =================================================================== -->
- <target name="prepare-samples" depends="prepare">
- <!-- create directories -->
- <mkdir dir="${samples.dest}"/>
-
- <!-- copy src files -->
- <copy todir="${samples.dest}"
- filtering="yes">
- <fileset dir="${samples.dir}"/>
- </copy>
- </target>
-
- <!-- =================================================================== -->
- <!-- Compiles the source directory -->
- <!-- =================================================================== -->
- <target name="compile" depends="prepare-src">
- <!-- Compile the JTree demo only if the Swing classes are found -->
- <available property="swing.present"
- classname="javax.swing.tree.DefaultMutableTreeNode"
- classpathref="compile.class.path" />
-
- <!-- Compile the schema package only if the JARV classes are found -->
- <available property="jarv.present"
- classname="org.iso_relax.verifier.Verifier"
- classpathref="compile.class.path" />
-
- <javac srcdir="${build.src}"
- destdir="${build.dest}"
- debug="${compile.debug}"
- optimize="${compile.optimize}"
- target="${compile.target}"
- source="${compile.source}"
- deprecation="${compile.deprecation}">
- <exclude name="**/*JTree*.java" unless="swing.present" />
- <exclude name="**/schema/*.java" unless="jarv.present" />
-
- <classpath refid="compile.class.path"/>
- </javac>
- </target>
-
- <!-- =================================================================== -->
- <!-- Compiles the samples directory -->
- <!-- =================================================================== -->
- <target name="samples" depends="prepare-samples,compile">
- <javac srcdir="${samples.dest}"
- destdir="${samples.dest}"
- debug="${compile.debug}"
- optimize="${compile.optimize}"
- target="${compile.target}"
- source="${compile.source}"
- deprecation="${compile.deprecation}">
-
- <classpath refid="run.class.path"/>
- </javac>
- </target>
-
- <!-- =================================================================== -->
- <!-- Creates the class package -->
- <!-- =================================================================== -->
- <target name="package" depends="compile">
- <fixcrlf srcdir="." includes="**/*.bat" excludes="build*.*" eol="crlf"/>
- <fixcrlf srcdir="." includes="**/*.sh" excludes="build*.*" eol="lf"/>
- <jar jarfile="${build.dir}/${name}.jar"
- basedir="${build.dest}"
- includes="org/**"/>
- </target>
-
- <!-- =================================================================== -->
- <!-- Creates the API documentation -->
- <!-- =================================================================== -->
- <target name="javadoc" depends="prepare-src">
- <mkdir dir="${build.javadocs}"/>
- <javadoc destdir="${build.javadocs}"
- author="true"
- version="true"
- use="true"
- splitindex="true"
- noindex="false"
- windowtitle="${Name} API"
- doctitle="${Name}"
- bottom="Copyright &#169; ${year} Jason Hunter, Brett McLaughlin. All Rights Reserved.">
-
- <packageset dir="${build.src}">
- <exclude name="**/doc-files" />
- </packageset>
-
- <classpath refid="run.class.path"/>
- </javadoc>
- </target>
-
- <!-- =================================================================== -->
- <!-- Clean targets -->
- <!-- =================================================================== -->
- <target name="clean" depends="init">
- <delete dir="${build.dir}"/>
- <delete file="${docs.dir}/changes.xml"/>
- <delete file="${docs.dir}/todo.xml"/>
- <delete file="${docs.dir}/book.xml"/>
- </target>
-
- <target name="distclean" depends="clean">
- <delete dir="${dist.root}"/>
- <delete file="${Name}-${version}.tar.gz"/>
- <delete file="${Name}-${version}.tar"/>
- <delete file="${Name}-${version}.zip"/>
- </target>
-
-</project>
-
-<!-- End of file -->
View
27 core/build.bat
@@ -1,27 +0,0 @@
-@echo off
-
-echo JDOM Build System
-echo -------------------
-
-if "%JAVA_HOME%" == "" goto error
-
-set LOCALCLASSPATH=%JAVA_HOME%\lib\tools.jar;.\lib\ant.jar;.\lib\xml-apis.jar;.\lib\xerces.jar
-set ANT_HOME=./lib
-
-echo Building with classpath %LOCALCLASSPATH%;%ADDITIONALCLASSPATH%
-
-echo Starting Ant...
-
-"%JAVA_HOME%\bin\java.exe" -Dant.home="%ANT_HOME%" -classpath "%LOCALCLASSPATH%;%ADDITIONALCLASSPATH%" org.apache.tools.ant.Main %1 %2 %3 %4 %5
-
-goto end
-
-:error
-
-echo ERROR: JAVA_HOME not found in your environment.
-echo Please, set the JAVA_HOME variable in your environment to match the
-echo location of the Java Virtual Machine you want to use.
-
-:end
-
-set LOCALCLASSPATH=
View
36 core/build.sh
@@ -1,36 +0,0 @@
-#!/bin/sh
-
-echo
-echo "JDOM Build System"
-echo "-------------------"
-echo
-
-if [ "$JAVA_HOME" = "" ] ; then
- echo "ERROR: JAVA_HOME not found in your environment."
- echo
- echo "Please, set the JAVA_HOME variable in your environment to match the"
- echo "location of the Java Virtual Machine you want to use."
- exit 1
-fi
-
-if [ `uname | grep -n CYGWIN` ]; then
- PS=";"
-elif [ `uname | grep -n Windows` ]; then
- PS=";"
-else
- PS=":"
-fi
-
-LOCALCLASSPATH=${JAVA_HOME}/lib/tools.jar${PS}${JAVA_HOME}/lib/dev.jar${PS}./lib/ant.jar${PS}./lib/xml-apis.jar${PS}./lib/xerces.jar
-ANT_HOME=./lib
-
-echo Building with classpath $LOCALCLASSPATH${PS}$ADDITIONALCLASSPATH
-echo
-
-echo Starting Ant...
-echo
-
-# One person found a seg fault with jdk 1.3.0 on Linux where adding -classic
-# to the following line fixed the issue
-
-$JAVA_HOME/bin/java -Dant.home=$ANT_HOME -classpath $LOCALCLASSPATH${PS}$ADDITIONALCLASSPATH org.apache.tools.ant.Main $*
View
6 test/README.txt
@@ -11,9 +11,3 @@ will be fleshed out and run with the third party JUnit library. Your help in
fleshing out the test cases is most welcome. Send patches to the
jdom-interest list.
-Building instructions
-=====================
-
-Building jdom-test is the same as building jdom. See the README.txt in the
-jdom module.
-
View
26 test/build.bat
@@ -1,26 +0,0 @@
-@echo off
-
-echo Building...
-
-if "%JAVA_HOME%" == "" goto error
-
-set LOCALCLASSPATH=%JAVA_HOME%\lib\tools.jar;..\jdom\lib\ant.jar;..\jdom\lib\xml-apis.jar;..\jdom\lib\xerces.jar;.\lib\optional.jar;.\lib\junit.jar
-set ANT_HOME=..\jdom\lib
-
-echo Building with classpath %LOCALCLASSPATH%;%ADDITIONALCLASSPATH%
-
-echo Starting Ant...
-
-"%JAVA_HOME%\bin\java.exe" -Dant.home="%ANT_HOME%" -classpath "%LOCALCLASSPATH%;%ADDITIONALCLASSPATH%" org.apache.tools.ant.Main %1 %2 %3 %4 %5
-
-goto end
-
-:error
-
-echo ERROR: JAVA_HOME not found in your environment.
-echo Please, set the JAVA_HOME variable in your environment to match the
-echo location of the Java Virtual Machine you want to use.
-
-:end
-
-set LOCALCLASSPATH=
View
33 test/build.sh
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-echo
-echo "Building..."
-echo
-
-if [ "$JAVA_HOME" = "" ] ; then
- echo "ERROR: JAVA_HOME not found in your environment."
- echo
- echo "Please, set the JAVA_HOME variable in your environment to match the"
- echo "location of the Java Virtual Machine you want to use."
- exit 1
-fi
-
-if [ `uname | grep -n CYGWIN` ]; then
- PS=";"
-elif [ `uname | grep -n Windows` ]; then
- PS=";"
-else
- PS=":"
-fi
-
-LOCALCLASSPATH=${JAVA_HOME}/lib/tools.jar${PS}${JAVA_HOME}/lib/dev.jar${PS}../jdom/lib/ant.jar${PS}../jdom/lib/xml-apis.jar${PS}../jdom/lib/xerces.jar${PS}./lib/optional.jar${PS}./lib/junit.jar
-ANT_HOME=../jdom/lib
-
-echo Building with classpath $LOCALCLASSPATH${PS}$ADDITIONALCLASSPATH${PS}$CLASSPATH
-echo
-
-echo Starting Ant...
-echo
-
-$JAVA_HOME/bin/java -Dant.home=$ANT_HOME -classpath $LOCALCLASSPATH${PS}$ADDITIONALCLASSPATH${PS}$CLASSPATH org.apache.tools.ant.Main $*
-
View
303 test/build.xml
@@ -1,303 +0,0 @@
-<!-- ===========================================================================
-
-
-Introduction
-============
-
-See the build targets for the tasks this ant build file supports
-
-
-Installing the build tools
-==========================
-
-For instructions on JDOM use of Ant see the build.xml find in the "jdom"
-module (../jdom).
-
-Build targets
-=============
-
-These are the meaningful targets for this build file:
-
- - package [default] -> creates ./build/jdom-test.jar
- - compile -> compiles the contributed source code
- - javadoc -> generates the API documentation in ./build/javadocs
- - clean -> restores the distribution to its original and clean state
- - test -> runs tests one test class at a time (all test cases starting with
- "Test")
- - testui -> runs JUnit gui and starts automatically with Alltests
- - testreport -> Calls the Ant/Junit task to build javadoc style test output
- after you have run the test task. These aren't automatically done because
- it takes more time and that may not be desired when the tests normally
- succeed.
-
--->
-
-<project default="test" basedir=".">
-
- <!-- =================================================================== -->
- <!-- Initialization target -->
- <!-- =================================================================== -->
- <target name="init">
- <tstamp/>
-
- <!--
- Give user a chance to override without editing this file
- (and without using -D arguments each time they build).
- The build properties a user is likely to override include:
- - jdom.dir The directory where the JDOM distribution is
- installed. Defaults to ../jdom
- - jdom.lib.dir The directory where to look for the default JAR
- files. Defaults to ${jdom.dir}/lib
- - jdom-core.jar The JAR containing the core JDOM API.
- Defaults to ${jdom.lib}/build/jdom.jar
- - xml-apis.jar The JAR containing the DOM, SAX and JAXP classes.
- Defaults to ${jdom.lib.dir}/xml-apis.jar
- - parser.jar The JAR containing the XML parser to use.
- Defaults to ${jdom.lib.dir}/xerces.jar
-
- Note that any build.properties files located in the user home directory
- (${user.home}) and in the JDOM directory (${jdom.dir}) are also taken
- into account. Thus, JAR settings defined in these files do not need to
- be redefined in the local build.properties.
- -->
- <property file="${user.home}/jdom.build.properties" />
- <property file="${basedir}/build.properties" />
-
- <!-- JDOM home & libraries -->
- <property name="jdom.dir" value="../jdom"/>
- <property name="jdom.lib.dir" value="${jdom.dir}/lib"/>
- <property name="jdom.build.dir" value="${jdom.dir}/build"/>
-
- <!-- Load custom build configuration from JDOM home too. -->
- <property file="${jdom.dir}/build.properties" />
-
- <property name="Name" value="JDOM Test"/>
- <property name="name" value="jdom-test"/>
- <property name="version" value="1.1.1"/>
- <property name="year" value="2007"/>
-
- <echo message="----------- ${Name} ${version} ------------"/>
-
- <property name="compile.debug" value="true" />
- <property name="compile.optimize" value="true" />
- <property name="compile.target" value="1.5" />
- <property name="compile.source" value="1.5" />
- <property name="compile.deprecation" value="false" />
-
- <property name="src.dir" value="./src/java"/>
- <property name="lib.dir" value="./lib"/>
- <property name="packages" value="org.jdom.test.*"/>
-
- <property name="build.dir" value="./build"/>
- <property name="build.src" value="./build/src"/>
- <property name="build.dest" value="./build/classes"/>
- <property name="build.javadocs" value="./build/apidocs"/>
-
- <property name="dist.root" value="./dist"/>
- <property name="dist.dir" value="${dist.root}/${name}-${version}"/>
-
- <filter token="year" value="${year}"/>
- <filter token="version" value="${version}"/>
- <filter token="date" value="${TODAY}"/>
- <filter token="log" value="true"/>
- <filter token="verbose" value="true"/>
-
- <!-- Default JAR libraries -->
- <property name="xml-apis.jar" value="${jdom.lib.dir}/xml-apis.jar"/>
- <property name="parser.jar" value="${jdom.lib.dir}/xerces.jar"/>
- <property name="jdom-core.jar" value="${jdom.build.dir}/jdom.jar"/>
- <property name="junit.jar" value="${lib.dir}/junit.jar"/>
-
- <!-- Compilation class path -->
- <path id="compile.class.path">
- <pathelement location="${xml-apis.jar}"/>
- <pathelement location="${parser.jar}"/>
- <pathelement location="${jdom-core.jar}"/>
- <pathelement location="${junit.jar}"/>
-
- <!-- We used to include the CLASSPATH environment variable in
- compilation path as it might contain the path to the JDK 1.1
- collections. That's not needed anymore. We'll keep it here
- in case there's a future need to include the CLASSPATH.
- <pathelement path="${java.class.path}" />
- -->
- </path>
-
- <!-- Tests configuration -->
- <property name="test.jarFile" value="./build/jdom-test.jar"/>
- <property name="test.outputDir" value="./testOutput"/>
- <property name="test.scratchDir" value="./tmp"/>
- <!-- choose between xml and plain text output for tests -->
- <property name="test.outputFormat" value="xml"/>
-
- <!-- Compilation class path -->
- <path id="test.class.path">
- <path refid="compile.class.path"/>
- <pathelement location="${build.dir}/${name}.jar"/>
- </path>
-
- </target>
-
- <!-- =================================================================== -->
- <!-- Help on usage -->
- <!-- =================================================================== -->
- <target name="usage">
- <echo message=""/>
- <echo message=""/>
- <echo message="JDOM Build file"/>
- <echo message="-------------------------------------------------------------"/>
- <echo message=""/>
- <echo message=" available targets are:"/>
- <echo message=""/>
- <echo message=" package --> generates the jdom-test.jar file"/>
- <echo message=" compile --> compiles the contributed source code"/>
- <echo message=" javadoc --> generates the API documentation"/>
- <echo message=" clean --> restores the distribution to its clean state"/>
- <echo message=" test --> runs JUnit tests for all tests in build (default)"/>
- <echo message=" testreport --> build html report from test output"/>
- <echo message=" testui --> runs JUnit tests with Swing UI"/>
- <echo message=""/>
- <echo message=" See the comments inside the build.xml file for more details."/>
- <echo message="-------------------------------------------------------------"/>
- <echo message=""/>
- <echo message=""/>
- </target>
-
- <!-- =================================================================== -->
- <!-- Prepares the build directory -->
- <!-- =================================================================== -->
- <target name="prepare" depends="init">
- <mkdir dir="${build.dir}"/>
- </target>
- <!-- =================================================================== -->
- <!-- Prepares the test output directory -->
- <!-- =================================================================== -->
- <target name="prepare-tests" depends="init">
- <mkdir dir="${test.outputDir}"/>
- <mkdir dir="${test.scratchDir}"/>
- </target>
-
- <!-- =================================================================== -->
- <!-- Prepares the source code -->
- <!-- =================================================================== -->
- <target name="prepare-src" depends="prepare">
- <!-- create directories -->
- <mkdir dir="${build.src}"/>
- <mkdir dir="${build.dest}"/>
-
- <!-- copy src files -->
- <copy toDir="${build.src}" >
- <fileset dir="${src.dir}" includes="**/*.java, **/*.properties" />
- </copy>
-
- </target>
-
- <!-- =================================================================== -->
- <!-- Compiles the source directory -->
- <!-- =================================================================== -->
- <target name="compile" depends="prepare-src">
- <javac srcdir="${build.src}"
- destdir="${build.dest}"
- debug="${compile.debug}"
- optimize="${compile.optimize}"
- target="${compile.target}"
- source="${compile.source}"
- deprecation="${compile.deprecation}">
- <classpath refid="compile.class.path" />
- </javac>
- <copy toDir="${build.dest}" >
- <fileset dir="${build.src}" includes="**/*.properties" />
- </copy>
-
- </target>
-
- <!-- =================================================================== -->
- <!-- Creates the class package -->
- <!-- =================================================================== -->
- <target name="package" depends="compile">
- <fixcrlf srcdir="." includes="**/*.bat" excludes="build*.*" eol="crlf"/>
- <fixcrlf srcdir="." includes="**/*.sh" excludes="build*.*" eol="lf"/>
- <jar jarfile="${build.dir}/${name}.jar"
- basedir="${build.dest}"
- includes="org/**, **/*.properties"/>
- </target>
-
- <!-- =================================================================== -->
- <!-- Creates the API documentation -->
- <!-- =================================================================== -->
- <target name="javadoc" depends="prepare-src">
- <mkdir dir="${build.javadocs}"/>
- <javadoc packagenames="${packages}"
- sourcepath="${build.src}"
- destdir="${build.javadocs}"
- author="true"
- version="true"
- use="true"
- splitindex="true"
- noindex="false"
- windowtitle="${Name} API"
- doctitle="${Name}"
- bottom="Copyright &#169; ${year} Brett McLaughlin, Jason Hunter. All Rights Reserved.">
- <classpath refid="compile.class.path"/>
- </javadoc>
- </target>
-
- <!-- =================================================================== -->
- <!-- Clean targets -->
- <!-- =================================================================== -->
- <target name="clean" depends="init">
- <delete dir="${build.dir}"/>
- <delete dir="${test.outputDir}"/>
- <delete dir="${test.scratchDir}"/>
- </target>
-
- <target name="distclean" depends="clean">
- <delete dir="${dist.root}"/>
- <delete file="${Name}-${version}.tar.gz"/>
- <delete file="${Name}-${version}.tar"/>
- <delete file="${Name}-${version}.zip"/>
- </target>
-
- <target name="test" depends="prepare-tests,package">
- <echo message="Running tests against ${jdom-core.jar} using parser ${parser.jar}"/>
-
- <junit printSummary="yes">
- <classpath refid="test.class.path" />
-
- <formatter type="${test.outputFormat}" />
-
- <batchtest fork="yes" todir="${test.outputDir}">
- <fileset dir="${build.src}">
- <include name="**/*Test*.java" />
- <exclude name="**/generate/**" />
- </fileset>
- </batchtest>
- </junit>
- </target>
-
- <target name="testreport" >
- <!--ugh, a few oddities. Xalan must be in the lib directory and
- there must be an optional.jar there. It won't use variables
- open index.html in the testOutput directory and you do get a
- nice report
- -->
-
- <junitreport todir="./testOutput">
- <fileset dir="./testOutput">
- <include name="TEST-*.xml"/>
- </fileset>
- <report format="frames" todir="./testOutput"/>
- </junitreport>
- </target>
-
-
-
- <target name="testui" depends="prepare-tests,package">
- <java classname="org.jdom.test.cases.Alltests" fork="true">
- <arg value="-ui" />
- <classpath refid="test.class.path" />
- </java>
- </target>
-</project>
-
-<!-- End of file -->

No commit comments for this range

Something went wrong with that request. Please try again.