forked from aglover/moo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
119 lines (104 loc) · 4.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
<project name="moo" basedir="." default="jar">
<property name="version" value="1.0"/>
<property name="lib.dir" value="lib"/>
<property name="build.dir" value="target"/>
<property name="build.test.dir" value="${build.dir}/test"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property file="local.properties"/>
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="compile"
description="compiles source code and puts classes in target/ directory">
<mkdir dir="${classes.dir}"/>
<javac includeantruntime="false" srcdir="src" destdir="${classes.dir}"
debug="true" classpathref="classpath">
<classpath>
<path refid="classpath"/>
</classpath>
</javac>
</target>
<target name="jar" depends="test" description="creates jar file for distribution">
<jar destfile="${build.dir}/${ant.project.name}-${version}.jar">
<fileset dir="${classes.dir}" includes="**/*.class"/>
</jar>
</target>
<target name="compile-all-tests" depends="compile">
<mkdir dir="${build.dir}/test-classes"/>
<javac srcdir="test/unit" destdir="${build.dir}/test-classes"
includeAntRuntime="false" source="1.6" debug="true">
<classpath>
<path refid="classpath"/>
<pathelement path="${classes.dir}"/>
</classpath>
</javac>
<javac srcdir="test/functional" destdir="${build.dir}/test-classes"
includeAntRuntime="false" source="1.6" debug="true">
<classpath>
<path refid="classpath"/>
<pathelement path="${classes.dir}"/>
</classpath>
</javac>
</target>
<target name="test" depends="compile-all-tests" description="runs JUnit tests">
<junit fork="true" forkmode="once" haltonfailure="false" haltonerror="false"
failureproperty="tests.failures" errorproperty="tests.errors"
includeantruntime="true" showoutput="true" printsummary="true">
<classpath>
<path refid="classpath"/>
<pathelement path="${classes.dir}"/>
<pathelement path="${build.dir}/test-classes"/>
</classpath>
<formatter type="xml"/>
<formatter type="plain" usefile="false"/>
<batchtest fork="yes" todir="./${build.dir}/">
<fileset dir="test/unit">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
<mkdir dir="./${build.dir}/reports"/>
<junitreport todir="./${build.dir}/reports">
<fileset dir="./${build.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="./${build.dir}/reports/html"/>
</junitreport>
<fail if="tests.failures"
message="There were JUnit failures -- see the reports in ./${build.dir}/reports"/>
</target>
<target name="functional-test" depends="compile-all-tests" description="runs JUnit functional tests">
<junit fork="true" forkmode="once" haltonfailure="false" haltonerror="false"
failureproperty="tests.failures" errorproperty="tests.errors"
includeantruntime="true" showoutput="true" printsummary="true">
<classpath>
<path refid="classpath"/>
<pathelement path="${classes.dir}"/>
<pathelement path="${build.dir}/test-classes"/>
</classpath>
<formatter type="xml"/>
<!-- see local.properties and/or default.properties -->
<sysproperty key="key" value="${aws.key}"/>
<sysproperty key="secret" value="${aws.secret}"/>
<sysproperty key="queue" value="${aws.queue}"/>
<formatter type="plain" usefile="false"/>
<batchtest fork="yes" todir="./${build.dir}/">
<fileset dir="test/functional">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
<mkdir dir="./${build.dir}/reports"/>
<junitreport todir="./${build.dir}/reports">
<fileset dir="./${build.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="./${build.dir}/reports/html"/>
</junitreport>
<fail if="tests.failures"
message="There were JUnit failures -- see the reports in ./${build.dir}/reports"/>
</target>
</project>