-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.xml
executable file
·199 lines (160 loc) · 5.69 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
<?xml version="1.0"?>
<project name="junitperf" default="test">
<description>
Builds and tests JUnitPerf.
</description>
<property file="build.properties"/>
<property environment="env"/>
<property name="Name" value="${ant.project.name}"/>
<property name="version" value="1.9.1"/>
<property name="src.dir" location="src"/>
<property name="test.dir" location="test"/>
<property name="build.dir" location="build"/>
<property name="docs.dir" location="docs"/>
<property name="dist.dir" location="dist"/>
<property name="run.dir" location="${build.dir}"/>
<property name="javadoc.dir" location="${build.dir}/docs/api"/>
<property name="dist.name" value="${Name}-${version}"/>
<property name="package.dir" location="${dist.dir}/${dist.name}"/>
<property name="test.reports.dir" location="${build.dir}/reports" />
<property name="build.debug" value="true"/>
<path id="project.classpath">
<pathelement location="${build.dir}"/>
</path>
<target name="prepare">
<tstamp />
<mkdir dir="${build.dir}"/>
<available property="junit.available"
classname="junit.framework.TestCase"/>
<fail message="Missing junit.jar in system CLASSPATH"
unless="junit.available"/>
</target>
<target name="compile" depends="prepare"
description="Compiles the source code">
<javac srcdir="${src.dir}"
destdir="${build.dir}"
debug="${build.debug}">
<classpath refid="project.classpath"/>
</javac>
</target>
<target name="compile-samples" depends="compile"
description="Compiles the samples tests">
<javac srcdir="samples"
destdir="${build.dir}"
debug="${build.debug}">
<classpath refid="project.classpath"/>
</javac>
</target>
<target name="compile-tests" depends="compile"
if="junit.available"
description="Compiles the test code">
<javac srcdir="${test.dir}"
destdir="${build.dir}"
debug="${build.debug}">
<classpath refid="project.classpath"/>
</javac>
</target>
<target name="test" depends="compile-tests, test-samples"
if="junit.available"
description="Runs all the tests">
<junit haltonfailure="yes" fork="yes">
<test name="com.clarkware.junitperf.AllTests"/>
<formatter type="plain" usefile="false"/>
<classpath refid="project.classpath"/>
</junit>
</target>
<target name="test-samples" depends="compile-samples"
if="junit.available"
description="Runs all the sample tests">
<junit haltonfailure="yes" fork="yes">
<test name="com.clarkware.junitperf.ExamplePerfTestSuite"/>
<formatter type="plain" usefile="false"/>
<classpath refid="project.classpath"/>
</junit>
</target>
<target name="test-sample-reports" depends="compile-samples"
description="Runs all the sample tests and generates an HTML report">
<mkdir dir="${test.reports.dir}" />
<junit haltonfailure="no"
printsummary="no"
fork="no"
errorProperty="test.failed"
failureProperty="test.failed">
<formatter type="plain" usefile="false" />
<formatter type="xml" />
<classpath refid="project.classpath" />
<batchtest todir="${test.reports.dir}">
<fileset dir="${build.dir}">
<include name="**/Example*Test.class" />
</fileset>
</batchtest>
</junit>
<junitreport todir="${test.reports.dir}">
<fileset dir="${test.reports.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${test.reports.dir}" />
</junitreport>
<fail if="test.failed">
Tests failed! Check test reports at ${test.reports.dir}.
</fail>
</target>
<target name="javadoc" depends="compile"
description="Generates JavaDoc">
<mkdir dir="${javadoc.dir}"/>
<javadoc packagenames="*"
sourcepath="${src.dir}"
destdir="${javadoc.dir}"
author="true"
version="true"
windowtitle="JUnitPerf ${version} API"
doctitle="JUnitPerf ${version} API"
bottom="Copyright © 1999-2005 Clarkware Consulting, Inc.">
<classpath refid="project.classpath"/>
</javadoc>
</target>
<target name="jar" depends="compile"
description="Creates a JAR file">
<mkdir dir="${dist.dir}"/>
<jar destfile="${dist.dir}/${dist.name}.jar"
basedir="${build.dir}" />
</target>
<target name="package"
depends="clean, test, jar, javadoc"
description="Creates a distribution file">
<copy todir="${package.dir}">
<fileset dir="${basedir}">
<include name="build.xml"/>
<include name="README"/>
<include name="CHANGES"/>
<include name="LICENSE"/>
</fileset>
</copy>
<copy todir="${package.dir}/docs">
<fileset dir="${docs.dir}"/>
</copy>
<copy todir="${package.dir}/src">
<fileset dir="${src.dir}"/>
</copy>
<copy todir="${package.dir}/test">
<fileset dir="${test.dir}"/>
</copy>
<copy todir="${package.dir}/samples">
<fileset dir="samples"/>
</copy>
<copy todir="${package.dir}/lib"
file="${dist.dir}/${dist.name}.jar"/>
<tar tarfile="${dist.dir}/${dist.name}.tar.gz"
basedir="${dist.dir}/"
compression="gzip"
includes="${dist.name}/**" />
<zip destfile="${dist.dir}/${dist.name}.zip"
basedir="${dist.dir}/"
includes="${dist.name}/**" />
</target>
<target name="clean"
description="Deletes all build artifacts">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
</project>