-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
64 lines (52 loc) · 1.96 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
<project name="groovy_experiments" default="test" basedir=".">
<path id="lib.classpath">
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</path>
<path id="test.classpath">
<pathelement location="gen/classes" />
<path refid="lib.classpath"/>
</path>
<target name="clean" description="clean up">
<delete dir="gen"/>
</target>
<target name="compile" depends="compile-source,compile-resources"/>
<target name="compile-resources" description="compile the resources ">
<copy toDir="gen/classes">
<fileSet dir="test">
<include name="**/*.txt"/>
</fileSet>
</copy>
</target>
<target name="compile-source" description="compile the source ">
<taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpathref="lib.classpath"/>
<mkdir dir="gen/classes"/>
<groovyc destdir="gen/classes" classpathref="lib.classpath">
<src path="test"/>
<javac source="1.7" target="1.7" debug="on"/>
</groovyc>
</target>
<taskdef
name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"
classpathref="lib.classpath" />
<property name="test.pattern" value="**/*Test.class" />
<property name="test.formatter" value="xml"/>
<property name="test.useFile" value="true"/>
<target name="test" depends="compile" description="Run unit tests">
<delete dir="gen/unit" />
<mkdir dir="gen/unit" />
<junit printsummary="yes" failureproperty="junit.failure" haltonerror="no" haltonfailure="no" fork="yes">
<formatter type="${test.formatter}" usefile="${test.useFile}" />
<batchtest todir="gen/unit">
<fileset dir="gen/classes">
<include name="${test.pattern}" />
<exclude name="**/HTTPBuilderTest.class"/>
</fileset>
</batchtest>
<classpath refid="test.classpath" />
</junit>
<fail if="junit.failure" message="JUNIT tests failed."/>
</target>
</project>