1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
|
<!--
@(#)build.xml 1.0 03-JUL-04
Copyright (c) 2001-2008 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.12.4.2"/>
<property name="longversion" value="5.12.4.2"/>
<!-- ===================== Project Environment =========================== -->
<property name="source.home" value="${basedir}/src"/>
<property name="example.home" value="${basedir}/examples"/>
<property name="example.class" value="com.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"/>
<property name="dist.name" value="${ant.project.name}-${app.version}"/>
<!-- ==================== 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}/examples">
<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)">
<copy todir="${build.home}/doc">
<fileset dir="${basedir}/doc" includes="**/*"/>
</copy>
<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-2008 <a href="http://www.jgraph.com/"
target="_blank">Gaudenz Alder</a>. All rights reserved.</font>]]></bottom>
</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}/README" todir="${dist.home}/${dist.name}"/>
<copy file="${basedir}/WHATSNEW" 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" includes="**/*"/>
</copy>
<mkdir dir="${dist.home}/${dist.name}/examples"/>
<copy todir="${dist.home}/${dist.name}/examples">
<fileset dir="${example.home}" includes="**/org/**/*.gif,**/org/**/*.java,**/com/**/*.gif,**/com/**/*.java"/>
</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"/>
</target>
<!-- ==================== Example ==================== -->
<target name="compile-example" depends="compile" description="Compile the main example">
<mkdir dir="${build.home}/examples"/>
<!-- Compile examples -->
<javac srcdir="${example.home}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}"
destdir="${build.home}/examples">
<classpath>
<pathelement path="${build.home}/classes"/>
<pathelement path="${build.home}/examples"/>
</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}/examples"/>
</classpath>
</java>
</target>
</project>
|