9
<project name="JUnitPerf" default="default" basedir=".">
11
<property file="${user.home}/build.properties" />
13
<property name="Name" value="JUnitPerf"/>
14
<property name="name" value="junitperf"/>
15
<property name="version" value="1.8"/>
16
<property name="packages" value="com.clarkware.junitperf.*"/>
18
<property name="home" value="${basedir}"/>
19
<property name="src.dir" value="${home}/src/app"/>
20
<property name="tests.dir" value="${home}/src/tests"/>
21
<property name="build.dir" value="${home}/build"/>
22
<property name="lib.dir" value="${home}/lib"/>
23
<property name="docs.dir" value="${home}/docs"/>
24
<property name="sample.dir" value="${home}/samples"/>
25
<property name="dist.dir" value="${home}/dist/${name}"/>
27
<path id="project.classpath">
28
<pathelement location="${build.dir}" />
31
<property name="main.test"
32
value="com.clarkware.junitperf.AllTests" />
34
<property name="samples.test"
35
value="com.clarkware.junitperf.ExamplePerfTestSuite" />
37
<property name="copyright"
38
value="Copyright © 2001-2002 Clarkware Consulting, Inc. All Rights Reserved."/>
46
<target name="default" depends="build"/>
54
<target name="all" depends="rebuild,test,test-samples,doc"/>
62
<target name="rebuild" depends="clean,build"/>
70
<target name="prepare">
74
<mkdir dir="${build.dir}"/>
75
<mkdir dir="${lib.dir}"/>
77
<available property="junit.present"
78
classname="junit.framework.TestCase" />
88
<target name="build" depends="compile,compile-samples,compile-tests"/>
96
<target name="compile" depends="prepare">
98
<javac srcdir="${src.dir}" destdir="${build.dir}">
99
<classpath refid="project.classpath" />
107
Compile Sample Java Source
110
<target name="compile-samples" depends="prepare">
112
<javac srcdir="${sample.dir}" destdir="${build.dir}">
113
<classpath refid="project.classpath" />
124
<target name="compile-tests" depends="compile" if="junit.present">
126
<javac srcdir="${tests.dir}" destdir="${build.dir}">
127
<classpath refid="project.classpath" />
138
<target name="test" depends="compile-tests" if="junit.present">
140
<junit printsummary="no" haltonfailure="yes">
141
<test name="${main.test}" />
142
<formatter type="plain" usefile="false" />
143
<classpath refid="project.classpath" />
151
Runs All Sample Tests
154
<target name="test-samples" depends="compile-samples" if="junit.present">
156
<junit printsummary="no" haltonfailure="yes">
157
<test name="${samples.test}" />
158
<formatter type="plain" usefile="false" />
159
<classpath refid="project.classpath" />
170
<target name="jar" depends="build">
172
<jar jarfile="${lib.dir}/${name}.jar"
173
basedir="${build.dir}" />
183
<target name="doc" depends="build">
185
<mkdir dir="${docs.dir}/api"/>
187
<javadoc packagenames="${packages}"
188
sourcepath="${src.dir}"
189
destdir="${docs.dir}/api"
192
windowtitle="${Name} API"
193
doctitle="${Name} API"
194
bottom="${copyright}">
205
<target name="dist" depends="rebuild,test,test-samples,jar,doc">
207
<mkdir dir="${dist.dir}" />
208
<mkdir dir="${dist.dir}/docs" />
209
<mkdir dir="${dist.dir}/docs/api" />
210
<mkdir dir="${dist.dir}/src" />
211
<mkdir dir="${dist.dir}/samples" />
212
<mkdir dir="${dist.dir}/lib" />
214
<copy file="build.xml" tofile="${dist.dir}/build.xml" />
215
<copy file="README" tofile="${dist.dir}/README" />
216
<copy file="LICENSE" tofile="${dist.dir}/LICENSE" />
218
<copy todir="${dist.dir}/docs">
219
<fileset dir="${docs.dir}" excludes="**/CVS" />
222
<copy todir="${dist.dir}/src/app">
223
<fileset dir="${src.dir}"
224
excludes="**/.classpath, **/CVS" />
227
<copy todir="${dist.dir}/src/tests">
228
<fileset dir="${tests.dir}"
229
excludes="**/.classpath, **/CVS" />
232
<copy todir="${dist.dir}/samples">
233
<fileset dir="${sample.dir}"
234
excludes="**/.classpath, **/CVS" />
237
<copy todir="${dist.dir}/lib">
238
<fileset dir="${lib.dir}"
250
<target name="dist-zip" depends="dist">
252
<zip zipfile="${name}${version}.zip"
253
basedir="${home}/dist" includes="**" />
263
<target name="clean">
265
<delete dir="${build.dir}"/>
266
<delete dir="${docs.dir}/api"/>
267
<delete dir="${home}/dist"/>
268
<delete file="${name}${version}.zip"/>
3
<project name="junitperf" default="test">
6
Builds and tests JUnitPerf.
9
<property file="build.properties"/>
10
<property environment="env"/>
12
<property name="Name" value="${ant.project.name}"/>
13
<property name="version" value="1.9.1"/>
15
<property name="src.dir" location="src"/>
16
<property name="test.dir" location="test"/>
17
<property name="build.dir" location="build"/>
18
<property name="docs.dir" location="docs"/>
19
<property name="dist.dir" location="dist"/>
20
<property name="run.dir" location="${build.dir}"/>
22
<property name="javadoc.dir" location="${build.dir}/docs/api"/>
23
<property name="dist.name" value="${Name}-${version}"/>
24
<property name="package.dir" location="${dist.dir}/${dist.name}"/>
26
<property name="build.debug" value="true"/>
28
<path id="project.classpath">
29
<pathelement location="${build.dir}"/>
32
<target name="prepare">
34
<mkdir dir="${build.dir}"/>
35
<available property="junit.available"
36
classname="junit.framework.TestCase"/>
37
<fail message="Missing junit.jar in system CLASSPATH"
38
unless="junit.available"/>
41
<target name="compile" depends="prepare"
42
description="Compiles the source code">
43
<javac srcdir="${src.dir}"
44
destdir="${build.dir}"
45
debug="${build.debug}">
46
<classpath refid="project.classpath"/>
50
<target name="compile-samples" depends="prepare"
51
description="Compiles the samples tests">
52
<javac srcdir="samples"
53
destdir="${build.dir}"
54
debug="${build.debug}">
55
<classpath refid="project.classpath"/>
59
<target name="compile-tests" depends="compile"
61
description="Compiles the test code">
62
<javac srcdir="${test.dir}"
63
destdir="${build.dir}"
64
debug="${build.debug}">
65
<classpath refid="project.classpath"/>
69
<target name="test" depends="compile-tests, test-samples"
71
description="Runs all the tests">
72
<junit haltonfailure="yes" fork="yes">
73
<test name="com.clarkware.junitperf.AllTests"/>
74
<formatter type="plain" usefile="false"/>
75
<classpath refid="project.classpath"/>
79
<target name="test-samples" depends="compile-samples"
81
description="Runs all the sample tests">
82
<junit haltonfailure="yes" fork="yes">
83
<test name="com.clarkware.junitperf.ExamplePerfTestSuite"/>
84
<formatter type="plain" usefile="false"/>
85
<classpath refid="project.classpath"/>
89
<target name="javadoc" depends="compile"
90
description="Generates JavaDoc">
92
<mkdir dir="${javadoc.dir}"/>
94
<javadoc packagenames="*"
95
sourcepath="${src.dir}"
96
destdir="${javadoc.dir}"
99
windowtitle="JUnitPerf ${version} API"
100
doctitle="JUnitPerf ${version} API"
101
bottom="Copyright © 1999-2005 Clarkware Consulting, Inc.">
102
<classpath refid="project.classpath"/>
106
<target name="jar" depends="compile"
107
description="Creates a JAR file">
109
<mkdir dir="${dist.dir}"/>
111
<jar destfile="${dist.dir}/${dist.name}.jar"
112
basedir="${build.dir}" />
116
<target name="package"
117
depends="clean, test, jar, javadoc"
118
description="Creates a distribution file">
120
<copy todir="${package.dir}">
121
<fileset dir="${basedir}">
122
<include name="build.xml"/>
123
<include name="README"/>
124
<include name="CHANGES"/>
125
<include name="LICENSE"/>
129
<copy todir="${package.dir}/docs">
130
<fileset dir="${docs.dir}"/>
133
<copy todir="${package.dir}/src">
134
<fileset dir="${src.dir}"/>
137
<copy todir="${package.dir}/test">
138
<fileset dir="${test.dir}"/>
141
<copy todir="${package.dir}/samples">
142
<fileset dir="samples"/>
145
<copy todir="${package.dir}/lib"
146
file="${dist.dir}/${dist.name}.jar"/>
148
<tar tarfile="${dist.dir}/${dist.name}.tar.gz"
149
basedir="${dist.dir}/"
151
includes="${dist.name}/**" />
153
<zip destfile="${dist.dir}/${dist.name}.zip"
154
basedir="${dist.dir}/"
155
includes="${dist.name}/**" />
160
description="Deletes all build artifacts">
161
<delete dir="${build.dir}"/>
162
<delete dir="${dist.dir}"/>