I have attached the build file I've been using for OpenJUMP and OpenJUMP-Ex.
I hope that other developers will find it useful. It's basically the same as
the build file in the CVS, excpet that it has some more comments and I've
removed the targets that deal with the CVS repository.

The build file is really meant for someone that is going to try and build
OpenJUMP on their own computer for the first time.

I hope to get some documentation or a video that explains how to use the
build file in Eclipse or Netbeans, but I'm not going to make any promises on
when this might happen. :] I also need to figure out why the Javadoc task
isn't working.

Please let me know if you have comments or suggestion on the build file. I'd
be happy to consider and incorporate these. I hope to put the build file on
the SurveyOS SourceForge web site when I get home tonight.

The Sunburned Surveyor
<?xml version="1.0"?>
<!-- This is the OpenJUMP-Ex build file for Apache's Ant. It is based on
 the OpenJUMP build file, but doesn't contain the targets and tasks that
 deal with updating the CVS repository. -->

<!-- Note: This build file contains a target to generate Javadoc from OpenJUMP's
source code. However, this target does not appear to work in Eclipse. It hasn't been
tested in Netbeans yet. [The Sunburned Surveyor 2007-04-16] -->

<!-- The default target for this build file is the "prepare" target. The base directory
is set to the directory that contains this build file. You may have to change this
depending on how your source code and IDE project for OpenJUMP is structured. 
[The Sunburned Surveyor 2006-10-10] -->
<project name="openjump" default="prepare" basedir=".">
	<!-- Property Declarations [The Sunburned Surveyor 2006-10-10] -->
    
	<!-- Name Properties [The Sunburned Surveyor 2006-10-10] -->
	<property name="name" value="openjump-ex"/>
    <property name="Name" value="OpenJUMP-Ex"/>
	
	<!-- The version number and date information for this build. 
	[The Sunburned Surveyor 2006-10-10] -->
    <property name="version" value="00.00.01"/>
	<property name="day" value="Monday"/>
	    
	<!-- Properties to control compilation. [The Sunburned Surveyor 2006-10-10] -->
	
	<!-- The recommended setting for debug is "on", so that line numbers are 
	included in stack traces. [Jon Aquino 2005-04-06] -->
    <property name="debug" value="on"/>
    <property name="deprecation" value="off"/>
    <property name="optimize" value="off"/>
	
	<!-- Properties that store directories managed as part of the
	build process. [The Sunburned Surveyor 2006-10-10] -->
	
	<!-- Definition of the directories that are created and/or manipulated
	during the build process. In the "default" version of this build file 
	most of these directories are subdirectories of the "build" directory, 
	and this build file is stored in the "build" directory.  You can change
	the value's of these properties to match your own directory structure for
	building OpenJUMP. For example, if you keep the JAR files on which OpenJUMP is
	dependent in the /java/share/jars/openjump directory, you would change the value
	of the "libraries directory" property to "/java/share/jars/openjump" instead
	of "${build directory}/lib/". [The Sunburned Surveyor 2006-10-10] -->
	<property name="build directory" value="../build"/>
	<property name="source directory" value=".."/>
	<property name="classes directory" value="${build directory}/classes"/>
	<property name="libraries directory" value="${build directory}/lib/"/>
	<property name="distro directory" value="${build directory}/distro"/>
	<property name="jars directory" value="${distro directory}/executables/jar"/>
	<property name="gathered source directory" value="${distro directory}/source"/>
	<property name="docs directory" value="${distro directory}/docs"/>
	<property name="javadoc directory" value="${docs directory}/javadoc"/>
	
	<!-- Definition of the Workbench JAR file property. This will
	be the name of the JAR file for the JUMP workbench. 
	[The Sunburned Surveyor 2007-01-10] -->
	<property name="workbench jar" value="${jars directory}/${name}-workbench-${version}.jar"/>
	
	<!-- Definition of the API JAR file property. [The Sunburned Surveyor 2007-01-11] -->
	<property name="api jar" value="${jars directory}/${name}-api-${version}.jar"/>

	<!-- Definition of the date and time properties. -->
	<property name="date" value=""/>
	
	<!-- Definition of the directory that contains the Jar files
	needed to build OpenJUMP. [The Sunburned Surveyor 2007-01-10] -->
	<path id="basic classpath">
		<fileset dir="${libraries directory}">
			<include name="**/*.jar"/>
		</fileset>
	</path>
	
	<!-- Definition of the resource selector. This selector selects all files that
	need to be included in OpenJUMP's workbench JAR file that are not class files.
	[The Sunburned Surveyor 2007-01-10] -->
	<selector id="resource selector">
		<and>
			<or>
				<filename name="**/*.properties" casesensitive="no"/>
				<filename name="**/*.png" casesensitive="no"/>
				<filename name="**/*.gif" casesensitive="no"/>
				<filename name="**/*.java2xml" casesensitive="no"/>
				<filename name="**/*.html" casesensitive="no"/>
				<filename name="**/*.xml" casesensitive="no"/>
				<filename name="**/*.txt" casesensitive="no"/>
				<filename name="**/*.jpg" casesensitive="no"/>
				<filename name="**/*.xsl" casesensitive="no"/>
			</or>
	
			<not>
				<filename name="**/overview.html" casesensitive="no"/>
			</not>
	
			<not>
				<filename name="**/package.html" casesensitive="no"/>
			</not>
		</and>
	</selector>
	
	<!-- Definition of the workbench jar selector. This selector selects all of
	the class files that need to go into the workbench JAR file. The other class files
	are put into the api JAR file. [The Sunburned Surveyor 2007-01-10] -->
	<selector id="workbench jar selector">
			<and>
				<or>
					<filename name="**/*.class" casesensitive="no"/>
					<selector refid="resource selector"/>
				</or>
	
				<or>
					<filename name="com/vividsolutions/jump/workbench/**" casesensitive="no"/>
					<filename name="com/vividsolutions/jump/demo/**" casesensitive="no"/>
					<filename name="language/**" casesensitive="no"/>
					<filename name="versiondoc/**" casesensitive="no"/>
				</or>
			</and>
	</selector>
	
	<!-- Definition of the API JAR file selector. This selector selects all
	java class files that do not belong in the OpenJUMP Workbench JAR file.
	[The Sunburned Surveyor 2007-01-11] -->
	<selector id="api jar selector">
		<and>
			<or>
				<filename name="**/*.class" casesensitive="no"/>
				<selector refid="resource selector"/>
			</or>
			<or>
				<filename name="com/**" casesensitive="no"/>
				<filename name="org/**" casesensitive="no"/>
				<filename name="de/**" casesensitive="no"/>                        	
			</or>
			<not>
				<or>
					<filename name="com/vividsolutions/jump/workbench/**" casesensitive="no"/>
					<filename name="com/vividsolutions/jump/demo/**" casesensitive="no"/>
				</or>
			</not>
		</and>
	 </selector>
	
	<!-- Definition of the Gathered Source Selector. This selector selects all of the 
	Java files and any "resource" files in the source code directory. -->
	<selector id="gathered source selector">
		<and>
			<or>
				<filename name="**/*.java" casesensitive="no"/>
				<selector refid="resource selector"/>
			</or>
			<or>
				<filename name="com/**" casesensitive="no"/>
				<filename name="org/**" casesensitive="no"/>
				<filename name="de/**" casesensitive="no"/>
				<filename name="language/**" casesensitive="no"/>
				<filename name="versiondoc/**" casesensitive="no"/>
			</or>
		</and>
	</selector>
	
	<!-- Definition of the "prepare" target. This is the default target of the 
	build file. It creates any missing directories in the "build" directory tree. -->
	<target name="prepare">
		<mkdir dir="${distro directory}"/>
		<mkdir dir="${distro directory}/source"/>
		<mkdir dir="${docs directory}"/>
		<mkdir dir="${javadoc directory}"/>
		<mkdir dir="${classes directory}"/>
		<mkdir dir="${jars directory}"/>
		<tstamp/>
	</target>
	
	<!-- Definition of the compile target. This target compiles the source code into
	executable code. --> 
	<target name="compile" depends="prepare">
	        <!-- Execute the "javac" task with properties defined previously in the
	        build script.  The Sunburned Surveyor 2006-10-25] -->
	        <javac srcdir="${source directory}" destdir="${classes directory}" debug="${debug}" deprecation="${deprecation}" optimize="${optimize}">
	        	<classpath refid="basic classpath"/>
	        </javac>
	</target>
	
	<!-- Definition of the copy for JAR target. This target copys files that need
	to be included in the JAR files to the appropriate directory. In the default version'
	of this build file this is the directory that contains the class files created in 
	the compile target. -->
	<target name="copy for JAR" depends="prepare">
		<copy todir="${classes directory}">
			<fileset dir="${source directory}">
				<exclude name="**/*.java"/>
				<exclude name="**/*.class"/>
			</fileset>
		</copy>
		<!-- We need to delete the "{classes directory}/build" folder
		that was just created in the copy task. We have to do this because
		Ant doesn't have a way to exclude subdirectoreis from the Copy Task.
		[2007-02-07 The Sunburned Surveyor] -->
		<delete dir="${classes directory}/build"/>
	</target>

	<!-- Definition of the jar target. This target packages the source code
	and other required files into the workbench and api Jar files for OpenJUMP. -->
	<target name="jar" depends="copy for JAR, compile">
	
		<!-- This echo task creates a text file with information about the
		build of OpenJUMP that is being packaged in the JAR files. -->
		<echo file="${build directory}/build_info.txt">
		${Name} Version: ${version}
		Build-Date: ${TODAY}
		Build-Time: ${TSTAMP}
		Build-Day: ${day}
		Description: This is a test build.
		</echo>
	
		<jar jarfile="${workbench jar}">
			<fileset dir="${classes directory}">
				<selector refid="workbench jar selector"/>
			</fileset>
		</jar>

		<jar jarfile="${api jar}">
			<fileset dir="${classes directory}">
				<selector refid="api jar selector"/>
			</fileset>
		</jar>
	</target>
	
	<!-- Definition of the javadoc target. This target creates the Javadoc or API
	documentation for OpenJUMP's source code. Note that this target does not work
	properly in Eclipse. -->
	<target name="javadoc">
		<javadoc destdir="${javadoc directory}" useexternalfile="true">
			<classpath refid="basic classpath"/>
			<fileset dir="${source directory}">
				<include name="com/**/*.java"/>
				<include name="com/**/*.html"/>
				<include name="org/**/*.java"/>
				<include name="org/**/*.html"/>
				<include name="de/**/*.java"/>
				<include name="de/**/*.html"/>
			</fileset>
		</javadoc>
	</target>
	
	<!-- This target gathers all of the *.java files in the source code
	directory and compresses them into a single zip file named source.zip.
	This file is stored in the gathered source directory. [The Sunburned
	Surveyor 2007-01-29] -->
	<target name="gather source">
		<zip destfile="${gathered source directory}/source.zip">
			<fileset dir="${source directory}">
				<selector refid="gathered source selector"/>
			</fileset>
		</zip>
	</target>
	
</project>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to