-
Notifications
You must be signed in to change notification settings - Fork 448
/
build.xml
121 lines (102 loc) · 4.3 KB
/
build.xml
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
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="memcached" default="package" basedir=".">
<property name="project.title" value="java memcached client" />
<property name="code.dir" value="src/com/meetup/memcached" />
<property name="doc.dir" value="doc" />
<property name="src.dir" value="src" />
<property name="build.dir" value="classes" />
<property environment="env"/>
<property file="build.properties"/>
<property name="project" value="memcached"/>
<path id="project.class.path">
<pathelement path = "lib/log4j.jar"/>
</path>
<!-- package release -->
<!-- ant package -Dver=release_1.3 -Dlog4j=1 -->
<target name="package" depends="clean, setup, log4j, logger, pkg-compile, jar, javadoc">
<tar tarfile="memcached-${ver}.tar.gz" basedir="." includes="memcached-${ver}/**" compression="gzip"/>
<zip destfile="memcached-${ver}.zip" basedir="." includes="memcached-${ver}/**"/>
<copy file="memcached-${ver}/memcached-${ver}.jar" todir="."/>
<checksum file="memcached-${ver}.tar.gz"/>
<checksum file="memcached-${ver}.zip"/>
<checksum file="memcached-${ver}.jar"/>
<delete dir="memcached-${ver}" />
<tar tarfile="memcached-${ver}.tar" basedir="." includes="memcached-${ver}.*"/>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="memcached-${ver}" />
<delete file="memcached-${ver}.tar.gz"/>
<delete file="memcached-${ver}.zip"/>
<delete file="memcached-${ver}.jar"/>
<delete file="memcached-${ver}.tar.gz.MD5"/>
<delete file="memcached-${ver}.zip.MD5"/>
<delete file="memcached-${ver}.jar.MD5"/>
</target>
<target name="setup">
<mkdir dir="memcached-${ver}"/>
<mkdir dir="memcached-${ver}/javadocs"/>
<mkdir dir="memcached-${ver}/src/com/meetup/memcached"/>
<mkdir dir="memcached-${ver}/classes"/>
<mkdir dir="memcached-${ver}/doc"/>
<!-- copy source -->
<copy todir="memcached-${ver}/src/com/meetup/memcached">
<fileset dir="${code.dir}" defaultexcludes="true" excludes="**/*.xml **/*.swp **/*.swo"/>
</copy>
<!-- copy doc dir -->
<copy todir="memcached-${ver}/doc">
<fileset dir="${doc.dir}" defaultexcludes="true" excludes="**/*.swp **/*.swo"/>
</copy>
<!-- copy license to root -->
<copy file="${doc.dir}/LICENSE.txt" todir="memcached-${ver}"/>
<!-- copy changelog to root -->
<copy file="${doc.dir}/CHANGELOG.txt" todir="memcached-${ver}"/>
</target>
<!-- if logger is log4j then need to filter to make sure import exists -->
<target name="log4j" if="log4j" depends="clean, setup">
<replace dir="memcached-${ver}/src/com/meetup/memcached" token="//import org.apache.log4j.Logger;" value="import org.apache.log4j.Logger;">
<include name="**/*.java"/>
</replace>
</target>
<target name="logger" unless="log4j" depends="clean, setup">
<replace dir="memcached-${ver}/src/com/meetup/memcached" token="import org.apache.log4j.Logger;" value="//import org.apache.log4j.Logger;">
<include name="**/*.java"/>
</replace>
</target>
<!-- javadocs -->
<target name="javadoc" depends="clean, setup, log4j, logger">
<delete>
<fileset dir="memcached-${ver}/javadocs" />
</delete>
<javadoc sourcepath="memcached-${ver}/src"
destdir="memcached-${ver}/javadocs"
packagenames= "com.meetup.*"
author= "true"
private="true"
version="true"
defaultexcludes="yes"
classpathref="project.class.path"
use="true"
windowtitle="java memcached client api documentation"
doctitle="<h1>${project.title} documentation (Version ${ver})</h1>"
bottom="Copyright © 2005 - greg whalin">
</javadoc>
</target>
<!-- compilation target for packeging operations -->
<target name="pkg-compile" depends="clean, setup, log4j, logger">
<javac debug="yes" srcdir="memcached-${ver}/src" destdir="memcached-${ver}/classes" deprecation="true">
<classpath refid="project.class.path"/>
</javac>
</target>
<target name="jar" depends="pkg-compile">
<jar compress="yes" jarfile="memcached-${ver}/memcached-${ver}.jar" basedir="memcached-${ver}/classes"/>
</target>
<!-- compilation target -->
<target name="compile">
<mkdir dir="${build.dir}"/>
<javac debug="yes" srcdir="${src.dir}" destdir="${build.dir}" deprecation="true" compiler="modern">
<compilerarg value="-Xlint:unchecked"/>
<classpath refid="project.class.path"/>
</javac>
</target>
</project>