-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
188 lines (163 loc) · 7.02 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
<?xml version="1.0"?>
<project name="commoncrawl" default="compile">
<!-- Load all the default properties, and any the user wants -->
<!-- to contribute (without having to type -D or edit this file -->
<property file="${user.home}/build.properties" />
<property file="${basedir}/build.properties" />
<property name="Name" value="commoncrawl"/>
<property name="name" value="commoncrawl"/>
<property name="version" value="0.1"/>
<property name="final.name" value="${name}-${version}"/>
<fail message="Please define Hadoop Version via hadoop.version in your build.properties file">
<condition>
<not>
<isset property="hadoop.version"/>
</not>
</condition>
</fail>
<fail message="Please define Hadoop Base Path via hadoop.path in your build.properties file">
<condition>
<not>
<isset property="hadoop.path"/>
</not>
</condition>
</fail>
<property name="src.dir" value="${basedir}/src"/>
<property name="amazon.src.dir" value="${basedir}/lib/third_party/amazon"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="conf.dir" value="${basedir}/conf"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="build.classes" value="${build.dir}/classes"/>
<property name="build.src" value="${build.dir}/src"/>
<property name="build.webapps" value="${build.dir}/webapps"/>
<property name="build.anttasks" value="${build.dir}/ant"/>
<!-- convert spaces to _ so that mac os doesn't break things -->
<exec executable="sed" inputstring="${os.name}"
outputproperty="nonspace.os">
<arg value="s/ /_/g"/>
</exec>
<property name="build.platform"
value="${nonspace.os}-${os.arch}-${sun.arch.data.model}"/>
<property name="build.encoding" value="ISO-8859-1"/>
<property name="dist.dir" value="${build.dir}/${final.name}"/>
<property name="javac.debug" value="on"/>
<property name="javac.optimize" value="on"/>
<property name="javac.deprecation" value="off"/>
<property name="javac.version" value="1.5"/>
<property name="javac.args" value=""/>
<property name="javac.args.warnings" value=""/>
<!-- the normal classpath -->
<echo message="Processing Class Path"/>
<path id="classpath">
<pathelement location="${build.classes}"/>
<fileset dir="${lib.dir}">
<include name="jets3t*.jar"/>
</fileset>
<fileset dir="${lib.dir}">
<include name="*.jar" />
<include name="**/*.jar" />
</fileset>
<fileset dir="${hadoop.path}">
<include name="lib/**/*.jar"/>
<include name="hadoop-*-core.jar"/>
<include name="hadoop-core-*.jar"/>
<exclude name="lib/jets3t-0.6.1.jar"/>
</fileset>
</path>
<echo message="classpath:${classpath}" />
<!-- ====================================================== -->
<!-- Stuff needed by all targets -->
<!-- ====================================================== -->
<echo message="Processing Init Target"/>
<target name="init">
<echo message="Executing Init Target"/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes}"/>
<mkdir dir="${build.src}"/>
<mkdir dir="${build.anttasks}"/>
</target>
<!-- ====================================================== -->
<!-- Compile the Java files -->
<!-- ====================================================== -->
<echo message="Processing Compile Core Classes Target"/>
<target name="compile-core-classes" depends="init">
<!-- Compile Amazon Java files -->
<javac
encoding="${build.encoding}"
srcdir="${amazon.src.dir}"
includes="com/amazon/**/*.java"
destdir="${build.classes}"
debug="${javac.debug}"
optimize="${javac.optimize}"
target="${javac.version}"
source="${javac.version}"
deprecation="${javac.deprecation}" >
<compilerarg line="${javac.args} ${javac.args.warnings}" />
<classpath refid="classpath"/>
</javac>
<!-- Compile Java files (excluding JSPs) checking warnings -->
<javac
encoding="${build.encoding}"
srcdir="${src.dir};${build.src}"
includes="org/commoncrawl/**/*.java"
excludes="org/commoncrawl/**/OneService.java"
destdir="${build.classes}"
debug="${javac.debug}"
optimize="${javac.optimize}"
target="${javac.version}"
source="${javac.version}"
deprecation="${javac.deprecation}" >
<compilerarg line="${javac.args} ${javac.args.warnings}" />
<classpath refid="classpath"/>
</javac>
<copy todir="${build.classes}">
<fileset
dir="${src.dir}"
includes="**/*.properties"
/>
</copy>
</target>
<echo message="Processing Compile Core Target"/>
<target name="compile-core" depends="compile-core-classes">
</target>
<echo message="Processing Compile Target"/>
<target name="compile" depends="compile-core,jar">
</target>
<!-- ================================================================== -->
<!-- Make commoncrawl.jar -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<echo message="Processing Jar Target"/>
<target name="jar" depends="compile-core">
<jar jarfile="${build.dir}/${final.name}.jar" basedir="${build.classes}" duplicate="preserve" >
<manifest>
<section name="org/commoncrawl">
<attribute name="Implementation-Title" value="commoncrawl"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="CommonCrawl"/>
</section>
</manifest>
<zipfileset dir="${conf.dir}" prefix="conf" >
<include name="*" />
</zipfileset>
<zipfileset dir="${lib.dir}" prefix="lib" >
<include name="*.jar" />
</zipfileset>
<zipfileset dir="${hadoop.path}/lib" prefix="lib" >
<include name="**/*.jar" />
</zipfileset>
</jar>
</target>
<!-- ================================================================== -->
<!-- Clean. Delete the build files, and their directories -->
<!-- ================================================================== -->
<echo message="Processing Clean Target"/>
<target name="clean">
<delete dir="${build.dir}"/>
<delete>
<fileset dir="${src.dir}" includes="**\/gen.stamp" />
</delete>
</target>
<echo message="Done Processing Targets"/>
</project>