1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <project name="java_memcached" default="package" basedir=".">
4 <property name="project.title" value="java memcached client" />
5 <property name="code.dir" value="src/com/danga/MemCached" />
6 <property name="doc.dir" value="doc" />
7 <property name="src.dir" value="src" />
8 <property name="build.dir" value="classes" />
10 <property environment="env"/>
11 <property file="build.properties"/>
12 <property name="project" value="java_memcached"/>
14 <path id="project.class.path">
15 <pathelement path = "lib/log4j.jar"/>
18 <!-- package release -->
19 <!-- ant package -Dver=release_1.3 -Dlog4j=1 -->
20 <target name="package" depends="clean, setup, log4j, logger, pkg-compile, jar, javadoc">
21 <tar tarfile="java_memcached-${ver}.tar.gz" basedir="." includes="java_memcached-${ver}/**" compression="gzip"/>
22 <zip destfile="java_memcached-${ver}.zip" basedir="." includes="java_memcached-${ver}/**"/>
23 <copy file="java_memcached-${ver}/java_memcached-${ver}.jar" todir="."/>
25 <checksum file="java_memcached-${ver}.tar.gz"/>
26 <checksum file="java_memcached-${ver}.zip"/>
27 <checksum file="java_memcached-${ver}.jar"/>
28 <delete dir="java_memcached-${ver}" />
30 <tar tarfile="java_memcached-${ver}.tar" basedir="." includes="java_memcached-${ver}.*"/>
34 <delete dir="${build.dir}"/>
35 <delete dir="java_memcached-${ver}" />
36 <delete file="java_memcached-${ver}.tar.gz"/>
37 <delete file="java_memcached-${ver}.zip"/>
38 <delete file="java_memcached-${ver}.jar"/>
39 <delete file="java_memcached-${ver}.tar.gz.MD5"/>
40 <delete file="java_memcached-${ver}.zip.MD5"/>
41 <delete file="java_memcached-${ver}.jar.MD5"/>
45 <mkdir dir="java_memcached-${ver}"/>
46 <mkdir dir="java_memcached-${ver}/javadocs"/>
47 <mkdir dir="java_memcached-${ver}/src/com/danga/MemCached"/>
48 <mkdir dir="java_memcached-${ver}/classes"/>
49 <mkdir dir="java_memcached-${ver}/doc"/>
52 <copy todir="java_memcached-${ver}/src/com/danga/MemCached">
53 <fileset dir="${code.dir}" defaultexcludes="true" excludes="**/*.xml **/*.swp **/*.swo"/>
57 <copy todir="java_memcached-${ver}/doc">
58 <fileset dir="${doc.dir}" defaultexcludes="true" excludes="**/*.swp **/*.swo"/>
61 <!-- copy license to root -->
62 <copy file="${doc.dir}/LICENSE.txt" todir="java_memcached-${ver}"/>
64 <!-- copy changelog to root -->
65 <copy file="${doc.dir}/CHANGELOG.txt" todir="java_memcached-${ver}"/>
68 <!-- if logger is log4j then need to filter to make sure import exists -->
69 <target name="log4j" if="log4j" depends="clean, setup">
70 <replace dir="java_memcached-${ver}/src/com/danga/MemCached" token="//import org.apache.log4j.Logger;" value="import org.apache.log4j.Logger;">
71 <include name="**/*.java"/>
75 <target name="logger" unless="log4j" depends="clean, setup">
76 <replace dir="java_memcached-${ver}/src/com/danga/MemCached" token="import org.apache.log4j.Logger;" value="//import org.apache.log4j.Logger;">
77 <include name="**/*.java"/>
82 <target name="javadoc" depends="clean, setup, log4j, logger">
84 <fileset dir="java_memcached-${ver}/javadocs" />
87 <javadoc sourcepath="java_memcached-${ver}/src"
88 destdir="java_memcached-${ver}/javadocs"
89 packagenames= "com.danga.*"
94 classpathref="project.class.path"
96 windowtitle="java memcached client api documentation"
97 doctitle="<h1>${project.title} documentation (Version ${ver})</h1>"
98 bottom="Copyright © 2005 - greg whalin">
99 <arg value="-notimestamp" />
100 <arg value="-Xdoclint:none" />
104 <!-- compilation target for packeging operations -->
105 <target name="pkg-compile" depends="clean, setup, log4j, logger">
106 <javac debug="yes" srcdir="java_memcached-${ver}/src" destdir="java_memcached-${ver}/classes" deprecation="true">
107 <classpath refid="project.class.path"/>
111 <target name="jar" depends="pkg-compile">
112 <jar compress="yes" jarfile="java_memcached-${ver}/java_memcached-${ver}.jar" basedir="java_memcached-${ver}/classes"/>
115 <!-- compilation target -->
116 <target name="compile">
117 <mkdir dir="${build.dir}"/>
118 <javac debug="yes" srcdir="${src.dir}" destdir="${build.dir}" deprecation="true" compiler="modern">
119 <compilerarg value="-Xlint:unchecked"/>
120 <classpath refid="project.class.path"/>