-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
87 lines (78 loc) · 2.59 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
<project name="Shannon Calc" default="dist" basedir=".">
<description>
Shannon Calc Build File
</description>
<!-- set global properties for this build -->
<property name="name" value="shannon-calc" />
<loadfile srcfile="${basedir}/VERSION" property="version">
<filterchain>
<striplinebreaks />
</filterchain>
</loadfile>
<!-- include any user specific or environment specifc build properties -->
<property file="${user.home}/build.properties"/>
<property file="${basedir}/build.properties"/>
<!-- ensure that 'hadoop.path' is set -->
<fail message="Please define the 'hadoop.path' and 'pig.path' properties in the 'build.properties' file">
<condition>
<or>
<not>
<isset property="hadoop.path"/>
</not>
<not>
<isset property="pig.path"/>
</not>
</or>
</condition>
</fail>
<property name="lib" location="lib" />
<property name="src" location="src" />
<property name="build" location="build"/>
<property name="dist" location="dist" />
<target name="init">
<tstamp/>
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init"
description="compile the source" >
<echo message=""/>
<echo message="Building '${name}': Version ${version}"/>
<echo message=""/>
<javac srcdir="${src}" destdir="${build}" debug="on"
debuglevel="lines,vars,source" target="1.6" includeantruntime="false">
<compilerarg value="-Xlint"/>
<classpath>
<pathelement path="${classpath}"/>
<fileset dir="${hadoop.path}">
<include name="**/commons-logging-*.jar"/>
<include name="**/hadoop-core-*.jar"/>
<include name="**/log4j-*.jar"/>
<include name="**/junit-*.jar"/>
<include name="**/commons-io-*.jar"/>
</fileset>
<fileset dir="${pig.path}">
<include name="**/pig-*withouthadoop.jar"/>
</fileset>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<mkdir dir="${dist}/lib"/>
<mkdir dir="${build}/lib"/>
<jar jarfile="${dist}/lib/${name}-${version}.jar" basedir="${build}">
<zipfileset dir="lib" prefix="lib" >
<include name="**/*.jar" />
</zipfileset>
</jar>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>