-
Notifications
You must be signed in to change notification settings - Fork 41
/
build.xml
211 lines (175 loc) · 7.08 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
210
211
<project name="at-robots2-j" default="compile" basedir=".">
<!-- The directories for compilation targets -->
<property name="build.home" value="build"/>
<property name="build.classes" value="${build.home}/classes"/>
<property name="build.tests" value="${build.home}/tests"/>
<property name="build.evosuite" value="${build.home}/evosuite"/>
<!-- Javac -->
<property name="compile.debug" value="true"/>
<property name="compile.deprecation" value="true"/>
<property name="compile.optimize" value="false"/>
<property name="compile.source" value="1.7"/>
<property name="compile.target" value="1.7"/>
<property name="compile.encoding" value="iso-8859-1"/>
<!-- The base directories for sources -->
<property name="source.java" value="src/main/java"/>
<property name="test.java" value="src/test/java"/>
<property name="source.resources" value="src/main/resources"/>
<property name="test.resources" value="src/test/resources"/>
<property name="evosuite.java" value="evosuite-tests"/>
<property name="lib.dir" value="../lib/"/>
<!-- The dependency libraries -->
<path id="source.lib">
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- The dependency libraries for running/compiling tests -->
<path id="test.lib">
<fileset dir="test-lib">
<include name="**/*.jar"/>
</fileset>
<pathelement location="${lib.dir}/junit-4.11.jar" />
</path>
<path id="evosuite.lib">
<pathelement location="${lib.dir}/evosuite.jar" />
</path>
<!-- ====================================================================== -->
<!-- ========== Executable Targets ======================================== -->
<!-- ====================================================================== -->
<target name="clean"
description="Clean build and distribution directories">
<delete dir="${build.home}"/>
</target>
<!-- ====================================================================== -->
<target name="prepare"
description="Prepare build directory">
<mkdir dir="${build.home}"/>
<mkdir dir="${source.java}"/>
<mkdir dir="${source.resources}"/>
<mkdir dir="${test.java}"/>
<mkdir dir="${test.resources}"/>
<mkdir dir="lib"/>
<mkdir dir="test-lib"/>
</target>
<!-- ====================================================================== -->
<target name="compile" depends="prepare"
description="Compile main code">
<mkdir dir="${build.classes}"/>
<javac srcdir="${source.java}"
destdir="${build.classes}"
source="${compile.source}"
target="${compile.target}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}"
encoding="${compile.encoding}">
<classpath refid="source.lib" />
</javac>
<copy todir="${build.classes}">
<fileset dir="${source.java}" excludes="**/*.java"/>
<fileset dir="${source.resources}" includes="**"/>
</copy>
</target>
<!-- ====================================================================== -->
<target name="compile-tests" depends="compile"
description="Compile user provided tests">
<mkdir dir="${build.tests}"/>
<javac srcdir="${test.java}"
destdir="${build.tests}"
debug="${compile.debug}"
source="${compile.source}"
target="${compile.target}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}"
encoding="${compile.encoding}">
<classpath>
<path refid="source.lib" />
<path refid="test.lib" />
<pathelement path="${build.classes}"/>
</classpath>
</javac>
<copy todir="${build.tests}">
<fileset dir="${test.java}" excludes="**/*.java"/>
<fileset dir="${test.resources}"/>
</copy>
</target>
<!-- ====================================================================== -->
<target name="compile-evosuite" depends="compile"
description="Compile EvoSuite generated tests">
<mkdir dir="${build.evosuite}"/>
<javac srcdir="${evosuite.java}"
destdir="${build.evosuite}"
source="${compile.source}"
target="${compile.target}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}">
<classpath>
<path refid="source.lib" />
<path refid="test.lib" />
<path refid="evosuite.lib" />
<pathelement path="${build.classes}"/>
</classpath>
</javac>
</target>
<!-- ====================================================================== -->
<target name="test" depends="compile-tests"
description="Run provided tests">
<junit printsummary="yes" haltonfailure="no" fork="yes"
showoutput="yes">
<formatter type="plain" usefile="false" />
<classpath>
<pathelement path="${build.classes}"/>
<pathelement path="${build.tests}"/>
<path refid="source.lib" />
<path refid="test.lib" />
</classpath>
<batchtest fork="yes">
<fileset dir="${test.java}">
<include name="**/*.java"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- ====================================================================== -->
<target name="evosuite-test" depends="compile-tests"
description="Run EvoSuite generated tests">
<junit printsummary="yes" haltonfailure="no" fork="yes"
showoutput="yes">
<formatter type="plain" usefile="false" />
<classpath>
<pathelement path="${build.classes}"/>
<pathelement path="${build.evosuite}"/>
<path refid="source.lib" />
<path refid="test.lib" />
</classpath>
<batchtest fork="yes">
<fileset dir="${test.java}">
<include name="**/*.java"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- ====================================================================== -->
<target name="jar" depends="compile"
description="Create main jar file">
<jar jarfile="${ant.project.name}.jar">
<fileset dir="${build.classes}"/>
</jar>
</target>
<!-- ====================================================================== -->
<target name="jar-tests" depends="compile-tests"
description="Create tests jar file">
<jar jarfile="${ant.project.name}-tests.jar">
<fileset dir="${build.tests}"/>
</jar>
</target>
<!-- ====================================================================== -->
<target name="jar-evosuite" depends="compile-evosuite"
description="Create evosuite tests jar file">
<jar jarfile="${ant.project.name}-evosuite.jar">
<fileset dir="${build.evosuite}"/>
</jar>
</target>
</project>