This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.xml
64 lines (55 loc) · 2.51 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="unitils" default="build" xmlns:maven="urn:maven-ant-tasks">
<!-- Performs a clean build and runs the tests -->
<target name="build" description="`Performs a clean build">
<maven target="clean"/>
<maven target="install"/>
<antcall target="run-tests"/>
</target>
<!-- Runs all JUnit tests -->
<target name="run-tests" depends="load-pom" description="Runs all JUnit tests">
<property name="test.outputDirectory" value="${pom.build.directory}/test-output"/>
<mkdir dir="${test.outputDirectory}"/>
<junit printsummary="true" haltonfailure="true" filtertrace="false" showoutput="false" forkmode="perBatch">
<classpath>
<path refid="classpath.test"/>
<path location="${pom.build.outputDirectory}"/>
<path location="${pom.build.testOutputDirectory}"/>
</classpath>
<formatter type="plain"/>
<batchtest todir="${test.outputDirectory}">
<fileset dir="${pom.build.testOutputDirectory}">
<include name="**/*Test.class"/>
<!-- ignore inner classes -->
<exclude name="**/*$*Test.class"/>
<!-- ignore tests in default package -->
<exclude name="*Test.class"/>
<!-- ignore TestNG tests -->
<exclude name="**/*TestNGTest*.class"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- Utility tasks -->
<!-- Loads the unitils pom -->
<target name="load-pom">
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-ant-tasks" classpath="lib/ant/maven-ant-tasks-2.0.8.jar"/>
<maven:pom id="pom" file="pom.xml"/>
<maven:dependencies pomrefid="pom" pathId="classpath.test" filesetId="fileset.test" useScope="test"/>
</target>
<!-- Calls maven for the given target and optional arguments -->
<macrodef name="maven">
<attribute name="target"/>
<attribute name="arg1" default=""/>
<attribute name="arg2" default=""/>
<attribute name="arg3" default=""/>
<sequential>
<exec executable="mvn.bat" searchpath="true" failonerror="true">
<arg value="@{target}"/>
<arg value="@{arg1}"/>
<arg value="@{arg2}"/>
<arg value="@{arg3}"/>
</exec>
</sequential>
</macrodef>
</project>