Skip to content

Commit

Permalink
Added build.xml and related scripts/jar
Browse files Browse the repository at this point in the history
  • Loading branch information
jheer committed Mar 1, 2004
1 parent 3109e86 commit 5a06b38
Show file tree
Hide file tree
Showing 4 changed files with 361 additions and 0 deletions.
22 changes: 22 additions & 0 deletions build.bat
@@ -0,0 +1,22 @@
@echo off
echo building prefuse...

if "%JAVA_HOME%" == "" goto error

set LOCALCLASSPATH=%JAVA_HOME%\lib\tools.jar;.\lib\ant.jar;%CLASSPATH%
set ANT_HOME=./lib

echo ... using classpath %LOCALCLASSPATH%

%JAVA_HOME%\bin\java.exe -Dant.home="%ANT_HOME%" -classpath "%LOCALCLASSPATH%" org.apache.tools.ant.Main %1 %2 %3 %4 %5

goto end

:error
echo "... BUILD FAILED"
echo " The JAVA_HOME environment variable was not found."
echo " Please set the environment variable JAVA_HOME to the location"
echo " of your preferred Java installation."

:end
set LOCALCLASSPATH=
25 changes: 25 additions & 0 deletions build.sh
@@ -0,0 +1,25 @@
#!/bin/sh

# prefuse build script

echo "building prefuse..."


if [ "$JAVA_HOME" = "" ] ; then
echo "... BUILD FAILED"
echo " The JAVA_HOME environment variable was not found."
echo " Please set the environment variable JAVA_HOME to the location"
echo " of your preferred Java installation."
exit 1
fi

LOCALCLASSPATH=$JAVA_HOME/lib/tools.jar:./lib/ant.jar
ANT_HOME=./lib

echo ... using classpath $CLASSPATH:$LOCALCLASSPATH
echo

echo Starting Ant...
echo

$JAVA_HOME/bin/java -Dant.home=$ANT_HOME -classpath $LOCALCLASSPATH:$CLASSPATH org.apache.tools.ant.Main $*
314 changes: 314 additions & 0 deletions build.xml
@@ -0,0 +1,314 @@
<project name="prefuse" default="usage" basedir=".">

<!-- =================================================================== -->
<!-- Initialization target -->
<!-- =================================================================== -->
<target name="init">
<tstamp/>
<property name="Name" value="prefuse"/>
<property name="name" value="prefuse"/>
<property name="version" value="1.0"/>
<property name="year" value="2004"/>

<property name="build.compiler" value="modern"/>
<property name="debug" value="off"/>
<property name="optimize" value="on"/>
<property name="deprecation" value="on"/>
<property name="packages" value="edu.berkeley.guir.*"/>

<!-- Define the source directories -->
<property name="root.dir" value="./"/>
<property name="doc.dir" value="${root.dir}/doc"/>
<property name="lib.dir" value="${root.dir}/lib"/>
<property name="src.dir" value="${root.dir}/src"/>
<property name="ext.dir" value="${root.dir}/extensions"/>
<property name="demos.dir" value="${root.dir}/demos"/>

<!-- Define the source build directories -->
<property name="doc.apidocs" value="${doc.dir}/api"/>
<property name="build.dir" value="${root.dir}/build"/>
<property name="build.lib" value="${root.dir}/build/lib"/>
<property name="build.prefuse.src" value="${root.dir}/build/prefuse/src"/>
<property name="build.prefuse.dest" value="${root.dir}/build/prefuse/classes"/>
<property name="build.ext.src" value="${root.dir}/build/extensions/src"/>
<property name="build.ext.dest" value="${root.dir}/build/extensions/classes"/>
<property name="build.demos.src" value="${root.dir}/build/demos/src"/>
<property name="build.demos.dest" value="${root.dir}/build/demos/classes"/>

<!-- Define the distribution directories -->
<property name="dist.root" value="${root.dir}/dist"/>
<property name="sourcedist.dir" value="${dist.root}/${name}-${version}/${name}-${version}"/>
<property name="compiledist.dir" value="${dist.root}/${name}-${version}-compiled/${name}-${version}"/>
</target>

<!-- =================================================================== -->
<!-- Help on usage -->
<!-- =================================================================== -->
<target name="usage">
<echo message=""/>
<echo message=""/>
<echo message="prefuse build control"/>
<echo message="-------------------------------------------------------------"/>
<echo message=""/>
<echo message=" available targets are:"/>
<echo message=""/>
<echo message=" all --> builds all the jars in ./build"/>
<echo message=" prefuse --> builds the prefuse.jar file in ./build"/>
<echo message=" extensions --> builds the prefusex.jar file in ./build"/>
<echo message=" demos --> builds the demos.jar file in ./build"/>
<echo message=" compiledist--> creates the compiled distribution in ./dist"/>
<echo message=" sourcedist --> creates the source distribution in ./dist"/>
<echo message=" api --> generates prefuse API docs in ./doc/api"/>
<echo message=" clean --> restores distribution to original state"/>
<echo message=" usage --> (default) displays build menu"/>
<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}"/>
<mkdir dir="${build.lib}"/>

<copy todir="${build.lib}">
<fileset dir="${lib.dir}"/>
</copy>

</target>

<!-- =================================================================== -->
<!-- Prepares the prefuse source code -->
<!-- =================================================================== -->
<target name="prepare-prefuse" depends="prepare">
<mkdir dir="${build.prefuse.src}"/>
<mkdir dir="${build.prefuse.dest}"/>

<copy todir="${build.prefuse.src}">
<fileset dir="${src.dir}"/>
</copy>

</target>

<!-- =================================================================== -->
<!-- Prepares the extensions code -->
<!-- =================================================================== -->
<target name="prepare-ext" depends="prepare">
<mkdir dir="${build.ext.src}"/>
<mkdir dir="${build.ext.dest}"/>

<copy todir="${build.ext.src}">
<fileset dir="${ext.dir}"/>
</copy>

</target>

<!-- =================================================================== -->
<!-- Prepares the examples code -->
<!-- =================================================================== -->
<target name="prepare-demos" depends="prepare">
<mkdir dir="${build.demos.src}"/>
<mkdir dir="${build.demos.dest}"/>

<copy todir="${build.demos.src}">
<fileset dir="${demos.dir}"/>
</copy>

</target>


<!-- =================================================================== -->
<!-- Compiles the prefuse source code -->
<!-- =================================================================== -->
<target name="compile-prefuse" depends="prepare-prefuse">
<!-- copy resource files -->
<copy todir="${build.prefuse.dest}">
<fileset dir="${build.prefuse.src}" excludes="**/*.java"/>
</copy>

<javac srcdir="${build.prefuse.src}"
destdir="${build.prefuse.dest}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"/>
</target>

<!-- =================================================================== -->
<!-- Compiles the extensions directory -->
<!-- =================================================================== -->
<target name="compile-ext" depends="prepare-ext, prefuse">
<!-- copy resource files -->
<copy todir="${build.ext.dest}">
<fileset dir="${build.ext.src}" excludes="**/*.java"/>
</copy>

<javac srcdir="${build.ext.src}"
destdir="${build.ext.dest}"
classpath="${build.dir}/${name}.jar"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"/>
</target>

<!-- =================================================================== -->
<!-- Compiles the demos directory -->
<!-- =================================================================== -->
<target name="compile-demos" depends="prepare-demos, ext">
<!-- copy resource files -->
<copy todir="${build.demos.dest}">
<fileset dir="${build.demos.src}" excludes="**/*.java"/>
</copy>

<javac srcdir="${build.demos.src}"
destdir="${build.demos.dest}"
classpath="${build.dir}/${name}x.jar;${build.dir}/${name}.jar"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"/>
</target>

<!-- =================================================================== -->
<!-- Creates the prefuse.jar in ./build -->
<!-- =================================================================== -->
<target name="prefuse" depends="compile-prefuse">
<jar jarfile="${build.dir}/${name}.jar"
basedir="${build.prefuse.dest}"
includes="**"/>
</target>

<!-- =================================================================== -->
<!-- Creates the prefuse.jar in ./build -->
<!-- =================================================================== -->
<target name="ext" depends="compile-ext">
<jar jarfile="${build.dir}/${name}x.jar"
basedir="${build.ext.dest}"
includes="**"/>
</target>

<!-- =================================================================== -->
<!-- Creates the examples.jar in ./build -->
<!-- =================================================================== -->
<target name="demos" depends="compile-demos">
<jar jarfile="${build.dir}/demos.jar"
basedir="${build.demos.dest}"
includes="**"/>
</target>

<!-- =================================================================== -->
<!-- Build all jars in ./build -->
<!-- =================================================================== -->
<target name="all" depends="prefuse, ext, demos"/>

<!-- =================================================================== -->
<!-- Creates the API documentation in ./doc/api/ -->
<!-- =================================================================== -->
<target name="api" depends="prepare-prefuse, prepare-ext">
<mkdir dir="${doc.apidocs}"/>
<javadoc packagenames="${packages}"
sourcepath="${build.prefuse.src};${build.ext.src}"
destdir="${doc.apidocs}"
author="true"
version="true"
use="true"
breakiterator="yes"
splitindex="true"
noindex="false"
windowtitle="${Name} API Documentation"
doctitle="${Name}"
overview="${build.prefuse.src}/edu/berkeley/guir/prefuse/overview.html"
bottom="Copyright &#169; ${year} by University of California, Berkeley."
/>
</target>

<!-- =================================================================== -->
<!-- Replace all sequences of 4 spaces in .java files with a tab -->
<!-- =================================================================== -->
<target name="addTabsWithLength4" depends="init">
<fixcrlf
srcdir="${root.dir}"
tab="add"
tablength="4"
includes="**/*.java"/>
</target>

<!-- =================================================================== -->
<!-- Replace all tabs in .java files with a sequence of 4 spaces -->
<!-- =================================================================== -->
<target name="removeTabsWithLength4" depends="init">
<fixcrlf
srcdir="${root.dir}"
tab="remove"
tablength="4"
includes="**/*.java"/>
</target>

<!-- =================================================================== -->
<!-- Build source distribution in ./dist -->
<!-- =================================================================== -->
<target name="sourcedist" depends="clean">
<mkdir dir="${dist.root}"/>
<mkdir dir="${sourcedist.dir}"/>

<copy todir="${sourcedist.dir}">
<fileset dir="${root.dir}"/>
</copy>

<!-- Now delete what we dont want, probably a better way to do this -->
<delete dir="${sourcedist.dir}/dist"/>

<fixcrlf srcdir="${sourcedist.dir}"
eol="lf" eof="remove"
includes="**/*.sh"
/>
<zip zipfile="${dist.root}/${name}-${version}.zip"
basedir="${dist.root}/${name}-${version}"
whenempty="create"
/>

</target>


<!-- =================================================================== -->
<!-- Build compiled distribution in ./dist -->
<!-- =================================================================== -->
<target name="compiledist" depends="clean, all, api">
<mkdir dir="${dist.root}"/>
<mkdir dir="${compiledist.dir}"/>

<copy todir="${compiledist.dir}">
<fileset dir="${root.dir}"/>
</copy>

<!-- Now delete what we dont want, probably a better way to do this -->
<delete dir="${compiledist.dir}/dist"/>
<delete dir="${compiledist.dir}/build/demos"/>
<delete dir="${compiledist.dir}/build/prefuse"/>
<delete dir="${compiledist.dir}/build/extentions"/>

<fixcrlf srcdir="${compiledist.dir}"
eol="lf" eof="remove"
includes="**/*.sh"
/>

<zip zipfile="${dist.root}/${name}-${version}-compiled.zip"
basedir="${dist.root}/${name}-${version}-compiled"
whenempty="create"
/>

</target>

<!-- =================================================================== -->
<!-- Clean restores the distribution to original state -->
<!-- =================================================================== -->
<target name="clean" depends="init">
<delete dir="${build.dir}"/>
<delete dir="${dist.root}"/>
<delete dir="${doc.apidocs}"/>
</target>
</project>

<!-- End of file -->
Binary file added lib/ant.jar
Binary file not shown.

0 comments on commit 5a06b38

Please sign in to comment.