Compilation
From SharemailWiki
For compilation you will need
- The latest source distribution of the DRRE from SourceForge
- All the dependencies (available in the with-deps release) from SourceForge
- Java version 6 JDK (you may succeed with earlier versions, but you may also need to rebuild dependencies) from Sun Microsystems
- Apache Ant from Apache Foundation
- An ant build file, called build.xml with content such as this:
<project name="drre" default="dist" basedir="."\>
<description>
simple build file for data rules and routing engine
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="lib" location="lib"/>
<!-- Setup a useful classpath -->
<path id="useful.jars">
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="init">
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" classpathref="useful.jars"/>
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the drre.jar file -->
<jar jarfile="${dist}/lib/drre.jar" basedir="${build}"/>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>
You can also compile using an IDE, but will need to import the source and setup your project as appropriate.
The following compilation steps work on Linux, they will need modification to work on other systems.
- Create a build directory, with four sub directories:
- src - containing the source code
- lib - containing the binary dependencies
- dist
- build
- Save the build.xml file into the root of te build directory
- Ensure that ant (from the bin directory of the ant distribution) is in your path (e.g.
export PATH=$PATH:/home/downloads/apache-ant-1.7.1/bin/ - Ensure that the JAVA_HOME environment variable is set to the root of your Java JDK (e.g.
export JAVA_HOME=/usr/local/java/jdk1.6.0_17 - Run
ant distall the classes will be compiled and packaged into a drre.jar file in the dist/lib directory.
