forked from apache/commons-collections
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
225 lines (186 loc) · 8.17 KB
/
build.xml
File metadata and controls
225 lines (186 loc) · 8.17 KB
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
<!-- $Id: build.xml,v 1.1 2001/04/14 15:39:03 rwaldhoff Exp $ -->
<project name="commons-collections" default="test" basedir=".">
<!-- patternset describing files to be copied from the doc directory -->
<patternset id="patternset-doc"/>
<!-- patternset describing test classes -->
<patternset id="patternset-test-classes">
<include name="**/Test*.class"/>
</patternset>
<!-- patternset describing non test classes -->
<patternset id="patternset-non-test-classes">
<include name="**/*.class"/>
<exclude name="**/Test*.class"/>
</patternset>
<!-- patternset describing non test source files (*.java, *html, etc.) -->
<patternset id="patternset-javadocable-sources">
<include name="**/*"/>
<exclude name="**/Test*.java"/>
</patternset>
<!-- ######################################################### -->
<target name="init">
<tstamp/>
<!-- read properties from the ${user.home}/propfile, if any -->
<property name="user-propfile" value="${user.home}/build.properties"/>
<property file="${user-propfile}"/>
<property name="user-classpath" value=""/>
<!-- read properties from the build.properties, if any -->
<property file="${basedir}/build.properties"/>
<!-- command line classpath, if any -->
<property name="cp" value=""/>
<!-- now combine the classpaths -->
<property name="classpath" value="${cp}:${user-classpath}:${junit.jar}"/>
<property name="name" value="commons-collections"/>
<property name="Name" value="Commons-Collections"/>
<property name="Name-Long" value="Jakarta Commons Collections Package"/>
<property name="test.entry" value="org.apache.commons.collections.TestAll"/>
<property name="test.failonerror" value="true" />
<property name="test.runner" value="junit.textui.TestRunner" />
<property name="workdir" value="${java.io.tmpdir}/buildtemp_${DSTAMP}${TSTAMP}"/>
<property name="source" value="${basedir}"/>
<property name="source.src" value="${basedir}/src"/>
<property name="source.src.java" value="${source.src}/java"/>
<property name="source.src.test" value="${source.src}/test"/>
<property name="source.doc" value="${basedir}/doc"/>
<property name="dest" value="${basedir}/build"/>
<property name="dest.classes" value="${dest}/classes"/>
<property name="dest.doc" value="${dest}/doc"/>
<property name="dest.doc.api" value="${dest.doc}/api"/>
<property name="dest.jardir" value="${dest}"/>
<property name="dest.jardir.jar" value="${dest.jardir}/${name}.jar"/>
<available property="available-doc" file="${source.doc}"/> <!-- does this module have docs? -->
<available property="available-src-java" file="${source.src.java}"/> <!-- does this module have java src? -->
<available property="available-src-test" file="${source.src.test}"/> <!-- does this module have test src? -->
</target>
<!-- ######################################################### -->
<target name="copy-javadoc-source" depends="init" if="available-src-java">
<mkdir dir="${javadoc-source-dir}"/>
<copy todir="${javadoc-source-dir}" filtering="no">
<fileset dir="${source.src.java}">
<patternset refid="patternset-javadocable-sources"/>
</fileset>
</copy>
</target>
<target name="copy-doc" depends="init" if="available-doc">
<mkdir dir="${doc-source-dir}/${name}"/>
<copy todir="${doc-source-dir}/${name}" filtering="no">
<fileset dir="${source.doc}">
<patternset refid="patternset-doc"/>
</fileset>
</copy>
</target>
<!-- ######################################################### -->
<target name="clean" depends="init,clean-doc,clean-build,clean-dist" description="removes generated files">
<delete dir="${dest}"/>
</target>
<target name="clean-doc" depends="init,clean-javadoc">
<delete dir="${dest.doc}"/>
</target>
<target name="clean-javadoc" depends="init">
<delete dir="${dest.doc.api}"/>
</target>
<target name="clean-build" depends="init">
<delete dir="${dest.classes}"/>
</target>
<target name="clean-dist" depends="init">
<delete file="${dest.jardir.jar}"/>
</target>
<!-- ######################################################### -->
<target name="doc" depends="init,doc-copy,doc-javadoc" description="generates javadocs and other documentation">
</target>
<target name="doc-copy" depends="init" if="available-doc">
<mkdir dir="${dest.doc}"/>
<copy todir="${dest.doc}">
<fileset dir="${source.doc}">
<patternset refid="patternset-doc"/>
</fileset>
</copy>
</target>
<target name="doc-javadoc" depends="init" if="available-src-java">
<!-- copy all the non-test sources out to the work directory and javadoc that -->
<mkdir dir="${workdir}"/>
<copy todir="${workdir}">
<fileset dir="${source.src.java}">
<patternset refid="patternset-javadocable-sources"/>
</fileset>
</copy>
<mkdir dir="${dest.doc.api}"/>
<javadoc packagenames="org.*"
sourcepath="${workdir}"
classpath="${classpath}"
destdir="${dest.doc.api}"
windowtitle="${Name-Long}"
doctitle="${Name-Long}"
bottom="<small>Copyright &copy; 2001 Apache Software Foundation. Documenation generated ${TODAY}</small>."
public="true"
version="true"
author="false"
splitindex="false"
nodeprecated="true"
nodeprecatedlist="true"
notree="true"
noindex="false"
nohelp="true"
nonavbar="false"
serialwarn="false">
</javadoc>
<delete dir="${workdir}"/>
</target>
<!-- ######################################################### -->
<target name="build" depends="init,build-java" description="compiles source files"/>
<target name="build-java" depends="init" if="available-src-java">
<mkdir dir="${dest.classes}"/>
<javac destdir="${dest.classes}"
srcdir="${source.src.java}"
classpath="${classpath}"
debug="false"
deprecation="true"
optimize="true"/>
</target>
<target name="build-test" depends="init,build-java" if="available-src-test">
<mkdir dir="${dest.classes}"/>
<javac destdir="${dest.classes}"
srcdir="${source.src.test}"
classpath="${classpath}"
debug="false"
deprecation="true"
optimize="true"/>
</target>
<!-- ######################################################### -->
<target name="test" depends="build-test" if="test.entry" description="runs (junit) unit tests">
<!--
<junit printsummary="yes" fork="on" haltonfailure="yes">
<formatter type="plain" usefile="false"/>
<test name="${test.entry}"/>
<classpath>
<pathelement location="${dest.classes}" />
<pathelement path="${classpath}" />
<pathelement path="${java.class.path}" />
</classpath>
</junit>
-->
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
<arg value="${test.entry}"/>
<classpath>
<pathelement location="${dest.classes}" />
<pathelement path="${classpath}" />
<pathelement path="${java.class.path}" />
</classpath>
</java>
</target>
<!-- ######################################################### -->
<target name="dist" depends="dist-jar" description="builds production jar"/>
<target name="dist-jar" depends="build">
<mkdir dir="${dest.jardir}"/>
<mkdir dir="${workdir}"/>
<copy todir="${workdir}">
<fileset dir="${dest.classes}">
<patternset refid="patternset-non-test-classes"/>
</fileset>
</copy>
<jar jarfile="${dest.jardir.jar}">
<fileset dir="${workdir}"/>
</jar>
<delete dir="${workdir}"/>
</target>
<!-- ######################################################### -->
</project>