forked from cbrisson/stillness
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
209 lines (176 loc) · 7.15 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
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
<?xml version="1.0" encoding="iso-8859-1" ?>
<project name="stillness" default="usage" basedir=".">
<!-- NAMES -->
<property name="project" value="stillness"/>
<property name="version" value="0.1-dev"/>
<property name="final.name" value="${project}-${version}"/>
<!-- COMPILATION PARAMETERS -->
<!-- <property name="build.compiler" value="jikes"/> -->
<!-- <property name="build.compiler.emacs" value="true"/> -->
<property name="debug" value="on"/>
<!-- DIRECTORIES -->
<property name="src.dir" value="${basedir}/src"/>
<property name="build.dir" value="${basedir}/class"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="bin.dir" value="${basedir}/bin"/>
<property name="conf.dir" value="${basedir}/conf"/>
<property name="images.dir" value="${basedir}/images"/>
<property name="test.dir" value="${basedir}/test"/>
<property name="data.dir" value="${basedir}/data"/>
<property name="tmp.dir" value="${basedir}/tmp"/>
<property name="javadoc.destdir" value="${basedir}/docs/api"/>
<property name="final.name" value="${project}-${version}"/>
<property name="dist.root" value="${basedir}/dist"/>
<property name="dist.dir" value="${dist.root}/${final.name}"/>
<!-- BUILD PROPERTIES -->
<property file="build.properties"/> <!-- Component local -->
<property file="${user.home}/build.properties"/> <!-- User local -->
<!-- Build classpath automatically -->
<!--
<path id="classpath">
<fileset dir="./lib">
<include name="**/*.jar"/>
</fileset>
</path>
-->
<!-- Explicit classpath construction -->
<!-- Construct explicit classpath of libs needed to compile this project -->
<path id="classpath">
<pathelement location="${commons-beanutils.jar}"/>
<pathelement location="${commons-digester.jar}"/>
<pathelement location="${commons-logging.jar}"/>
<pathelement location="${jdom.jar}"/>
<pathelement location="${jsdk.jar}"/>
<pathelement location="${velocity.jar}"/>
<pathelement location="${velocity-tools-view.jar}"/>
</path>
<!-- PATTERN SETS -->
<patternset id="sources" >
<include name="**/*"/>
<exclude name="**/old/*"/>
</patternset>
<!-- targets section -->
<target name="usage">
<echo>
No target specified.
Please specify a target among :
jar : builds stillness jar
javadoc : builds stillness javadoc
tarball : builds stillness tgz package</echo>
</target>
<target name="prepare">
<!-- MAKE THE DIRECTORIES IF NEEDED -->
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}" />
<mkdir dir="${bin.dir}" />
<delete dir="${tmp.dir}" />
<mkdir dir="${tmp.dir}" />
<tstamp />
</target>
<target name="jar" depends="prepare">
<property name="myclasspath" refid="classpath"/>
<echo message="using classpath= ${myclasspath}"/>
<javac srcdir="${basedir}/src" destdir="${build.dir}" debug="${debug}" debuglevel="lines,vars,source" encoding="ISO-8859-1">
<patternset refid="sources"/>
<classpath refid="classpath"/>
</javac>
<jar jarfile="${bin.dir}/stillness-${version}.jar" basedir="${build.dir}" >
<patternset refid="sources"/>
</jar>
</target>
<target name="javadoc" depends="prepare">
<property name="javadoc.breakiterator" value="" /> <mkdir dir="${javadoc.destdir}"/>
<condition property="javadoc.breakiterator" value="-breakiterator" >
<or>
<equals arg1="${ant.java.version}" arg2="1.4" />
<equals arg1="${ant.java.version}" arg2="1.5" />
</or>
</condition>
<property name="javadoc.jdk.href" value="" />
<property name="javadoc.jdk.offline" value="false" />
<property name="javadoc.jdk.packaglistLoc" value="" />
<condition property="javadoc.jdk.href" value="http://java.sun.com/products/jdk/1.2/docs/api/">
<equals arg1="${ant.java.version}" arg2="1.2" />
</condition>
<condition property="javadoc.jdk.href" value="http://java.sun.com/j2se/1.3/docs/api/">
<equals arg1="${ant.java.version}" arg2="1.3" />
</condition>
<condition property="javadoc.jdk.href" value="http://java.sun.com/j2se/1.4/docs/api/">
<equals arg1="${ant.zojava.version}" arg2="1.4" />
</condition>
<condition property="javadoc.jdk.href" value="http://java.sun.com/j2se/1.5/docs/api/">
<equals arg1="${ant.java.version}" arg2="1.5" />
</condition>
<javadoc
sourcepath="${src.dir}"
packagenames="stillness.*"
destdir="${javadoc.destdir}"
author="true"
private="true"
version="true"
use="true"
additionalparam="${javadoc.breakiterator}"
windowtitle="${project} ${version} API"
doctitle="${project} ${version} API">
<link offline="${javadoc.jdk.offline}" href="${javadoc.jdk.href}" packagelistLoc="${javadoc.jdk.packagelistLoc}" />
<bottom><![CDATA[<div align='center'>~ooOoo~</div>]]></bottom>
<classpath refid="classpath"/>
</javadoc>
</target>
<target name="tarball" depends="javadoc,jar">
<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.dir}/src"/>
<copy todir="${dist.dir}/src">
<fileset dir="${basedir}/src/">
<include name="**"/>
</fileset>
</copy>
<copy todir="${dist.dir}/docs">
<fileset dir="${basedir}/docs">
<include name="**"/>
</fileset>
</copy>
<copy todir="${dist.dir}/lib" >
<fileset dir="${basedir}/lib" >
<include name="crimson.jar" />
<include name="dom4j.jar" />
<include name="jdom.jar" />
<include name="jsdk23.jar" />
<!-- <include name="velocity-dep-1.5-dev.jar" />
<include name="velocity-tools-view-1.2-dev.jar" />
<include name="common-beanutils.jar" />
<include name="common-digester.jar" />
<include name="common-logging.jar" /> -->
</fileset>
</copy>
<copy todir="${dist.dir}">
<fileset dir="${basedir}">
<include name="build.xml"/>
<include name="CHANGELOG"/>
<include name="COPYING.gnu"/>
<include name="LICENSE"/>
<include name="NOTICE"/>
<include name="README"/>
<include name="TODO"/>
</fileset>
</copy>
<copy todir="${dist.dir}/src">
<fileset dir="${basedir}/src/">
<include name="**"/>
</fileset>
</copy>
<copy todir="${dist.dir}/samples">
<fileset dir="${basedir}/samples/">
<include name="**"/>
</fileset>
</copy>
<mkdir dir="${dist.dir}/bin"/>
<copy file="${basedir}/bin/${project}-${version}.jar" tofile="${dist.dir}/bin/${project}-${version}.jar"/>
<delete file="${basedir}/${final.name}.tar" quiet="true"/>
<delete file="${basedir}/${final.name}.tgz" quiet="true"/>
<tar tarfile="${basedir}/${final.name}.tar" basedir="${dist.root}"
includes="**/${final.name}/**" longfile="gnu"/>
<gzip zipfile="${basedir}/${final.name}.tgz" src="${basedir}/${final.name}.tar"/>
<delete file="${basedir}/${final.name}.tar" quiet="true"/>
</target>
</project>