This repository has been archived by the owner on Jan 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
/
build.xml
executable file
·245 lines (217 loc) · 11.6 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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<project name="Pixy" basedir="." default="help">
<!--
Directory Layout
*****************
- TOP
- build.xml
- run
- BUILD
- CLASS
- generated java class files
- CONFIG
- configuration files
- DOC
- documentation
- LIB
- external libraries
- SCRIPTS
- convenience scripts
- SRC
- Pixy itself
-->
<!-- PROPERTIES *************************************************************-->
<!-- java/javac properties -->
<property name="src.dir" value="src"/>
<property name="test.dir" value="test"/>
<property name="build.dir" value="build"/>
<property name="build.class.dir" value="${build.dir}/class"/>
<property name="build.instrumented.dir" value="${build.dir}/instrumented"/>
<property name="reports.dir" value="reports"/>
<property name="reports.xml.dir" value="${reports.dir}/xml"/>
<property name="reports.html.dir" value="${reports.dir}/html"/>
<property name="lib.dir" value="lib"/>
<property name="cobertura.lib.dir" value="cobertura"/>
<property name="cobertura.datafile" value="${reports.dir}/cobertura.ser"/>
<!-- delete properties -->
<!-- caution: graphs and output directory is hard-coded in main class and convenience scripts -->
<property name="graphs.dir" value="graphs"/>
<property name="output.dir" value="output"/>
<property name="serialfile" value="config/serialized"/>
<property name="echoedfile" value="echoed.txt"/>
<!-- classpath -->
<path id="classpath">
<pathelement location="${lib.dir}"/>
<pathelement location="${lib.dir}/junit.jar"/>
<pathelement location="${build.class.dir}"/>
<pathelement location="transducers/jauto-classes"/>
</path>
<path id="cobertura.classpath">
<fileset dir="${lib.dir}">
<include name="cobertura.jar" />
<include name="${cobertura.lib.dir}/**/*.jar" />
</fileset>
</path>
<!-- TASKS ****************************************************************-->
<taskdef name="cobertura-instrument" classpathref="cobertura.classpath" classname="net.sourceforge.cobertura.ant.InstrumentTask" classpath="${lib.dir}/cobertura.jar"/>
<taskdef name="cobertura-report" classpathref="cobertura.classpath" classname="net.sourceforge.cobertura.ant.ReportTask" classpath="${lib.dir}/cobertura.jar"/>
<!-- TARGETS ****************************************************************-->
<target name="build" description="Compiles the whole project.">
<mkdir dir="${build.class.dir}"/>
<mkdir dir="${graphs.dir}"/>
<javac destdir="${build.class.dir}" debug="on" includeantruntime="false">
<src>
<pathelement path="${src.dir}"/>
<pathelement path="${test.dir}"/>
</src>
<classpath refid="classpath"/>
<compilerarg line="-Xlint -Xmaxwarns 99999 -Xmaxerrs 99999"/>
</javac>
</target>
<target name="clean" description="Cleans the project, deleting all build files.">
<delete dir="${build.class.dir}"/>
<delete dir="${build.instrumented.dir}"/>
<delete dir="${graphs.dir}"/>
<delete dir="transducers/temp"/>
<delete dir="${output.dir}"/>
<delete file="${serialfile}"/>
<delete file="${echoedfile}"/>
<delete dir="${reports.html.dir}"/>
<delete dir="${reports.xml.dir}"/>
<delete file="${cobertura.datafile}"/>
</target>
<target name="test" description="Runs the JUnit unit tests." depends="build">
<java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<arg value="at.ac.tuwien.infosys.www.pixy.AliasTestCase"/>
<sysproperty key="pixy.home" value="${basedir}"/>
<classpath refid="classpath"/>
</java>
<java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<arg value="at.ac.tuwien.infosys.www.pixy.DepGraphTestCase"/>
<sysproperty key="pixy.home" value="${basedir}"/>
<classpath refid="classpath"/>
</java>
<java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<arg value="at.ac.tuwien.infosys.www.pixy.DepGraphTestCaseNA"/>
<sysproperty key="pixy.home" value="${basedir}"/>
<classpath refid="classpath"/>
</java>
<java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<arg value="at.ac.tuwien.infosys.www.pixy.IncludeTestCase"/>
<sysproperty key="pixy.home" value="${basedir}"/>
<classpath refid="classpath"/>
</java>
<java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<arg value="at.ac.tuwien.infosys.www.pixy.LiteralTestCase"/>
<sysproperty key="pixy.home" value="${basedir}"/>
<classpath refid="classpath"/>
</java>
<java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<arg value="at.ac.tuwien.infosys.www.pixy.SQLTestCase"/>
<sysproperty key="pixy.home" value="${basedir}"/>
<classpath refid="classpath"/>
</java>
<java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<arg value="at.ac.tuwien.infosys.www.pixy.TypeTestCase"/>
<sysproperty key="pixy.home" value="${basedir}"/>
<classpath refid="classpath"/>
</java>
<java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<arg value="at.ac.tuwien.infosys.www.pixy.XSSTestCase"/>
<sysproperty key="pixy.home" value="${basedir}"/>
<classpath refid="classpath"/>
</java>
</target>
<target name="instrument" description="Adds code coverage markes to the generated byte code." depends="build" >
<mkdir dir="${build.instrumented.dir}"/>
<cobertura-instrument todir="${build.instrumented.dir}" datafile="${cobertura.datafile}">
<fileset dir="${build.class.dir}">
<include name="**/*.class"/>
</fileset>
</cobertura-instrument>
</target>
<target name="test-coverage" description="Runs the JUnit unit tests and generates code coverage information." depends="instrument">
<java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<jvmarg value="-XX:-UseSplitVerifier"/>
<arg value="at.ac.tuwien.infosys.www.pixy.AliasTestCase"/>
<sysproperty key="pixy.home" value="${basedir}"/>
<sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}" />
<classpath location="${build.instrumented.dir}" />
<classpath refid="classpath"/>
<classpath refid="cobertura.classpath" />
</java>
<java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<jvmarg value="-XX:-UseSplitVerifier"/>
<arg value="at.ac.tuwien.infosys.www.pixy.DepGraphTestCase"/>
<sysproperty key="pixy.home" value="${basedir}"/>
<sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}" />
<classpath location="${build.instrumented.dir}" />
<classpath refid="classpath"/>
<classpath refid="cobertura.classpath" />
</java>
<java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<jvmarg value="-XX:-UseSplitVerifier"/>
<arg value="at.ac.tuwien.infosys.www.pixy.DepGraphTestCaseNA"/>
<sysproperty key="pixy.home" value="${basedir}"/>
<sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}" />
<classpath location="${build.instrumented.dir}" />
<classpath refid="classpath"/>
<classpath refid="cobertura.classpath" />
</java>
<java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<jvmarg value="-XX:-UseSplitVerifier"/>
<arg value="at.ac.tuwien.infosys.www.pixy.IncludeTestCase"/>
<sysproperty key="pixy.home" value="${basedir}"/>
<sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}" />
<classpath location="${build.instrumented.dir}" />
<classpath refid="classpath"/>
<classpath refid="cobertura.classpath" />
</java>
<java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<jvmarg value="-XX:-UseSplitVerifier"/>
<arg value="at.ac.tuwien.infosys.www.pixy.LiteralTestCase"/>
<sysproperty key="pixy.home" value="${basedir}"/>
<sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}" />
<classpath location="${build.instrumented.dir}" />
<classpath refid="classpath"/>
<classpath refid="cobertura.classpath" />
</java>
<java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<jvmarg value="-XX:-UseSplitVerifier"/>
<arg value="at.ac.tuwien.infosys.www.pixy.SQLTestCase"/>
<sysproperty key="pixy.home" value="${basedir}"/>
<sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}" />
<classpath location="${build.instrumented.dir}" />
<classpath refid="classpath"/>
<classpath refid="cobertura.classpath" />
</java>
<java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<jvmarg value="-XX:-UseSplitVerifier"/>
<arg value="at.ac.tuwien.infosys.www.pixy.TypeTestCase"/>
<sysproperty key="pixy.home" value="${basedir}"/>
<sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}" />
<classpath location="${build.instrumented.dir}" />
<classpath refid="classpath"/>
<classpath refid="cobertura.classpath" />
</java>
<java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<jvmarg value="-XX:-UseSplitVerifier"/>
<arg value="at.ac.tuwien.infosys.www.pixy.XSSTestCase"/>
<sysproperty key="pixy.home" value="${basedir}"/>
<sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}" />
<classpath location="${build.instrumented.dir}" />
<classpath refid="classpath"/>
<classpath refid="cobertura.classpath" />
</java>
</target>
<target name="coverage-report" description="Creates code coverage reports in HTML and XML." depends="test-coverage">
<mkdir dir="${reports.html.dir}"/>
<cobertura-report format="html" datafile="${cobertura.datafile}" destdir="${reports.html.dir}"
srcdir="${src.dir}" encoding="UTF-8"/>
<mkdir dir="${reports.xml.dir}"/>
<cobertura-report format="xml" datafile="${cobertura.datafile}" destdir="${reports.xml.dir}"
srcdir="${src.dir}" encoding="UTF-8"/>
</target>
<target description="Prints some help information." name="help">
<echo message="You probably want to do 'ant build'. Otherwise, type 'ant -projecthelp' for help."/>
</target>
</project>