-
Notifications
You must be signed in to change notification settings - Fork 37
/
build.sample.xml
165 lines (125 loc) · 5.11 KB
/
build.sample.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
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
158
159
160
161
162
163
164
165
<?xml version="1.0"?>
<!--
~ Copyright (c) 2007-2010 Concurrent, Inc. All Rights Reserved.
~
~ Project and contact information: http://www.cascading.org/
~
~ This file is part of the Cascading project.
~
~ Cascading is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ Cascading is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with Cascading. If not, see <http://www.gnu.org/licenses/>.
-->
<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.home" location="${basedir}/../hadoop"/>
<property name="hadoop.lib" location="${hadoop.home}/lib"/>
<!-- assumes Cascading shares the same parent directory, change if necessary -->
<property name="cascading.home" location="${basedir}/../cascading"/>
<property name="cascading.libs" value="${cascading.home}/lib"/>
<property name="cascading.libs.core" value="${cascading.libs}"/>
<property name="cascading.libs.xml" value="${cascading.libs}/xml"/>
<condition property="cascading.path" value="${cascading.home}/build"
else="${cascading.home}">
<available file="${cascading.home}/build"/>
</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.home}/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}"/>
<fileset dir="${cascading.path}">
<include name="cascading-core-*.jar"/>
<include name="cascading-xml-*.jar"/>
<include name="cascading-test-*.jar"/>
</fileset>
<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.core}"/>
<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">
<fileset dir="${cascading.path}">
<include name="cascading-core-*.jar"/>
<include name="cascading-xml-*.jar"/>
</fileset>
<fileset dir="${cascading.libs.core}" includes="*.jar"/>
<fileset dir="${cascading.libs.xml}" 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>