forked from mongodb/mongo-hadoop
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
221 lines (200 loc) · 7.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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<?xml version='1.0'?>
<project name="mongo-hadoop" default="compile" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="ivy.install.version" value="2.2.0" />
<property name="ivy.jar.dir" value="${basedir}/ivy" />
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
<path id="classpath">
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<pathelement path="build/main" />
<pathelement path="build/examples" />
<!-- <pathelement path="build/test" /> -->
</path>
<target name="download-ivy" unless="skip.download">
<mkdir dir="${ivy.jar.dir}"/>
<!-- download Ivy from web site so that it can be used even without any special installation -->
<echo message="installing ivy..."/>
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<!-- =================================
target: install-ivy
this target is not necessary if you put ivy.jar in your ant lib directory
if you already have ivy in your ant lib, you can simply remove this
target and the dependency the 'go' target has on it
================================= -->
<target name="install-ivy" depends="download-ivy" description="--> install ivy">
<!-- try to load ivy here from local ivy dir, in case the user has not already dropped
it into ant's lib dir (note that the latter copy will always take precedence).
We will not fail as long as local lib dir exists (it may be empty) and
ivy is in at least one of ant's lib dir or the local lib dir. -->
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>
<!-- =================================
target: clean-ivy
================================= -->
<target name="clean-ivy" description="--> clean the ivy installation">
<delete dir="${ivy.jar.dir}"/>
</target>
<!-- =================================
target: clean-cache
================================= -->
<target name="clean-cache" depends="install-ivy"
description="--> clean the ivy cache">
<ivy:cleancache />
</target>
<target name="init" depends="install-ivy">
<mkdir dir="build" />
<!--mkdir dir="lib" /-->
<mkdir dir="build/main" />
<!-- <mkdir dir="build/test" /> -->
<mkdir dir="build/examples" />
</target>
<target name="resolve" depends="init" description="--> retrieve dependencies with ivy">
<ivy:retrieve/>
</target>
<target name="clean" description="--> clean up project">
<delete dir="build"/>
<delete file="examples/wordcount_split_test/wc-split-test.jar"/>
<delete file="examples/wordcount_split_test/*.jar"/>
<delete file="examples/wordcount_split_test/*.class"/>
<delete dir="examples/wordcount_split_test/build"/>
<delete dir="examples/ip_location/build" />
<delete file="mongo-hadoop.jar"/>
</target>
<target name="javadoc" depends="init" >
<mkdir dir="javadoc"/>
<javadoc charset="UTF-8" destdir="javadoc" docencoding="UTF-8" failonerror="true" private="false" useexternalfile="true" >
<classpath refid="classpath"/>
<fileset dir=".">
<filename name="src/main/**/*.java"/>
</fileset>
</javadoc>
</target>
<target name="checklib">
<available property="lib.exists" file="lib"/>
</target>
<target name="firstresolve" unless="${lib.exists}" >
<antcall target="resolve" />
</target>
<target name="compile" depends="init,checklib,firstresolve" description="--> compile all artifacts">
<javac srcdir="src/main"
includeantruntime="false"
destdir="build/main"
optimize="off"
deprecation="off"
source="1.5"
target="1.5"
encoding="ISO-8859-1"
memoryMaximumSize="256M"
fork="true"
debug="on" >
<classpath refid="classpath"/>
</javac>
<!--
<javac srcdir="src/test"
destdir="build/test"
optimize="off"
deprecation="off"
source="1.5"
encoding="ISO-8859-1"
debug="on" >
<classpath refid="classpath"/>
</javac>
-->
<javac srcdir="examples/wordcount/src"
includeantruntime="false"
destdir="build/examples"
optimize="off"
deprecation="off"
source="1.5"
encoding="ISO-8859-1"
debug="on" >
<classpath refid="classpath"/>
</javac>
<mkdir dir="examples/wordcount_split_test/build"/>
<javac srcdir="examples/wordcount_split_test/src"
destdir="examples/wordcount_split_test/build"
includeantruntime="false"
optimize="off"
deprecation="off"
source="1.5"
encoding="ISO-8859-1"
debug="on" >
<classpath refid="classpath"/>
</javac>
<jar destfile="examples/wordcount_split_test/wc-split-test.jar">
<fileset dir="examples/wordcount_split_test/build"
includes="*.class" />
</jar>
<mkdir dir="examples/snmp/build"/>
<javac srcdir="examples/snmp/src"
includeantruntime="false"
destdir="examples/snmp/build"
debug="on" >
<classpath refid="classpath"/>
</javac>
<jar destfile="examples/snmp/snmp.jar">
<fileset dir="examples/snmp/build"
includes="*.class" />
</jar>
<mkdir dir="examples/ip_location/build" />
<javac srcdir="examples/ip_location/src"
destdir="examples/ip_location/build"
includeantruntime="false"
optimize="off"
deprecation="off"
source="1.5"
encoding="ISO-8859-1"
debug="on" >
<classpath refid="classpath"/>
</javac>
<jar destfile="examples/ip_location/ip-loc.jar">
<fileset dir="examples/ip_location/build"
includes="*.class" />
</jar>
<javac srcdir="examples/treasury_yield/src"
destdir="build/examples"
includeantruntime="false"
optimize="off"
deprecation="off"
source="1.5"
encoding="ISO-8859-1"
debug="on" >
<classpath refid="classpath"/>
</javac>
</target>
<target name="word" depends="jar" description="--> Run the wordcount example">
<java classname="WordCount" >
<classpath refid="classpath"/>
</java>
</target>
<target name="wordcount" depends="word"/>
<target name="wordcountXML" depends="jar" description="--> Run the wordcount example">
<java classname="com.mongodb.hadoop.examples.WordCountXMLConfig" >
<classpath refid="classpath"/>
<arg line="-conf examples/wordcount/resources/mongo-wordcount.xml"/>
<arg line="-Dlog4j.debug"/>
</java>
</target>
<target name="yieldXML" depends="jar" description="--> Run the treasury yield historical example">
<java classname="com.mongodb.hadoop.examples.TreasuryYieldXMLConfig" >
<classpath refid="classpath"/>
<arg line="-conf examples/treasury_yield/resources/mongo-treasury_yield.xml"/>
<arg line="-Dlog4j.debug"/>
</java>
</target>
<target name="jar" depends="compile">
<jar destfile="mongo-hadoop.jar">
<fileset dir="build/main"
includes="**/*.class" />
<fileset dir="build/examples"
includes="**/*.class" />
</jar>
</target>
</project>