What's new? | Help | Directory | Sign in
Google
  
  
  
  
    
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
<?xml version="1.0"?>

<project name="<<PROJECT NAME>>" default="build" basedir=".">

<!-- load properties first -->
<!--<property file="${user.home}/${name}.build.properties" />-->
<!--<property file="${root}/build.properties" />-->

<!-- these are optional, only used if you uncomment the project.class.path filesets below -->
<property name="hadoop.root" location="${basedir}/../hadoop"/>
<property name="hadoop.lib" location="${hadoop.root}/lib"/>


<!-- assumes Cascading shares the same parent directory, change if necessary -->
<property name="cascading.root" location="${basedir}/../cascading"/>
<property file="${cascading.root}/version.properties"/>
<property name="cascading.release.version" value="x.y.z"/>
<property name="cascading.filename" value="cascading-lib-${cascading.release.version}.jar"/>
<property name="cascading.libs" value="${cascading.root}/lib"/>

<condition property="cascading.lib" value="${cascading.root}/${cascading.filename}"
else="${cascading.root}/build/${cascading.filename}">
<available file="${cascading.root}/${cascading.filename}"/>
</condition>

<property name="src.dir" location="${basedir}/src/java"/>
<property name="src.test" location="${basedir}/src/test"/>

<available file="${src.dir}" type="dir" property="main.available"/>
<available file="${src.test}" type="dir" property="test.available"/>

<property name="conf.dir" location="${hadoop.root}/conf"/>

<property name="lib.dir" location="${basedir}/lib"/>

<property name="build.dir" location="${basedir}/build/"/>
<property name="build.classes" location="${build.dir}/classes"/>
<property name="build.test" location="${build.dir}/test"/>

<property name="dist" location="dist"/>

<path id="project.class.path">
<pathelement location="${build.classes}"/>
<pathelement location="${build.test}"/>
<pathelement location="${cascading.lib}"/>

<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>

<!-- only enable if you directly access Hadoop code in your project -->
<!--<fileset dir="${hadoop.lib}">-->
<!--<include name="*.jar"/>-->
<!--</fileset>-->

<!--<fileset dir="${hadoop.root}">-->
<!--<include name="*.jar"/>-->
<!--</fileset>-->

</path>


<target name="clean">

<echo message="cleaning..."/>
<delete dir="${build.dir}"/>
<delete dir="${dist}"/>
<delete dir="${ant.project.name}.tgz"/>

</target>

<target name="build">

<echo message="building..."/>
<echo message="using cascading lib: ${cascading.lib}"/>
<mkdir dir="${build.classes}"/>
<mkdir dir="${lib.dir}"/>

<javac srcdir="${src.dir}" destdir="${build.classes}" verbose="off">
<classpath refid="project.class.path"/>
</javac>

<copy todir="${build.classes}">
<fileset dir="${src.dir}">
<exclude name="**/*.java"/>
</fileset>
</copy>

</target>

<target name="jar" depends="build" description="creates a Hadoop ready jar will all dependencies">

<!-- copy Cascading classes and libraries -->
<copy todir="${build.classes}/lib" file="${cascading.lib}"/>
<copy todir="${build.classes}/lib">
<fileset dir="${cascading.libs}" includes="*.jar"/>
</copy>


<jar jarfile="${build.dir}/${ant.project.name}.jar">
<fileset dir="${build.classes}"/>
<fileset dir="${basedir}" includes="lib/"/>
<manifest>
<attribute name="Main-Class" value="${ant.project.name}/Main"/>
</manifest>
</jar>

</target>

<target name="dist" depends="clean" description="packages current project">

<mkdir dir="${dist}"/>

<copy todir="${dist}">

<fileset dir=".">
<include name="data/**"/>
<include name="src/**"/>
<include name="lib/**"/>
<include name="build.xml"/>
<include name="README.TXT"/>
</fileset>

</copy>

</target>

<target name="tar" depends="dist" description="creates an archive of current project">
<tar destfile="${ant.project.name}.tgz"
compression="gzip">
<tarfileset dir="dist/" prefix="${ant.project.name}">
<include name="**/**"/>
</tarfileset>
</tar>
</target>


</project>
Show details Hide details

Change log

r168 by cwensel on Apr 07, 2008   Diff
updated build files
Go to: 
Sign in to write a code review

Older revisions

r139 by cwensel on Mar 29, 2008   Diff
updated for latest Cascading
r29 by cwensel on Jan 24, 2008   Diff
import sample applications
All revisions of this file

File info

Size: 4223 bytes, 138 lines