-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
118 lines (100 loc) · 3.6 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Ant build file for spiderpig
-->
<project basedir="." default="build" name="spiderpig"
xmlns:ivy="antlib:org.apache.ivy.ant">
<property file="build.properties" />
<!-- CLEAN -->
<target name="clean">
<delete dir="${classes.dir}" />
<delete dir="${src.gen.dir}" />
<delete file="${dist.jar}" />
</target>
<!-- END CLEAN -->
<!-- IVY DEPS -->
<target name="deps">
<mkdir dir="${lib.dir}"/>
<ivy:retrieve/>
</target>
<target name="ivyclean">
<ivy:cleancache/>
<delete dir="${lib.dir}"/>
</target>
<!-- END IVY -->
<!-- BUILD -->
<target name="build" depends="proto">
<mkdir dir="${classes.dir}" />
<path id="build.classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${lib-static.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<javac srcdir="${src.dir}:${test.dir}:${src.gen.dir}"
destdir="${classes.dir}" target="${build.target}" optimize="on"
source="${build.source}" debug="on" debuglevel="lines,vars,source"
includeantruntime="false">
<classpath> <path refid="build.classpath"/> </classpath>
<include name="**" />
</javac>
<manifestclasspath property="manifest.classpath" jarfile="${dist.jar}">
<classpath refid="build.classpath"/>
</manifestclasspath>
<jar destfile="${dist.jar}">
<fileset dir="${classes.dir}">
<include name="**/*.class" />
</fileset>
<manifest>
<attribute name="Main-Class"
value="br.ufmg.dcc.vod.spiderpig.ui.Main"/>
<attribute name="Class-Path" value="${manifest.classpath}" />
</manifest>
</jar>
</target>
<!-- END BUILD -->
<!-- PROTOCOL BUFFERS -->
<target name="proto" depends="clean">
<mkdir dir="${src.gen.dir}" />
<exec executable="${protoc.cmd}">
<arg value="--proto_path=${src.proto.dir}"/>
<arg value="${src.proto.dir}/worker.proto"/>
<arg value="${src.proto.dir}/ids.proto"/>
<arg value="${src.proto.dir}/fd.proto"/>
<arg value="--java_out=${src.gen.dir}"/>
</exec>
</target>
<!-- END PROTOCOL BUFFERS -->
<!-- UNIT TESTS -->
<target name="tests" depends="build">
<junit fork="true">
<classpath>
<pathelement location="${classes.dir}"/>
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
<batchtest fork="yes">
<fileset dir="${test.dir}">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- END UNIT TESTS -->
<!-- HELP -->
<target name="help" description="prints target descriptions">
<echo message="Tasks:" />
<echo message="" />
<echo message="ant build (default) : complete system build." />
<echo message="ant clean : clean up a previous build." />
<echo message="ant deps : download dependecies using ivy." />
<echo message="ant ivyclean : delete dependecies using ivy." />
<echo message="ant help : prints this help." />
<echo message="ant proto : compiles protocol buffers." />
<echo message="ant tests : runs unit tests." />
</target>
<!-- END_HELP -->
</project>