-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
89 lines (81 loc) · 3.12 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="result-object-mapper" default="dist" basedir=".">
<description>
ORM layer to map the SQL Query results to Java Classes
</description>
<!-- set global properties for this build -->
<property name="project.version" value="0.3.1"/>
<property name="lib" location="lib" />
<property name="src" location="src" />
<property name="build" location="build" />
<property name="dist" location="dist" />
<property name="test" location="test" />
<property name="mock" location="${test}/mock" />
<property name="spec" location="${test}/spec" />
<property name="build.test" location="${build}/test" />
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}" />
</target>
<target name="compile" depends="init,clean,makedir" description="compile the source">
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" debug="on" deprecation="on" includeantruntime="false"/>
<!-- Compile the test mock classes from ${mock} to ${build.spec} -->
<javac srcdir="${mock}" destdir="${build.test}" debug="on" deprecation="on" includeantruntime="false">
<classpath refid="junit.class.path" />
</javac>
<!-- Compile the test code from ${spec} to ${build.spec} -->
<javac srcdir="${spec}" destdir="${build.test}" debug="on" deprecation="on" includeantruntime="false">
<classpath refid="junit.class.path" />
</javac>
</target>
<!-- Create jar file -->
<target name="dist" depends="compile" description="generate the distribution">
<!-- Put everything in ${build} into the ProjectName.${VERSION}.jar file -->
<jar jarfile="${dist}/${ant.project.name}-${project.version}.jar">
<fileset dir="${build}">
<exclude name="test/**"/>
</fileset>
</jar>
</target>
<target name="clean" description="clean up">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}" />
<delete dir="${dist}" />
<delete dir="${build.test}" />
</target>
<!-- Create directories -->
<target name="makedir">
<mkdir dir="${build}" />
<mkdir dir="${dist}" />
<mkdir dir="${build.test}" />
</target>
<!-- unit test -->
<target name="junit" depends="compile">
<junit printsummary="on" fork="true" haltonfailure="yes">
<classpath refid="junit.class.path" />
<classpath location="${build.test}"/>
<formatter type="plain" usefile="false" />
<batchtest todir="${build.test}">
<fileset dir="${spec}">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
</target>
<!-- library path -->
<path id="lib.class.path">
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
</path>
<!-- unit test libary and src class path -->
<path id="junit.class.path">
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
<pathelement location="${build}" />
</path>
</project>