forked from vicaya/hypertable
-
Notifications
You must be signed in to change notification settings - Fork 19
/
build.xml.in
157 lines (137 loc) · 6.12 KB
/
build.xml.in
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!-- Hypertable -->
<project name="hypertable" default="compile" basedir="@HYPERTABLE_SOURCE_DIR@">
<property name="Name" value="Hypertable"/>
<property name="name" value="hypertable"/>
<property name="version" value="@VERSION@"/>
<property name="final.name" value="${name}-${version}"/>
<property name="examples.name" value="${name}-${version}-examples"/>
<property name="year" value="2008"/>
<property name="src.dir" value="${basedir}/src/java/Core"/>
<property name="thriftsrc.dir" value="${basedir}/src/java/ThriftClient"/>
<property name="mapreducesrc.dir" value="${basedir}/src/java/MapReduce"/>
<property name="hivesrc.dir" value="${basedir}/src/java/Hive"/>
<property name="gensrc.dir" value="${basedir}/src/gen-java"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="examples.dir" value="${basedir}/examples/java"/>
<property name="contrib.dir" value="${basedir}/contrib"/>
<property name="mapred.src" value="${contrib.dir}/java/MapReduce/"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="build.classes" value="${build.dir}/classes"/>
<property name="build.src" value="${build.dir}/src"/>
<!-- javadoc -->
<property name="doc.dir" location="doc" />
<!-- test directory -->
<property name="test.dir" location="test" />
<path id="project.classpath">
<pathelement location="${build.classes}" />
<fileset dir="${lib.dir}">
<!-- Dont prefer thrift jar included with hive -->
<include name="libthrift-*.jar"/>
</fileset>
<fileset dir="${lib.dir}">
<include name="commons-cli-*.jar"/>
<include name="commons-logging-*.jar"/>
<include name="hadoop-*.jar"/>
<include name="hbase-*.jar"/>
<include name="hive-*.jar"/>
<include name="hive-*.jar"/>
<include name="hive-*.jar"/>
<include name="junit-*.jar"/>
<include name="log4j-*.jar"/>
<include name="slf4j-*.jar"/>
<include name="slf4j-*.jar"/>
<include name="zookeeper-*.jar"/>
<exclude name="hypertable-*.jar"/>
</fileset>
</path>
<!-- convert project.classpath to project.mf.classpath (the string needed for the manifest task) -->
<pathconvert property="project.mf.classpath" pathsep=" ">
<path refid="project.classpath" />
<flattenmapper />
</pathconvert>
<!-- Default target: usage. Prints out instructions. -->
<target name="usage" description="Prints out instructions">
<echo message="Welcome to the Hypertable project!" />
<echo message="And for developers:"/>
<echo message="Use 'ant clean' to clean compiled files." />
<echo message="Use 'ant compile' to compile the source code." />
<echo message="Use 'ant jar' to build a release tarball." />
<echo message="Use 'ant test' to run unit tests." />
<echo message= "Classpath ${project.mf.classpath}" />
</target>
<target name="prepare">
<mkdir dir="${build.classes}"/>
</target>
<target name="compile" depends="prepare" description="Standard compile">
<javac srcdir='\${gensrc.dir}' destdir='\${build.classes}'
deprecation='yes' debug='true'>
<classpath refid='project.classpath'/>
</javac>
<javac srcdir='\${thriftsrc.dir}' destdir='\${build.classes}'
deprecation='yes' debug='true'>
<classpath refid='project.classpath'/>
</javac>
<javac srcdir="${src.dir}" destdir="${build.classes}" deprecation="yes"
debug="true">
<classpath refid="project.classpath"/>
</javac>
<javac srcdir="${mapreducesrc.dir}" destdir="${build.classes}" deprecation="yes"
debug="true">
<classpath refid="project.classpath"/>
</javac>
<javac srcdir="${mapred.src}" destdir="${build.classes}" deprecation="yes"
debug="true">
<classpath refid="project.classpath"/>
</javac>
<javac srcdir="${hivesrc.dir}" destdir="${build.classes}" deprecation="yes"
debug="true">
<classpath refid="project.classpath"/>
</javac>
<javac srcdir="${examples.dir}" destdir="${build.classes}" deprecation="yes"
debug="true">
<classpath refid="project.classpath"/>
</javac>
</target>
<!-- ================================================================== -->
<!-- Make hypertable.jar -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name="jar" depends="clean, compile">
<jar destfile="${build.dir}/${final.name}.jar" basedir="${build.classes}" excludes="**/${examples.name}.jar,**/examples/**">
<manifest>
<section name="org/hypertable">
<attribute name="Implementation-Title" value="Hypertable"/>
<attribute name="Implementation-Version" value="${version}"/>
</section>
</manifest>
</jar>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="test" depends="compile" description="Execute tests">
<junit showoutput="true" haltonfailure="true">
<classpath refid="project.classpath" />
<formatter type="brief" usefile="false" />
<batchtest fork="true">
<fileset dir="${build.classes}" includes="**/*Test.class" />
</batchtest>
</junit>
</target>
<target name="examples" depends="jar" description="Example programs">
<mkdir dir="${build.classes}/lib" />
<copy todir="${build.classes}/lib">
<fileset dir="${lib.dir}" includes="*.jar" excludes="hypertable*.jar"/>
<fileset dir="${build.dir}" includes="${final.name}.jar"/>
</copy>
<jar destfile="${build.dir}/${examples.name}.jar" basedir="${build.classes}" includes="**/examples/**/*.class **/${final.name}.jar **/libthrift-*.jar **/commons-httpclient-*.jar" excludes="**/${examples.name}.jar">
<manifest>
<section name="org/hypertable">
<attribute name="Implementation-Title" value="Hypertable"/>
<attribute name="Implementation-Version" value="${version}"/>
</section>
</manifest>
</jar>
</target>
</project>