home *** CD-ROM | disk | FTP | other *** search
- <!--
-
- @(#)build.xml 1.0 03-JUL-04
-
- Copyright (c) 2001-2004 Gaudenz Alder
-
- -->
-
- <!-- ===================== Project Properties =========================== -->
-
- <project name="jgraph" default="all" basedir=".">
-
- <property name="app.name" value="JGraph"/>
- <property name="app.jar" value="jgraph.jar"/>
- <property name="app.version" value="5.2.1"/>
-
- <!-- ===================== Project Environment =========================== -->
-
- <property name="source.home" value="${basedir}/src"/>
- <property name="example.home" value="${basedir}/example"/>
- <property name="example.class" value="org.jgraph.example.Main"/>
-
- <!-- ==================== Compilation Options ==================== -->
-
- <property name="compile.debug" value="false"/>
- <property name="compile.deprecation" value="false"/>
- <property name="compile.optimize" value="true"/>
-
- <!-- ===================== Build Environment =========================== -->
-
- <property name="build.home" value="${basedir}/build"/>
- <property name="dist.home" value="${basedir}/dist-java${java.specification.version}"/>
- <property name="dist.name" value="${ant.project.name}-${app.version}-java${java.specification.version}"/>
- <property name="ant.jar" value="jars/ant.jar"/>
- <property name="xerces.jar" value="jars/xercesImpl.jar"/>
- <property name="xml.jar" value="jars/xml-apis.jar"/>
-
- <!-- ==================== All ==================== -->
-
- <target name="all" depends="dist"
- description="Clean up and produce all distributions"/>
-
- <!-- ==================== Clean ==================== -->
-
- <target name="clean" description="Delete all generated files and directories">
- <delete dir="${build.home}/"/>
- <delete dir="${dist.home}/"/>
- </target>
-
- <!-- ==================== Init ==================== -->
-
- <target name="init" description="Initialize the build Java ${java.specification.version} Build">
- <tstamp/>
- <mkdir dir="${build.home}"/>
- <mkdir dir="${build.home}/classes"/>
- <mkdir dir="${build.home}/doc"/>
- <mkdir dir="${build.home}/doc/api"/>
- <mkdir dir="${build.home}/lib"/>
- </target>
-
- <!-- ==================== Generate ==================== -->
-
- <target name="generate" depends="init" description="Generate the build tree">
- <copy todir="${build.home}/src">
- <fileset dir="${source.home}" includes="**/*.java,**/*.html"/>
- </copy>
-
- <!-- Examples -->
- <copy todir="${build.home}/example">
- <fileset dir="${example.home}" includes="**/*.java,**/*.gif"/>
- </copy>
-
- </target>
-
- <!-- ==================== Compile ==================== -->
-
- <target name="compile" depends="generate" description="Compile the build tree">
-
- <!-- Compile sources -->
- <javac srcdir="${build.home}/src"
- debug="${compile.debug}"
- deprecation="${compile.deprecation}"
- optimize="${compile.optimize}"
- destdir="${build.home}/classes">
- <classpath>
- <pathelement path="${build.home}/classes"/>
- </classpath>
- </javac>
-
- </target>
-
- <!-- ==================== Apidoc ==================== -->
-
- <target name="apidoc" depends="init" description="Generate the api specification (javadoc)">
- <javadoc packagenames="org.jgraph.*"
- sourcepath="${build.home}/src"
- classpath="${build.home}/classes"
- destdir="${build.home}/doc/api"
- use="true"
- author="false"
- version="false"
- windowtitle="${app.name} v${app.version} API Specification"
- doctitle="${app.name} v${app.version} API Specification">
- <header><![CDATA[<p><b>${app.name}</b><br>v${app.version}</p>]]></header>
- <bottom><![CDATA[<font size=1>Copyright (C) 2001-2004 <a href="http://www.jgraph.com/"
- target="_blank">Gaudenz Alder</a>. All rights reserved.</font>]]></bottom>
- <link href="http://java.sun.com/j2se/${java.specification.version}/docs/api"/>
- </javadoc>
- </target>
-
- <!-- ==================== Doc ==================== -->
-
- <target name="doc" depends="apidoc" description="Generate all documentation"/>
-
- <!-- ==================== Jar ==================== -->
-
- <target name="jar" depends="compile, doc" description="Build all Java archives (JARs)">
- <jar jarfile="${build.home}/lib/${app.jar}" basedir="${build.home}/classes"/>
- </target>
-
- <!-- ==================== Build ==================== -->
-
- <target name="build" depends="jar"
- description="Run all tasks to completely populate the build directory"/>
-
- <!-- ==================== Distclean ==================== -->
-
- <target name="distclean" description="Clean up the distribution files only">
- <delete dir="${dist.home}/"/>
- </target>
-
- <!-- ==================== Dist ==================== -->
-
- <target name="dist" depends="build" description="Produce fresh distributions">
- <mkdir dir="${dist.home}"/>
-
- <!-- ==================== Binary Distribution ==================== -->
- <mkdir dir="${dist.home}/${dist.name}"/>
-
- <copy file="${basedir}/ChangeLog" todir="${dist.home}/${dist.name}"/>
- <copy file="${basedir}/LICENSE" todir="${dist.home}/${dist.name}"/>
- <copy file="${basedir}/LICENSE2" todir="${dist.home}/${dist.name}"/>
- <copy file="${basedir}/README" todir="${dist.home}/${dist.name}"/>
- <copy file="${build.home}/lib/${app.jar}" todir="${dist.home}/${dist.name}/lib"/>
-
- <copy todir="${dist.home}/${dist.name}/doc">
- <fileset dir="${build.home}/doc/api" includes="**/*"/>
- </copy>
-
- <mkdir dir="${dist.home}/${dist.name}/example"/>
- <copy todir="${dist.home}/${dist.name}/example">
- <fileset dir="${example.home}" includes="**/*"/>
- </copy>
-
- <!-- Compress -->
- <zip destfile="${dist.home}/${dist.name}.zip"
- basedir="${dist.home}/${dist.name}"
- />
-
- <!-- ==================== Source Distribution ==================== -->
- <!-- Extends binary distribution -->
- <copy todir="${dist.home}/${dist.name}-src">
- <fileset dir="${dist.home}/${dist.name}" includes="**/*"/>
- </copy>
-
- <!-- Add source tree -->
- <copy todir="${dist.home}/${dist.name}-src/src">
- <fileset dir="${build.home}/src" includes="**/*"/>
- </copy>
-
- <!-- Add build file -->
- <copy file="${basedir}/build.xml" todir="${dist.home}/${dist.name}-src"/>
- <copy file="${ant.jar}" todir="${dist.home}/${dist.name}-src/jars"/>
- <copy file="${xerces.jar}" todir="${dist.home}/${dist.name}-src/jars"/>
- <copy file="${xml.jar}" todir="${dist.home}/${dist.name}-src/jars"/>
-
- <!-- Compress -->
- <zip destfile="${dist.home}/${dist.name}-src.zip"
- basedir="${dist.home}/${dist.name}-src"
- />
- </target>
-
- <!-- ==================== Example ==================== -->
-
- <target name="compile-example" depends="compile" description="Compile the main example">
- <mkdir dir="${build.home}/example"/>
-
- <!-- Compile examples -->
- <javac srcdir="${example.home}"
- debug="${compile.debug}"
- deprecation="${compile.deprecation}"
- optimize="${compile.optimize}"
- destdir="${build.home}/example">
- <classpath>
- <pathelement path="${build.home}/classes"/>
- <pathelement path="${build.home}/example"/>
- </classpath>
- </javac>
-
- </target>
-
- <!-- ==================== Test ==================== -->
-
- <target name="example" depends="compile-example" description="Run the main example">
-
- <!-- Run main example -->
- <java fork="true" classname="${example.class}">
- <arg value="test.png"/>
- <classpath>
- <pathelement path="${build.home}/classes"/>
- <pathelement path="${build.home}/example"/>
- </classpath>
- </java>
-
- </target>
-
- </project>
-
-