-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.xml
125 lines (112 loc) · 4.3 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
120
121
122
123
124
125
<project name="distributed-fs" default="build" basedir=".">
<description>Distributed FS</description>
<property name="src" value="src" />
<property name="src.tests.unit" value="test/unit" />
<property name="src.tests.integration" value="test/integration" />
<property name="build" value="bin" />
<property name="dist" value="dist" />
<property name="lib" value="lib" />
<property name="thrift-rb" value="gen-rb" />
<property name="thrift-py" value="gen-py" />
<property name="thrift-java" value="gen-javabean" />
<property name="reports.test" value="test_reports" />
<property name="jar-file" value="donut.jar" />
<property name="zip-file" value="donut-src.zip" />
<property environment="env" />
<path id="project.class.path">
<pathelement path="${build}" />
<fileset dir="${lib}">
<filename name="*.jar" />
</fileset>
</path>
<target name="thrift">
<tstamp />
<echo message="Generating thrift sources" />
<exec executable="thrift" failonerror="true">
<arg line="-r -v -gen rb -gen java:beans,hashcode" />
<arg file="thrift/key_locator.thrift" />
</exec>
<exec executable="thrift" failonerror="true">
<arg line="-r -v -gen rb -gen py -gen java:beans,hashcode" />
<arg file="thrift/hash_service.thrift" />
</exec>
<exec executable="thrift" failonerror="true">
<arg line="-r -v -gen rb -gen py -gen java:beans,hashcode" />
<arg file="thrift/exceptions.thrift" />
</exec>
</target>
<target name="init">
<tstamp />
<mkdir dir="${build}" />
</target>
<target name="jar" depends="build">
<mkdir dir="${dist}"/>
<jar destfile="${dist}/${jar-file}" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="edu.washington.cs.cse490h.donut.Donut" />
<attribute name="Class-Path" value="." />
</manifest>
<fileset dir="${build}" />
<fileset dir="${lib}" />
<zipfileset excludes="META-INF/*.SF" src="${lib}/libthrift.jar" />
<zipfileset excludes="META-INF/*.SF" src="${lib}/junit-4.1.jar" />
<zipfileset excludes="META-INF/*.SF" src="${lib}/guice-1.0.jar" />
<zipfileset excludes="META-INF/*.SF" src="${lib}/easymock.jar" />
<zipfileset excludes="META-INF/*.SF" src="${lib}/commons-lang-2.4.jar" />
<zipfileset excludes="META-INF/*.SF" src="${lib}/args4j-2.0.11.jar" />
<zipfileset excludes="META-INF/*.SF" src="${lib}/log4j-1.2.15.jar" />
</jar>
</target>
<target name="src" depends="clean">
<mkdir dir="${dist}"/>
<zip destfile="${dist}/${zip-file}" update="true">
<fileset dir="." />
</zip>
</target>
<target name="dist" depends="clean, src, jar"/>
<target name="build" depends="thrift,init">
<javac destdir="${build}" classpathref="project.class.path" source="1.5" failonerror="true">
<src path="${src}" />
<src path="${thrift-java}" />
<src path="${src.tests.unit}" />
<src path="${src.tests.integration}" />
</javac>
</target>
<target name="clean">
<delete includeemptydirs="true" quiet="true">
<fileset dir="${thrift-java}" />
<fileset dir="${thrift-rb}" />
<fileset dir="${thrift-py}" />
<fileset dir="${build}" />
<fileset dir="${dist}" />
<fileset dir="${reports.test}" />
<fileset file="${jar-file}" />
</delete>
</target>
<target name="unit-tests" depends="build">
<mkdir dir="${reports.test}" />
<junit printsummary="yes" haltonfailure="yes">
<classpath refid="project.class.path" />
<formatter type="xml" />
<batchtest todir="${reports.test}">
<fileset dir="${src.tests.unit}">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="integration-tests" depends="build">
<mkdir dir="${reports.test}" />
<junit printsummary="yes" haltonfailure="yes">
<classpath refid="project.class.path" />
<formatter type="xml" />
<batchtest todir="${reports.test}">
<fileset dir="${src.tests.integration}">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="test" depends="unit-tests, integration-tests" />
</project>