0
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
2 |
<project name="com.nokia.s60tools.apiquery" default="cc" basedir=".">
|
|
3 |
|
|
4 |
<!-- Targets -->
|
|
5 |
<target name="cc" depends="clean-test, jar, analyze, feature, test, zip" description="Build, instrument, run unit tests and analyze code"/>
|
|
6 |
|
|
7 |
|
|
8 |
<property name="basews" value="${ws}"/>
|
|
9 |
<property name="baseos" value="${os}"/>
|
|
10 |
<property name="basearch" value="${arch}"/>
|
|
11 |
<property name="basenl" value="${nl}"/>
|
|
12 |
|
|
13 |
<!-- Compiler settings -->
|
|
14 |
<property name="javacFailOnError" value="true"/>
|
|
15 |
<property name="javacDebugInfo" value="on"/>
|
|
16 |
<property name="javacVerbose" value="false"/>
|
|
17 |
<property name="logExtension" value=".log"/>
|
|
18 |
<property name="compilerArg" value=""/>
|
|
19 |
<property name="javacSource" value="5"/>
|
|
20 |
<property name="javacTarget" value="5"/>
|
|
21 |
|
|
22 |
<property name="bootclasspath" refid="path_bootclasspath"/>
|
|
23 |
<property name="bundleJavacSource" value="${javacSource}"/>
|
|
24 |
<property name="bundleJavacTarget" value="${javacTarget}"/>
|
|
25 |
<property name="bundleBootClasspath" value="${bootclasspath}"/>
|
|
26 |
|
|
27 |
<property name="feature.name" value="APIQuery"/>
|
|
28 |
<property name="feature.project.name" value="com.nokia.carbide.extension.apiquery"/>
|
|
29 |
<property name="feature.project.folder" location="../com.nokia.carbide.extensions.apiquery"/>
|
|
30 |
<property name="cache.name" value="${ant.project.name}.cache"/>
|
|
31 |
<property name="ifsheets.name" value="${ant.project.name}.ifsheets"/>
|
|
32 |
<property name="web.name" value="${ant.project.name}.web"/>
|
|
33 |
|
|
34 |
|
|
35 |
<property name="help.project.name" value="${ant.project.name}.help"/>
|
|
36 |
<property name="help.cache.name" value="${ant.project.name}.cache.help"/>
|
|
37 |
<property name="help.ifsheets.name" value="${ant.project.name}.ifsheets.help"/>
|
|
38 |
<property name="help.web.name" value="${ant.project.name}.web.help"/>
|
|
39 |
|
|
40 |
<property name="help.jar.filename" value="${help.project.name}.jar"/>
|
|
41 |
<property name="help.cache.filename" value="${help.cache.name}.jar"/>
|
|
42 |
<property name="help.ifsheets.filename" value="${help.ifsheets.name}.jar"/>
|
|
43 |
<property name="help.web.filename" value="${help.web.name}.jar"/>
|
|
44 |
|
|
45 |
<property name="jar.filename" value="${ant.project.name}.jar"/>
|
|
46 |
<property name="cache.jar.filename" value="${ant.project.name}.cache.jar"/>
|
|
47 |
<property name="ifsheets.jar.filename" value="${ant.project.name}.ifsheets.jar"/>
|
|
48 |
<property name="web.jar.filename" value="${ant.project.name}.web.jar"/>
|
|
49 |
<property name="help.jar.filename" value="${help.project.name}.jar"/>
|
|
50 |
|
|
51 |
<!-- Folder definitions -->
|
|
52 |
<property name="cache.folder" location="../${cache.name}"/>
|
|
53 |
<property name="ifsheets.folder" location="../${ifsheets.name}"/>
|
|
54 |
<property name="web.folder" location="../${web.name}"/>
|
|
55 |
<property name="test.folder" location="../${ant.project.name}.tests"/>
|
|
56 |
<property name="test.cache.folder" location="../${ant.project.name}.cache.tests"/>
|
|
57 |
<property name="test.ifsheets.folder" location="../${ant.project.name}.ifsheets.tests"/>
|
|
58 |
<property name="test.web.folder" location="../${ant.project.name}.web.tests"/>
|
|
59 |
<property name="binaries.folder" location="${basedir}/../${feature.name}.binaries"/>
|
|
60 |
|
|
61 |
<!-- Carbide layouts -->
|
|
62 |
<property name="carbide.dev.folder" location="c:/Carbide_development/plugins"/>
|
|
63 |
<property name="carbide.int.folder" location="c:/Carbide_internal/plugins"/>
|
|
64 |
<property name="carbide.adt.folder" location="c:/Carbide_ADT/plugins"/>
|
|
65 |
|
|
66 |
<property name="reports.folder" location="../reports"/>
|
|
67 |
<property name="reports.emma" location="${reports.folder}/emma"/>
|
|
68 |
<property name="instr.folder" location="instr"/>
|
|
69 |
|
|
70 |
|
|
71 |
<!-- EMMA configuration -->
|
|
72 |
<path id="emma.lib" >
|
|
73 |
<pathelement location="${ant.home}/lib/emma.jar" />
|
|
74 |
<pathelement location="${ant.home}/lib/emma_ant.jar" />
|
|
75 |
</path>
|
|
76 |
|
|
77 |
<taskdef resource="emma_ant.properties" classpathref="emma.lib" />
|
|
78 |
|
|
79 |
<!-- PMD configuration -->
|
|
80 |
<path id="pmd.lib" >
|
|
81 |
<pathelement location="${ant.home}/lib/pmd-4.2.jar" />
|
|
82 |
<pathelement location="${ant.home}/lib/asm-3.1.jar" />
|
|
83 |
<pathelement location="${ant.home}/lib/jaxen-1.1.1.jar" />
|
|
84 |
</path>
|
|
85 |
|
|
86 |
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.lib" />
|
|
87 |
|
|
88 |
<path id="path_bootclasspath">
|
|
89 |
<fileset dir="${java.home}/lib">
|
|
90 |
<include name="*.jar"/>
|
|
91 |
</fileset>
|
|
92 |
</path>
|
|
93 |
|
|
94 |
<path id="build_classpath">
|
|
95 |
<path refid="carbide_classpath"/>
|
|
96 |
</path>
|
|
97 |
|
|
98 |
<!-- Select Carbide layout -->
|
|
99 |
<path id="carbide_classpath">
|
|
100 |
<fileset dir="${carbide.int.folder}" includes="**/*.jar" />
|
|
101 |
</path>
|
|
102 |
|
|
103 |
<target name="properties" if="eclipse.running">
|
|
104 |
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
|
|
105 |
</target>
|
|
106 |
|
|
107 |
<!-- Initialization -->
|
|
108 |
<target name="init" depends="properties">
|
|
109 |
<condition property="pluginTemp" value="${buildTempFolder}/plugins">
|
|
110 |
<isset property="buildTempFolder"/>
|
|
111 |
</condition>
|
|
112 |
<property name="pluginTemp" value="${basedir}"/>
|
|
113 |
<condition property="build.result.folder" value="${pluginTemp}/${ant.project.name}">
|
|
114 |
<isset property="buildTempFolder"/>
|
|
115 |
</condition>
|
|
116 |
<property name="build.result.folder" value="${basedir}"/>
|
|
117 |
<property name="temp.folder" value="${basedir}/temp.folder"/>
|
|
118 |
<property name="plugin.destination" value="${basedir}"/>
|
|
119 |
|
|
120 |
<property name="jar.filename" value="${ant.project.name}.jar"/>
|
|
121 |
|
|
122 |
<delete dir="${reports.folder}"/>
|
|
123 |
<mkdir dir="${reports.folder}"/>
|
|
124 |
|
|
125 |
<delete dir="../plugins"/>
|
|
126 |
<mkdir dir="../plugins"/>
|
|
127 |
|
|
128 |
<!-- Delete build folders -->
|
|
129 |
<delete dir="com"/>
|
|
130 |
<delete dir="${cache.folder}/com"/>
|
|
131 |
<delete dir="${ifsheets.folder}/com"/>
|
|
132 |
<delete dir="${web.folder}/com"/>
|
|
133 |
|
|
134 |
<exec executable="svn" dir="../.">
|
|
135 |
<arg line="up"/>
|
|
136 |
</exec>
|
|
137 |
</target>
|
|
138 |
|
|
139 |
<!-- Build target -->
|
|
140 |
<target name="build" depends="init" description="Build the source">
|
|
141 |
|
|
142 |
<!-- Build the source -->
|
|
143 |
<javac destdir="" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bundleBootClasspath}" source="${bundleJavacSource}" target="${bundleJavacTarget}">
|
|
144 |
<compilerarg line="${compilerArg}" compiler="${build.compiler}"/>
|
|
145 |
<classpath refid="build_classpath" />
|
|
146 |
<src path="src/" />
|
|
147 |
<compilerarg value="@${basedir}/javaCompiler...args" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
|
|
148 |
<compilerarg line="-log '${temp.folder}/bin${logExtension}'" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
|
|
149 |
</javac>
|
|
150 |
|
|
151 |
<!-- Build the source -->
|
|
152 |
<javac destdir="${cache.folder}" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bundleBootClasspath}" source="${bundleJavacSource}" target="${bundleJavacTarget}">
|
|
153 |
<compilerarg line="${compilerArg}" compiler="${build.compiler}"/>
|
|
154 |
<classpath refid="build_classpath" />
|
|
155 |
<src path="${cache.folder}/src/" />
|
|
156 |
<compilerarg value="@${basedir}/javaCompiler...args" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
|
|
157 |
<compilerarg line="-log '${temp.folder}/bin${logExtension}'" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
|
|
158 |
</javac>
|
|
159 |
|
|
160 |
<!-- Build the source -->
|
|
161 |
<javac destdir="${ifsheets.folder}" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bundleBootClasspath}" source="${bundleJavacSource}" target="${bundleJavacTarget}">
|
|
162 |
<compilerarg line="${compilerArg}" compiler="${build.compiler}"/>
|
|
163 |
<classpath refid="build_classpath" />
|
|
164 |
<src path="${ifsheets.folder}/src/" />
|
|
165 |
<compilerarg value="@${basedir}/javaCompiler...args" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
|
|
166 |
<compilerarg line="-log '${temp.folder}/bin${logExtension}'" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
|
|
167 |
</javac>
|
|
168 |
|
|
169 |
<!-- Build the source -->
|
|
170 |
<javac destdir="${web.folder}" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bundleBootClasspath}" source="${bundleJavacSource}" target="${bundleJavacTarget}">
|
|
171 |
<compilerarg line="${compilerArg}" compiler="${build.compiler}"/>
|
|
172 |
<classpath refid="build_classpath" />
|
|
173 |
<src path="${web.folder}/src/" />
|
|
174 |
<compilerarg value="@${basedir}/javaCompiler...args" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
|
|
175 |
<compilerarg line="-log '${temp.folder}/bin${logExtension}'" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
|
|
176 |
</javac>
|
|
177 |
|
|
178 |
<!-- Copy necessary resources -->
|
|
179 |
<copy todir="" failonerror="true" overwrite="false">
|
|
180 |
<fileset dir="src/" excludes="**/*.java, **/package.htm*" />
|
|
181 |
</copy>
|
|
182 |
|
|
183 |
<!-- Copy necessary resources -->
|
|
184 |
<copy todir="${cache.folder}" failonerror="true" overwrite="false">
|
|
185 |
<fileset dir="${cache.folder}/src/" excludes="**/*.java, **/package.htm*" />
|
|
186 |
</copy>
|
|
187 |
|
|
188 |
<!-- Copy necessary resources -->
|
|
189 |
<copy todir="${ifsheets.folder}" failonerror="true" overwrite="false">
|
|
190 |
<fileset dir="${ifsheets.folder}/src/" excludes="**/*.java, **/package.htm*" />
|
|
191 |
</copy>
|
|
192 |
|
|
193 |
<!-- Copy necessary resources -->
|
|
194 |
<copy todir="${web.folder}" failonerror="true" overwrite="false">
|
|
195 |
<fileset dir="${web.folder}/src/" excludes="**/*.java, **/package.htm*" />
|
|
196 |
</copy>
|
|
197 |
|
|
198 |
<!-- Create build result folder -->
|
|
199 |
<mkdir dir="${build.result.folder}"/>
|
|
200 |
|
|
201 |
</target>
|
|
202 |
|
|
203 |
|
|
204 |
<!-- JAR target -->
|
|
205 |
<target name="jar" depends="build" description="Create JAR">
|
|
206 |
|
|
207 |
<!-- Create JARs -->
|
|
208 |
<zip destfile="../plugins/${jar.filename}">
|
|
209 |
<fileset dir="${build.result.folder}">
|
|
210 |
<include name="META-INF/**"/>
|
|
211 |
<include name="com/**"/>
|
|
212 |
<include name="resources/**"/>
|
|
213 |
<include name="icons/**"/>
|
|
214 |
<include name="plugin.xml"/>
|
|
215 |
<include name="about.html"/>
|
|
216 |
<include name="about.ini"/>
|
|
217 |
<include name="about.mappings"/>
|
|
218 |
<include name="about.properties"/>
|
|
219 |
<include name="plugin.properties"/>
|
|
220 |
</fileset>
|
|
221 |
</zip>
|
|
222 |
|
|
223 |
<zip destfile="../plugins/${cache.jar.filename}">
|
|
224 |
<fileset dir="${cache.folder}">
|
|
225 |
<include name="META-INF/**"/>
|
|
226 |
<include name="com/**"/>
|
|
227 |
<include name="about.html"/>
|
|
228 |
<include name="plugin.xml"/>
|
|
229 |
</fileset>
|
|
230 |
</zip>
|
|
231 |
|
|
232 |
<zip destfile="../plugins/${ifsheets.jar.filename}">
|
|
233 |
<fileset dir="${ifsheets.folder}">
|
|
234 |
<include name="META-INF/**"/>
|
|
235 |
<include name="com/**"/>
|
|
236 |
<include name="about.html"/>
|
|
237 |
<include name="plugin.xml"/>
|
|
238 |
<include name="os/**"/>
|
|
239 |
</fileset>
|
|
240 |
</zip>
|
|
241 |
|
|
242 |
<zip destfile="../plugins/${web.jar.filename}">
|
|
243 |
<fileset dir="${web.folder}">
|
|
244 |
<include name="META-INF/**"/>
|
|
245 |
<include name="com/**"/>
|
|
246 |
<include name="plugin.xml"/>
|
|
247 |
<include name="about.html"/>
|
|
248 |
<include name="resources/default_server_entries.xml"/>
|
|
249 |
</fileset>
|
|
250 |
</zip>
|
|
251 |
|
|
252 |
</target>
|
|
253 |
|
|
254 |
|
|
255 |
<!-- Instrumentation target, depends on JAR -->
|
|
256 |
<target name="instr" depends="jar">
|
|
257 |
<!-- Instrument the source code -->
|
|
258 |
<emma>
|
|
259 |
<instr instrpath="com" destdir="${instr.folder}" metadatafile="${reports.emma}/metadata.emma" merge="true"/>
|
|
260 |
<instr instrpath="${cache.folder}/com" destdir="${instr.folder}" metadatafile="${reports.emma}/metadata.emma" merge="true"/>
|
|
261 |
<instr instrpath="${ifsheets.folder}/com" destdir="${instr.folder}" metadatafile="${reports.emma}/metadata.emma" merge="true"/>
|
|
262 |
<instr instrpath="${web.folder}/com" destdir="${instr.folder}" metadatafile="${reports.emma}/metadata.emma" merge="true"/>
|
|
263 |
</emma>
|
|
264 |
</target>
|
|
265 |
|
|
266 |
|
|
267 |
|
|
268 |
<!-- Feature target -->
|
|
269 |
<target name="feature" depends="jar" description="Create feature">
|
|
270 |
<property name="feature.folder" location="${binaries.folder}/feature"/>
|
|
271 |
|
|
272 |
|
|
273 |
<mkdir dir="${feature.folder}"/>
|
|
274 |
<mkdir dir="${feature.folder}/plugins"/>
|
|
275 |
<mkdir dir="${feature.folder}/features/${feature.project.name}"/>
|
|
276 |
<mkdir dir="${binaries.folder}/nightly_builds"/>
|
|
277 |
|
|
278 |
<!-- Create help JAR -->
|
|
279 |
<zip destfile="../plugins/${help.jar.filename}" basedir="../${help.project.name}" excludes="src/,.*"/>
|
|
280 |
<zip destfile="../plugins/${help.cache.filename}" basedir="../${help.cache.name}" excludes="src/,.*"/>
|
|
281 |
<zip destfile="../plugins/${help.ifsheets.filename}" basedir="../${help.ifsheets.name}" excludes="src/,.*"/>
|
|
282 |
<zip destfile="../plugins/${help.web.filename}" basedir="../${help.web.name}" excludes="src/,.*"/>
|
|
283 |
|
|
284 |
<!-- Copy feature stuff to the temp folder -->
|
|
285 |
<copy todir="${feature.folder}/features/${feature.project.name}" file="${feature.project.folder}/feature.xml"/>
|
|
286 |
<copy todir="${feature.folder}/features/${feature.project.name}" file="${feature.project.folder}/license.txt"/>
|
|
287 |
|
|
288 |
|
|
289 |
|
|
290 |
<exec dir="../" executable="bash" resolveexecutable="true" failonerror="true">
|
|
291 |
<arg value="-c"/>
|
|
292 |
<arg value="C:\\hudson\\jobs\\setPluginVersion.sh ${ant.project.name}"/>
|
|
293 |
</exec>
|
|
294 |
<exec dir="../" executable="bash" resolveexecutable="true" failonerror="true">
|
|
295 |
<arg value="-c"/>
|
|
296 |
<arg value="C:\\hudson\\jobs\\setPluginVersion.sh ${ant.project.name}.help"/>
|
|
297 |
</exec>
|
|
298 |
<exec dir="../" executable="bash" resolveexecutable="true" failonerror="true">
|
|
299 |
<arg value="-c"/>
|
|
300 |
<arg value="C:\\hudson\\jobs\\setPluginVersion.sh ${ant.project.name}.cache"/>
|
|
301 |
</exec>
|
|
302 |
<exec dir="../" executable="bash" resolveexecutable="true" failonerror="true">
|
|
303 |
<arg value="-c"/>
|
|
304 |
<arg value="C:\\hudson\\jobs\\setPluginVersion.sh ${ant.project.name}.cache.help"/>
|
|
305 |
</exec>
|
|
306 |
<exec dir="../" executable="bash" resolveexecutable="true" failonerror="true">
|
|
307 |
<arg value="-c"/>
|
|
308 |
<arg value="C:\\hudson\\jobs\\setPluginVersion.sh ${ant.project.name}.ifsheets"/>
|
|
309 |
</exec>
|
|
310 |
<exec dir="../" executable="bash" resolveexecutable="true" failonerror="true">
|
|
311 |
<arg value="-c"/>
|
|
312 |
<arg value="C:\\hudson\\jobs\\setPluginVersion.sh ${ant.project.name}.ifsheets.help"/>
|
|
313 |
</exec>
|
|
314 |
<exec dir="../" executable="bash" resolveexecutable="true" failonerror="true">
|
|
315 |
<arg value="-c"/>
|
|
316 |
<arg value="C:\\hudson\\jobs\\setPluginVersion.sh ${ant.project.name}.web"/>
|
|
317 |
</exec>
|
|
318 |
<exec dir="../" executable="bash" resolveexecutable="true" failonerror="true">
|
|
319 |
<arg value="-c"/>
|
|
320 |
<arg value="C:\\hudson\\jobs\\setPluginVersion.sh ${ant.project.name}.web.help"/>
|
|
321 |
</exec>
|
|
322 |
|
|
323 |
|
|
324 |
|
|
325 |
<!-- Copy the actual plug-in to the feature folder -->
|
|
326 |
<copy todir="${feature.folder}/plugins">
|
|
327 |
<fileset dir="../plugins"/>
|
|
328 |
</copy>
|
|
329 |
|
|
330 |
|
|
331 |
<!-- Copy the actual plug-ins to the carbide folders -->
|
|
332 |
<copy todir="${carbide.int.folder}" failonerror="true" overwrite="true">
|
|
333 |
<fileset dir="${feature.folder}/plugins"/>
|
|
334 |
</copy>
|
|
335 |
<copy todir="${carbide.dev.folder}" failonerror="true" overwrite="true">
|
|
336 |
<fileset dir="${feature.folder}/plugins"/>
|
|
337 |
</copy>
|
|
338 |
<copy todir="${carbide.adt.folder}" failonerror="true" overwrite="true">
|
|
339 |
<fileset dir="${feature.folder}/plugins"/>
|
|
340 |
</copy>
|
|
341 |
|
|
342 |
</target>
|
|
343 |
|
|
344 |
<!-- Analyze target -->
|
|
345 |
<target name="analyze">
|
|
346 |
<!-- PMD -->
|
|
347 |
<pmd>
|
|
348 |
<!-- Rules -->
|
|
349 |
<ruleset>basic</ruleset>
|
|
350 |
<ruleset>codesize</ruleset>
|
|
351 |
<ruleset>coupling</ruleset>
|
|
352 |
<ruleset>design</ruleset>
|
|
353 |
<ruleset>strictexception</ruleset>
|
|
354 |
<ruleset>strings</ruleset>
|
|
355 |
<ruleset>sunsecure</ruleset>
|
|
356 |
<ruleset>unusedcode</ruleset>
|
|
357 |
<ruleset>junit</ruleset>
|
|
358 |
|
|
359 |
<!-- XML output -->
|
|
360 |
<formatter type="xml" toFile="${reports.folder}/report.pmd.xml"/>
|
|
361 |
<formatter type="html" toFile="${reports.folder}/report.pmd.html"/>
|
|
362 |
|
|
363 |
<!-- Files to analyze -->
|
|
364 |
<fileset dir="src/">
|
|
365 |
<include name="**/*.java"/>
|
|
366 |
</fileset>
|
|
367 |
<fileset dir="${test.folder}">
|
|
368 |
<include name="**/*.java"/>
|
|
369 |
</fileset>
|
|
370 |
<fileset dir="${cache.folder}/src/">
|
|
371 |
<include name="**/*.java"/>
|
|
372 |
</fileset>
|
|
373 |
<fileset dir="${test.cache.folder}/src/">
|
|
374 |
<include name="**/*.java"/>
|
|
375 |
</fileset>
|
|
376 |
<fileset dir="${ifsheets.folder}/src/">
|
|
377 |
<include name="**/*.java"/>
|
|
378 |
</fileset>
|
|
379 |
<fileset dir="${test.ifsheets.folder}/src/">
|
|
380 |
<include name="**/*.java"/>
|
|
381 |
</fileset>
|
|
382 |
<fileset dir="${web.folder}/src/">
|
|
383 |
<include name="**/*.java"/>
|
|
384 |
</fileset>
|
|
385 |
<fileset dir="${test.web.folder}/src/">
|
|
386 |
<include name="**/*.java"/>
|
|
387 |
</fileset>
|
|
388 |
</pmd>
|
|
389 |
</target>
|
|
390 |
|
|
391 |
<!-- Clean tests target -->
|
|
392 |
<target name="clean-test" description="Clean test">
|
|
393 |
<delete>
|
|
394 |
<fileset dir="${test.folder}" includes="**/*.class" />
|
|
395 |
</delete>
|
|
396 |
<delete dir="${instr.folder}"/>
|
|
397 |
<delete dir="${reports.folder}"/>
|
|
398 |
</target>
|
|
399 |
|
|
400 |
<!-- Test target, depends on instrumentation and analyze -->
|
|
401 |
<target name="test" depends="instr" description="Run unit tests">
|
|
402 |
<!-- Test classpath -->
|
|
403 |
<path id="test_classpath">
|
|
404 |
<!-- Test classes -->
|
|
405 |
<pathelement location="${test.folder}/src"/>
|
|
406 |
<pathelement location="${test.cache.folder}/src"/>
|
|
407 |
<pathelement location="${test.ifsheets.folder}/src"/>
|
|
408 |
<pathelement location="${test.web.folder}/src"/>
|
|
409 |
|
|
410 |
<!-- Instrumented class files -->
|
|
411 |
<pathelement location="${instr.folder}"/>
|
|
412 |
|
|
413 |
<!-- EMMA -->
|
|
414 |
<pathelement path="${ant.home}/lib/emma.jar"/>
|
|
415 |
|
|
416 |
<fileset dir="${carbide.adt.folder}" includes="**/*.jar" />
|
|
417 |
</path>
|
|
418 |
|
|
419 |
<!-- Compile the tests -->
|
|
420 |
<javac srcdir="${test.folder}" verbose="${javacVerbose}">
|
|
421 |
<classpath refid="test_classpath"/>
|
|
422 |
</javac>
|
|
423 |
<javac srcdir="${test.cache.folder}" verbose="${javacVerbose}">
|
|
424 |
<classpath refid="test_classpath"/>
|
|
425 |
</javac>
|
|
426 |
<javac srcdir="${test.ifsheets.folder}" verbose="${javacVerbose}">
|
|
427 |
<classpath refid="test_classpath"/>
|
|
428 |
</javac>
|
|
429 |
<javac srcdir="${test.web.folder}" verbose="${javacVerbose}">
|
|
430 |
<classpath refid="test_classpath"/>
|
|
431 |
</javac>
|
|
432 |
|
|
433 |
<!-- Run JUnit -->
|
|
434 |
<junit printsummary="yes" fork="yes" haltonfailure="no">
|
|
435 |
<classpath refid="test_classpath" />
|
|
436 |
|
|
437 |
<!-- Plain format and XML -->
|
|
438 |
<formatter type="plain" />
|
|
439 |
<formatter type="xml" />
|
|
440 |
|
|
441 |
<!-- Instrumentation arguments to JVM -->
|
|
442 |
<jvmarg value="-Demma.coverage.out.file=${reports.emma}/coverage.emma" />
|
|
443 |
<jvmarg value="-Demma.coverage.out.merge=true" />
|
|
444 |
<jvmarg value="-D_S60TOOLS_WS_PATH=C:\hudson\jobs\APIQuery\workspace\trunk" />
|
|
445 |
|
|
446 |
<!-- Test classes -->
|
|
447 |
<test name="com.nokia.s60tools.apiquery.tests.AllPureJUnitTests" todir="${reports.folder}"/>
|
|
448 |
<test name="com.nokia.s60tools.apiquery.cache.tests.AllPureJUnitTests" todir="${reports.folder}"/>
|
|
449 |
<test name="com.nokia.s60tools.apiquery.ifsheets.tests.AllPureJUnitTests" todir="${reports.folder}"/>
|
|
450 |
<test name="com.nokia.s60tools.apiquery.web.tests.AllPureJUnitTests" todir="${reports.folder}"/>
|
|
451 |
</junit>
|
|
452 |
|
|
453 |
<!-- Create EMMA report -->
|
|
454 |
<emma>
|
|
455 |
<report sourcepath="src/" >
|
|
456 |
<fileset dir="${reports.emma}" >
|
|
457 |
<include name="*.emma" />
|
|
458 |
</fileset>
|
|
459 |
<xml outfile="${reports.emma}/coverage.xml" />
|
|
460 |
<html outfile="${reports.emma}/coverage.html" />
|
|
461 |
</report>
|
|
462 |
</emma>
|
|
463 |
|
|
464 |
<copy todir="${binaries.folder}/reports" failonerror="true" overwrite="true">
|
|
465 |
<fileset dir="${reports.folder}" />
|
|
466 |
</copy>
|
|
467 |
|
|
468 |
</target>
|
|
469 |
|
|
470 |
<!-- Make zip package of the feature and plugins -->
|
|
471 |
<target name="zip">
|
|
472 |
|
|
473 |
<!-- Create the feature zip -->
|
|
474 |
<zip destfile="${binaries.folder}/${feature.name}.zip" basedir="${feature.folder}"/>
|
|
475 |
|
|
476 |
<delete dir="${feature.folder}"/>
|
|
477 |
|
|
478 |
<!-- Nightly build -->
|
|
479 |
<tstamp>
|
|
480 |
<format property="timestamp" pattern="dd-MM-yyyy" />
|
|
481 |
</tstamp>
|
|
482 |
|
|
483 |
<delete dir="${binaries.folder}/nightly_builds"/>
|
|
484 |
<mkdir dir="${binaries.folder}/nightly_builds"/>
|
|
485 |
|
|
486 |
<copy tofile="${binaries.folder}/nightly_builds/${feature.name}-${timestamp}.zip" file="${binaries.folder}/${feature.name}.zip"/>
|
|
487 |
|
|
488 |
</target>
|
|
489 |
|
|
490 |
</project>
|