Skip to content
Newer
Older
100644 283 lines (241 sloc) 11.3 KB
f11eb1f The first commit for schema dictionary.
Mike Cafarella authored Oct 7, 2010
1 <?xml version="1.0" encoding="ISO-8859-1"?>
510fb31 @mikecafarella Change name of project in build files
mikecafarella authored Jun 24, 2011
2 <project name="recordbreaker" default="compile" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
f11eb1f The first commit for schema dictionary.
Mike Cafarella authored Oct 7, 2010
3 <description>
4 simple example build file
5 </description>
6 <!-- set global properties for this build -->
7 <property name="src" location="src"/>
124df2f @mikecafarella Move java src hierarchy to make room for source in other languages
mikecafarella authored Aug 25, 2011
8 <property name="java.src" location="src/java"/>
928bbe4 @mikecafarella Moved HTML resources to be more easily compiled
mikecafarella authored Jul 1, 2012
9 <property name="html.src" location="src/web"/>
f11eb1f The first commit for schema dictionary.
Mike Cafarella authored Oct 7, 2010
10 <property name="build" location="build"/>
11 <property name="build.classes" location="build"/>
12 <property name="test.src" location="test"/>
13 <property name="test.build" location="build/test"/>
510fb31 @mikecafarella Change name of project in build files
mikecafarella authored Jun 24, 2011
14 <property name="lib" location="${build}/ivy/lib/recordbreaker/default"/>
f11eb1f The first commit for schema dictionary.
Mike Cafarella authored Oct 7, 2010
15 <property name="dist" location="dist"/>
16 <property name="test.include" value="Test*"/>
17
18 <property name="test.build.data" value="${test.build}/data" />
19 <property name="test.cache.data" value="${test.build}/cache" />
20 <property name="test.debug.data" value="${test.build}/debug" />
21
22 <path id="classpath">
23 <pathelement location="${build.classes}" />
24 <fileset dir="${lib}" >
25 <include name="**/*.jar" />
26 <exclude name="**/excluded/" />
27 </fileset>
28 </path>
29
30 <!-- the unit test classpath: uses test.src.dir for configuration -->
31 <path id="test.classpath">
32 <pathelement location="${test.build}" />
33 <pathelement location="${test.src}" />
34 <pathelement location="${build}" />
35 <path refid="classpath"/>
36 </path>
37
38 <!-- Load all the default properties, and any the user wants -->
39 <!-- to contribute (without having to type -D or edit this file -->
40 <property file="${user.home}/build.properties" />
41 <property file="${basedir}/build.properties" />
42 <property name="src.dir" value="${basedir}/src"/>
43
44 <!-- IVY properteis set here -->
45 <property name="ivy.dir" location="ivy" />
46 <loadproperties srcfile="${ivy.dir}/libraries.properties"/>
47 <property name="ivy.jar" location="${ivy.dir}/ivy-${ivy.version}.jar"/>
48 <property name="ivy_repo_url" value="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar"/>
49 <property name="ivysettings.xml" location="${ivy.dir}/ivysettings.xml" />
50 <property name="ivy.org" value="org.apache.hadoop"/>
51 <property name="build.dir" location="build" />
52 <property name="dist.dir" value="${build.dir}/${final.name}"/>
53 <property name="build.ivy.dir" location="${build.dir}/ivy" />
54 <property name="build.ivy.lib.dir" location="${build.ivy.dir}/lib" />
55 <property name="common.ivy.lib.dir" location="${build.ivy.lib.dir}/${ant.project.name}/common"/>
56 <property name="build.ivy.report.dir" location="${build.ivy.dir}/report" />
57 <property name="build.ivy.maven.dir" location="${build.ivy.dir}/maven" />
58 <property name="build.ivy.maven.pom" location="${build.ivy.maven.dir}/hadoop-core-${hadoop.version}.pom" />
59 <property name="build.ivy.maven.jar" location="${build.ivy.maven.dir}/hadoop-core-${hadoop.version}.jar" />
60
61 <!--this is the naming policy for artifacts we want pulled down-->
62 <property name="ivy.artifact.retrieve.pattern" value="${ant.project.name}/[conf]/[artifact]-[revision].[ext]"/>
63
64 <!--this is how artifacts that get built are named-->
65 <property name="ivy.publish.pattern" value="hadoop-[revision]-core.[ext]"/>
66 <property name="hadoop.jar" location="${build.dir}/hadoop-${hadoop.version}-core.jar" />
67
68
69 <target name="ivy-init-dirs">
70 <mkdir dir="${build.ivy.dir}" />
71 <mkdir dir="${build.ivy.lib.dir}" />
72 <mkdir dir="${build.ivy.report.dir}" />
73 <mkdir dir="${build.ivy.maven.dir}" />
74 </target>
75
76 <target name="ivy-probe-antlib" >
77 <condition property="ivy.found">
78 <typefound uri="antlib:org.apache.ivy.ant" name="cleancache"/>
79 </condition>
80 </target>
81
82 <target name="ivy-download" description="To download ivy" unless="offline">
83 <get src="${ivy_repo_url}" dest="${ivy.jar}" usetimestamp="true"/>
84 </target>
85
86 <target name="ivy-init-antlib" depends="ivy-download,ivy-init-dirs,ivy-probe-antlib" unless="ivy.found">
87 <typedef uri="antlib:org.apache.ivy.ant" onerror="fail"
88 loaderRef="ivyLoader">
89 <classpath>
90 <pathelement location="${ivy.jar}"/>
91 </classpath>
92 </typedef>
93 <fail >
94 <condition >
95 <not>
96 <typefound uri="antlib:org.apache.ivy.ant" name="cleancache"/>
97 </not>
98 </condition>
99 You need Apache Ivy 2.0 or later from http://ant.apache.org/
100 It could not be loaded from ${ivy_repo_url}
101 </fail>
102 </target>
103
104
105 <target name="ivy-init" depends="ivy-init-antlib" >
106
107 <!--Configure Ivy by reading in the settings file
108 If anyone has already read in a settings file into this settings ID, it gets priority
109 -->
110 <ivy:configure settingsid="${ant.project.name}.ivy.settings" file="${ivysettings.xml}" override='false'/>
111 </target>
112
113
114 <target name="ivy-resolve" depends="ivy-init">
115 <ivy:resolve settingsRef="${ant.project.name}.ivy.settings"/>
116 </target>
117
118 <target name="ivy-resolve-javadoc" depends="ivy-init">
119 <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="javadoc"/>
120 </target>
121
122 <target name="ivy-resolve-releaseaudit" depends="ivy-init">
b649075 @mikecafarella Remove unecessary configuration variable name
mikecafarella authored May 13, 2011
123 <ivy:resolve settingsRef="${ant.project.name}.ivy.settings"/>
f11eb1f The first commit for schema dictionary.
Mike Cafarella authored Oct 7, 2010
124 </target>
125
126 <target name="ivy-resolve-test" depends="ivy-init">
127 <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="test" />
128 </target>
129
130 <target name="ivy-resolve-common" depends="ivy-init">
131 <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="common" />
132 </target>
133
134 <target name="ivy-resolve-jdiff" depends="ivy-init">
135 <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="jdiff" />
136 </target>
137
138 <target name="ivy-resolve-checkstyle" depends="ivy-init">
139 <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="checkstyle"/>
140 </target>
141
142 <target name="ivy-retrieve" depends="ivy-resolve"
143 description="Retrieve Ivy-managed artifacts">
144 <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
145 pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"/>
146 </target>
147
148 <target name="ivy-retrieve-checkstyle" depends="ivy-resolve-checkstyle"
149 description="Retrieve Ivy-managed artifacts for the checkstyle configurations">
150 <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
151 pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"/>
152 <ivy:cachepath pathid="checkstyle-classpath" conf="checkstyle"/>
153 </target>
154
155 <target name="ivy-retrieve-jdiff" depends="ivy-resolve-jdiff"
156 description="Retrieve Ivy-managed artifacts for the javadoc configurations">
157 <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
158 pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"/>
159 <ivy:cachepath pathid="jdiff-classpath" conf="jdiff"/>
160 </target>
161
162 <target name="ivy-retrieve-javadoc" depends="ivy-resolve-javadoc"
163 description="Retrieve Ivy-managed artifacts for the javadoc configurations">
164 <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
165 pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"/>
166 <ivy:cachepath pathid="javadoc-classpath" conf="javadoc"/>
167 </target>
168
169 <target name="ivy-retrieve-test" depends="ivy-resolve-test"
170 description="Retrieve Ivy-managed artifacts for the test configurations">
171 <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
172 pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"/>
173 <ivy:cachepath pathid="test.classpath" conf="test"/>
174 </target>
175
176 <target name="ivy-retrieve-common" depends="ivy-resolve-common"
177 description="Retrieve Ivy-managed artifacts for the compile configurations">
178 <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
179 pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"/>
180 <ivy:cachepath pathid="ivy-common.classpath" conf="common"/>
181 </target>
182
183 <target name="ivy-retrieve-releaseaudit" depends="ivy-resolve-releaseaudit"
184 description="Retrieve Ivy-managed artifacts for the compile configurations">
185 <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
186 pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" />
187 <ivy:cachepath pathid="releaseaudit-classpath" conf="releaseaudit"/>
188 <available classname="${rat.reporting.classname}"
189 classpathref="releaseaudit-classpath" property="rat.present" value="true"/>
190 </target>
191
192 <target name="ivy-report" depends="ivy-resolve-releaseaudit"
193 description="Generate">
194 <ivy:report todir="${build.ivy.report.dir}" settingsRef="${ant.project.name}.ivy.settings"/>
195 <echo>
196 Reports generated:${build.ivy.report.dir}
197 </echo>
198 </target>
199
15acb41 @mikecafarella Add apache rat for licensing issue finding
mikecafarella authored Jun 24, 2011
200 <!-- Run Apache rat to find license issues -->
201 <target name="-taskdef">
202 </target>
203 <target name="rat" depends="init,ivy-retrieve" description="Run apache rat to test license issues">
204 <rat:report xmlns:rat="antlib:org.apache.rat.anttasks">
205 <fileset dir="${src}" excludesfile="${src}/rat-excludes.txt" />
206 </rat:report>
207 </target>
f11eb1f The first commit for schema dictionary.
Mike Cafarella authored Oct 7, 2010
208
209 <target name="init">
210 <!-- Create the time stamp -->
211 <tstamp/>
212 <!-- Create the build directory structure used by compile -->
213 <mkdir dir="${build}"/>
214 <mkdir dir="${test.build}"/>
215 </target>
216
217 <target name="compile" depends="init,ivy-retrieve"
218 description="compile the source " >
219 <!-- Compile the java code from ${src} into ${build} -->
220 <javac
124df2f @mikecafarella Move java src hierarchy to make room for source in other languages
mikecafarella authored Aug 25, 2011
221 srcdir="${java.src}"
f11eb1f The first commit for schema dictionary.
Mike Cafarella authored Oct 7, 2010
222 destdir="${build}"
223 classpathref="classpath"
224 debug="true" />
928bbe4 @mikecafarella Moved HTML resources to be more easily compiled
mikecafarella authored Jul 1, 2012
225 <copy todir="${build}/web">
226 <fileset dir="${html.src}"/>
227 </copy>
f11eb1f The first commit for schema dictionary.
Mike Cafarella authored Oct 7, 2010
228 </target>
229
230 <target name="compile-test" depends="init,compile"
231 description="compile the test source " >
232 <!-- Compile the java code from ${src} into ${build} -->
233 <javac srcdir="${test.src}"
234 destdir="${test.build}"
235 classpathref="test.classpath"
236 debug="true" />
237 </target>
238
239 <target name="test" depends="compile-test" >
240 <junit showoutput="no"
241 printsummary="yes"
242 haltonfailure="no"
243 fork="yes"
244 forkmode="perTest"
245 maxmemory="512m"
246 dir="${basedir}"
247 timeout="900000"
248 errorProperty="tests.failed" failureProperty="tests.failed">
249 <sysproperty key="test.build.data" value="${test.build.data}"/>
250 <sysproperty key="test.cache.data" value="${test.cache.data}"/>
251 <sysproperty key="test.debug.data" value="${test.debug.data}"/>
252
253 <classpath refid="test.classpath"/>
254
255 <batchtest todir="${test.build}" unless="testcase">
256 <fileset dir="${test.src}"
257 includes="**/${test.include}.java"
258 excludes="**/${test.exclude}.java" />
259 </batchtest>
260 <batchtest todir="${test.build}" if="testcase">
261 <fileset dir="${test.src}" includes="**/${testcase}.java"/>
262 </batchtest>
263 </junit>
264 <fail if="tests.failed">Tests failed!</fail>
265 </target>
266
267 <target name="dist" depends="compile"
268 description="generate the distribution" >
269 <!-- Create the distribution directory -->
270 <mkdir dir="${dist}/lib"/>
271
272 <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
510fb31 @mikecafarella Change name of project in build files
mikecafarella authored Jun 24, 2011
273 <jar jarfile="${dist}/lib/recordbreaker-${DSTAMP}.jar" basedir="${build}"/>
f11eb1f The first commit for schema dictionary.
Mike Cafarella authored Oct 7, 2010
274 </target>
275
276 <target name="clean"
277 description="clean up" >
278 <!-- Delete the ${build} and ${dist} directory trees -->
279 <delete dir="${build}"/>
280 <delete dir="${dist}"/>
281 </target>
282 </project>
Something went wrong with that request. Please try again.