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 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330
|
<!--
ANT build script (ANT is a Java & XML based cross-platform build tool
and available at http://jakarta.apache.org/ant/).
author: whoschek@lbl.gov
See the target "usage" further below for instructions on how to build the software.
-->
<!-- ================================================================= -->
<!-- NOTE: all directories are relative to colt/ -->
<!-- ================================================================= -->
<project name="colt" default="help" basedir="." >
<!-- Read system environment vars into properties prefixed with "env". -->
<property environment="env"/>
<property name="version" value="1.2.0"/>
<property name="dist.download.dir" value="${user.home}/unix/www/${ant.project.name}-download"/>
<!-- <property name="dist.download.dir" value="${user.home}/www/colt-download"/> -->
<!-- <property name="dist.download.dir" value="${user.home}/backups/colt-download"/> -->
<property name="dist.website" value="${user.home}/unix/www/${ant.project.name}"/>
<!-- <property name="dist.website" value="${user.home}/www/colt"/> -->
<!-- <property name="dist.website" value="/tmp/colt-www"/> -->
<property name="proj.title" value="Colt"/>
<!-- The directory where *.java files are stored. -->
<property name="javac.src" value="src"/>
<!-- Destination for *.class files -->
<property name="javac.dest" value="build/classes"/>
<!-- Source directory for xml docs -->
<property name="xdocs.src" value="xdocs"/>
<!-- Destination for documentation files -->
<property name="doc.dest" value="doc"/>
<!-- Destination for javadoc generated files -->
<property name="javadoc.dest" value="${doc.dest}/api"/>
<!-- Location of jar files -->
<property name="jar.dir" value="lib"/>
<!-- The jar file that the jar task will generate -->
<property name="jar.filename" value="${ant.project.name}.jar"/>
<!-- Directory for temporary files. -->
<property name="dist.tmp" value="${java.io.tmpdir}/${ant.project.name}-tmp"/>
<!-- file patterns to be excluded from tar in dist targets -->
<property name="tar.excludes" value="**/CVS **/.* **/*~ **/*.bak **/*.BAK **/*.jpage"/>
<!-- Construct classpath for compilation-->
<path id="javac.classpath">
<fileset dir="${jar.dir}">
<include name="*.jar"/>
<exclude name="${jar.filename}"/>
</fileset>
<fileset dir="/usr/share/java">
<include name="concurrent.jar"/>
</fileset>
<!-- <pathelement location="${build.home}/classes"/> -->
</path>
<!-- The base directory relative to which most targets are built (not needed actually)-->
<!-- <property name="base" value="."/> -->
<!-- ================================================================= -->
<!-- Default target -->
<!-- ================================================================= -->
<target name="help">
<echo>
First cd into the dir this build file is placed in:
cd colt
Then type one of the following to build the software:
ant -help - Print help on general ant usage
ant help - Print this help text
ant build - Compile, generate jars, [javadoc]
ant doc - Generate documentation
ant dist - Build and generate distribution downloads
Further individual targets used internally by above targets:
javac - Compile all *.java files into .class files
javadoc - Generate javadoc files from *.java
jar - Generate jar file(s) from .class files
style - Generate website into doc/ directory
</echo>
</target>
<!-- ================================================================= -->
<!-- Initialize variables -->
<!-- NOTE: all directories are relative to colt/ -->
<!-- ================================================================= -->
<target name="init">
<tstamp />
</target>
<!-- ================================================================= -->
<!-- Remove all generated (compiled) class files. -->
<!-- ================================================================= -->
<target name="clean">
<!-- <delete dir="${javac.dest}" /> -->
</target>
<!-- ================================================================= -->
<!-- Clean all in preparation for a complete distribution. -->
<!-- ================================================================= -->
<target name="cleanall">
<delete verbose="true">
<fileset dir=".">
<patternset>
<include name="**/*.bak"/>
<include name="**/*.BAK"/>
<include name="**/*~"/>
</patternset>
</fileset>
</delete>
<delete dir="build" />
<delete dir="${dist.tmp}" />
</target>
<!-- ================================================================= -->
<!-- Build the software (without generating a distribution) -->
<!-- ================================================================= -->
<target name="build" depends="javac, jar">
</target>
<!-- ================================================================= -->
<!-- Compile all *.java files -->
<!-- ================================================================= -->
<target name="javac" depends="clean">
<mkdir dir="${javac.dest}" />
<javac srcdir="${javac.src}" destdir="${javac.dest}"
includes="**/*.java"
excludes="misc/*, **/UnitTest*.java"
deprecation="on"
debug="off">
<classpath refid="javac.classpath"/>
</javac>
</target>
<!-- ================================================================= -->
<!-- Generate jar file(s) from *.class files -->
<!-- ================================================================= -->
<target name="jar">
<delete file="${jar.dir}/${jar.filename}" />
<jar jarfile="${jar.dir}/${jar.filename}" basedir="${javac.dest}"
excludes="**/*UnitTest.class"
index="yes"
compress="yes"
/>
</target>
<!-- ================================================================= -->
<!-- Generate javadoc files from *.java files -->
<!-- ================================================================= -->
<target name="javadoc" unless="env.NO_JAVADOC">
<delete dir="${javadoc.dest}" />
<mkdir dir="${javadoc.dest}" />
<javadoc sourcepath="${javac.src}" destdir="${javadoc.dest}"
public="true"
author="false"
use="true"
splitIndex="true"
version="true"
doctitle="<h2>${proj.title}</h2><h4>Open Source Libraries for High Performance Scientific and Technical Computing in Java</h4><hr>"
windowtitle="${proj.title} ${version} - API Specification"
header="<b>${proj.title} ${version}</b>"
bottom="<font size=-1 >Jump to the <a target=_top href=http://dsd.lbl.gov/~hoschek/colt >${proj.title} Homepage</a>">
<packageset dir="${javac.src}"
excludes="gov/lbl/dsd/colt/trash/ gov/lbl/dsd/p2pio/jaxb/"
/>
<link href="http://java.sun.com/j2se/1.4/docs/api/"/>
<link href="http://dsd.lbl.gov/~hoschek/javatree/share/misc/concurrent-1.3.4/doc/"/>
<classpath refid="javac.classpath"/>
</javadoc>
</target>
<!-- ================================================================= -->
<!-- Build the documentation files using XSLT -->
<!-- derived from http://jakarta.apache.org/site/jakarta-site2.html -->
<!-- ================================================================= -->
<target name="style">
<!-- copy images, stylesheets, etc to documentation output dir -->
<copy todir="${doc.dest}">
<fileset dir="${xdocs.src}"
includes="**"
excludes="*.xml, *.xsl"/>
</copy>
<!-- replace lastUpdated tag on web site with current date -->
<tstamp>
<format property="dateformat" pattern="MMM d, yyyy"/>
</tstamp>
<replaceregexp file="${xdocs.src}/navigation.xml"
match="lastPublished=".*?""
replace="lastPublished="${dateformat}""
/>
<!-- replace version tag on web site navigation bar with current version -->
<replaceregexp file="${xdocs.src}/navigation.xml"
match="currentVersion=".*?""
replace="currentVersion="${version}""
/>
<!-- now generate documentation from xdocs via XSLT -->
<style basedir="${xdocs.src}"
destdir="${doc.dest}"
extension=".html"
style="${xdocs.src}/style.xsl"
force="true"
excludes="navigation.xml"
includes="*.xml">
<outputproperty name="doctype-public" value="-//W3C//DTD HTML 4.01 Transitional//EN"/>
<outputproperty name="doctype-system" value="http://www.w3.org/TR/html4/loose.dtd"/>
</style>
</target>
<!-- ================================================================= -->
<!-- Generate documentation -->
<!-- ================================================================= -->
<target name="doc" depends="style, javadoc, fixcrlf">
</target>
<!-- ================================================================= -->
<!-- Generate distribution downloads and copy to life website -->
<!-- ================================================================= -->
<target name="dist" depends="dist-web, dist-release">
<!--
scp -r ~/unix/www/colt doggy.lbl.gov:www/
scp ~/unix/www/colt-download/releases/* doggy.lbl.gov:www/colt-download/releases/
-->
</target>
<!-- ================================================================= -->
<!-- Copy documentation to life website -->
<!-- ================================================================= -->
<target name="dist-web" depends="doc">
<!-- <delete dir="${dist.website}" /> -->
<mkdir dir="${dist.website}" />
<copy todir="${dist.website}">
<fileset dir="${doc.dest}"/>
</copy>
</target>
<!-- ================================================================= -->
<!-- Build a complete distribution. Results go to ${dist.download.dir} -->
<!-- ================================================================= -->
<target name="dist-release" depends="build, doc, cleanall">
<!--<delete dir="${dist.tmp}" />-->
<mkdir dir="${dist.tmp}" />
<tstamp>
<format property="dateformat" pattern="yyyy-MM-dd"/>
</tstamp>
<!-- ============================================================= -->
<!-- Generate colt.tar.gz -->
<basename property="proj.basename" file="."/>
<tar tarfile="${dist.tmp}/${ant.project.name}-${version}.tar.gz"
basedir=".." includes="${proj.basename}/" excludes="${tar.excludes}"
compression="gzip" longfile="gnu"
/>
<!-- ============================================================= -->
<!-- Generate colt.zip -->
<zip zipfile="${dist.tmp}/${ant.project.name}-${version}.zip"
basedir=".." includes="${proj.basename}/" excludes="${tar.excludes}"
/>
<!-- ============================================================= -->
<mkdir dir="${dist.download.dir}/releases" />
<move todir="${dist.download.dir}/releases">
<fileset dir="${dist.tmp}"> <include name="*"/> </fileset>
</move>
<delete dir="${dist.tmp}" />
</target>
<!-- ================================================================= -->
<!-- Fix carriage return / linefeed for unix and windows. -->
<!-- ================================================================= -->
<target name="fixcrlf">
<!--
<fixcrlf srcdir="bin" eol="lf" includes="*" excludes="*.bat" />
<fixcrlf srcdir="bin" eol="crlf" includes="*.bat" />
<chmod dir="bin" perm="+x" includes="*" excludes="*.bat" />
-->
</target>
</project>
|