-
Notifications
You must be signed in to change notification settings - Fork 144
/
build.xml
91 lines (81 loc) · 2.95 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
<project name="mappedbus" default="dist" basedir=".">
<description>
MappedBus
</description>
<!-- set global properties for this build -->
<property name="version" value="0.5.1"/>
<property name="ant.project.name" value="mappedbus"/>
<property name="main_class_name" value="changeme"/>
<property name="jarname" value="${ant.project.name}"/>
<!-- set directories -->
<property name="src" location="src/main"/>
<property name="sample" location="src/sample"/>
<property name="perf" location="src/perf"/>
<property name="test" location="test"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="lib" location="lib"/>
<path id="project.classpath">
<pathelement location="${build}" />
<!-- <fileset dir="${lib}" includes="**/*.jar"/> -->
</path>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create directories if needed -->
<mkdir dir="${src}"/>
<mkdir dir="${test}"/>
<mkdir dir="${build}"/>
<mkdir dir="${dist}"/>
</target>
<target name="compile" depends="init" description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac debug="true"
srcdir="${src}:${sample}:${perf}"
destdir="${build}"
source="1.7"
target="1.7"
classpathref="project.classpath"/>
<!-- Copy files from ${src} into ${build} -->
<copy todir="${build}">
<fileset dir="${src}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="test" depends="compiletest" description="run the tests " >
<junit printsummary="yes" fork="yes" haltonfailure="yes">
<formatter type="plain"/>
<batchtest fork="true">
<fileset dir="${test}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
<classpath refid="project.classpath" />
</junit>
</target>
<target name="compiletest" depends="compile"
description="compile the tests " >
<javac debug="true"
srcdir="${test}"
destdir="${build}"
classpathref="project.classpath" />
</target>
<target name="dist" depends="compile" description="generate the distribution" >
<!-- Create the distribution directory -->
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
<jar jarfile="${dist}/${jarname}-${version}.jar" basedir="${build}">
<manifest>
<attribute name="Main-Class"
value="${main_class_name}"/>
</manifest>
<fileset dir="${src}" includes="**/*.java"/>
</jar>
<copy file="${dist}/${jarname}-${version}.jar" tofile="./${jarname}.jar" overwrite="true"/>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} directory-->
<delete dir="${build}"/>
</target>
</project>