<?xml version=
"1.0"
?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or
more
contributor license agreements. See the NOTICE file distributed with
this work
for
additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the
"License"
); you may not
use
this file except in compliance with
the License. You may obtain a
copy
of the License at
http:
Unless required by applicable law
or
agreed to in writing, software
distributed under the License is distributed on an
"AS IS"
BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or
implied.
See the License
for
the specific language governing permissions
and
limitations under the License.
-->
<!-- Imported by contrib
*.jar"></
include
>
</fileset>
<path refid=
"${ant.project.name}.common-classpath"
></path>
<pathelement path=
"${clover.jar}"
></pathelement>
</path>
<!-- the unit test classpath -->
<path id=
"test.classpath"
>
<pathelement location=
"${build.test}"
></pathelement>
<pathelement location=
"${hadoop.root}/build/test/classes"
></pathelement>
<pathelement location=
"${hadoop.root}/src/contrib/test"
></pathelement>
<pathelement location=
"${conf.dir}"
></pathelement>
<pathelement location=
"${hadoop.root}/build"
></pathelement>
<pathelement location=
"${build.examples}"
></pathelement>
<pathelement location=
"${hadoop.root}/build/examples"
></pathelement>
<path refid=
"contrib-classpath"
></path>
</path>
<!-- The system test classpath -->
<path id=
"test.system.classpath"
>
<pathelement location=
"${hadoop.root}/src/contrib/${name}/src/test/system"
></pathelement>
<pathelement location=
"${build.test.system}"
></pathelement>
<pathelement location=
"${build.test.system}/classes"
></pathelement>
<pathelement location=
"${build.examples}"
></pathelement>
<pathelement location=
"${hadoop.root}/build-fi/system/classes"
></pathelement>
<pathelement location=
"${hadoop.root}/build-fi/system/test/classes"
></pathelement>
<pathelement location=
"${hadoop.root}/build-fi"
></pathelement>
<pathelement location=
"${hadoop.root}/build-fi/tools"
></pathelement>
<pathelement location=
"${hadoop.home}"
></pathelement>
<pathelement location=
"${hadoop.conf.dir}"
></pathelement>
<pathelement location=
"${hadoop.conf.dir.deployed}"
></pathelement>
<pathelement location=
"${hadoop.root}/build"
></pathelement>
<pathelement location=
"${hadoop.root}/build/examples"
></pathelement>
<pathelement location=
"${hadoop.root}/build-fi/test/classes"
></pathelement>
<path refid=
"contrib-classpath"
></path>
<fileset dir=
"${hadoop.root}/src/test/lib"
>
<
include
name=
"**/*.jar"
></
include
>
<exclude name=
"**/excluded/"
></exclude>
</fileset>
<fileset dir=
"${hadoop.root}/build-fi/system"
>
<
include
name=
"**/*.jar"
></
include
>
<exclude name=
"**/excluded/"
></exclude>
</fileset>
<fileset dir=
"${hadoop.root}/build-fi/test/testjar"
>
<
include
name=
"**/*.jar"
></
include
>
<exclude name=
"**/excluded/"
></exclude>
</fileset>
<fileset dir=
"${hadoop.root}/build/contrib/${name}"
>
<
include
name=
"**/*.jar"
></
include
>
<exclude name=
"**/excluded/"
></exclude>
</fileset>
</path>
<!-- to be overridden by sub-projects -->
<target name=
"check-contrib"
></target>
<target name=
"init-contrib"
></target>
<!-- ====================================================== -->
<!-- Stuff needed by all targets -->
<!-- ====================================================== -->
<target name=
"init"
depends=
"check-contrib"
unless=
"skip.contrib"
>
<
echo
message=
"contrib: ${name}"
></
echo
>
<
mkdir
dir=
"${build.dir}"
></
mkdir
>
<
mkdir
dir=
"${build.classes}"
></
mkdir
>
<
mkdir
dir=
"${build.test}"
></
mkdir
>
<!-- The below two tags added
for
contrib system tests -->
<
mkdir
dir=
"${build.test.system}"
></
mkdir
>
<
mkdir
dir=
"${build.system.classes}"
></
mkdir
>
<
mkdir
dir=
"${build.examples}"
></
mkdir
>
<
mkdir
dir=
"${hadoop.log.dir}"
></
mkdir
>
<antcall target=
"init-contrib"
></antcall>
</target>
<!-- ====================================================== -->
<!-- Compile a Hadoop contrib's files -->
<!-- ====================================================== -->
<target name=
"compile"
depends=
"init, ivy-retrieve-common"
unless=
"skip.contrib"
>
<
echo
message=
"contrib: ${name}"
></
echo
>
<javac encoding=
"${build.encoding}"
srcdir=
"${src.dir}"
includes=
"**/*.java"
destdir=
"${build.classes}"
debug=
"${javac.debug}"
deprecation=
"${javac.deprecation}"
>
<classpath refid=
"contrib-classpath"
></classpath>
</javac>
</target>
<!-- ======================================================= -->
<!-- Compile a Hadoop contrib's example files (
if
available) -->
<!-- ======================================================= -->
<target name=
"compile-examples"
depends=
"compile"
if
=
"examples.available"
>
<
echo
message=
"contrib: ${name}"
></
echo
>
<javac encoding=
"${build.encoding}"
srcdir=
"${src.examples}"
includes=
"**/*.java"
destdir=
"${build.examples}"
debug=
"${javac.debug}"
>
<classpath refid=
"contrib-classpath"
></classpath>
</javac>
</target>
<!-- ================================================================== -->
<!-- Compile test code -->
<!-- ================================================================== -->
<target name=
"compile-test"
depends=
"compile-examples"
if
=
"test.available"
>
<
echo
message=
"contrib: ${name}"
></
echo
>
<javac encoding=
"${build.encoding}"
srcdir=
"${src.test}"
includes=
"**/*.java"
excludes=
"system/**/*.java"
destdir=
"${build.test}"
debug=
"${javac.debug}"
>
<classpath refid=
"test.classpath"
></classpath>
</javac>
</target>
<!-- ================================================================== -->
<!-- Compile system test code -->
<!-- ================================================================== -->
<target name=
"compile-test-system"
depends=
"compile-examples"
if
=
"test.system.available"
>
<
echo
message=
"contrib: ${name}"
></
echo
>
<javac encoding=
"${build.encoding}"
srcdir=
"${src.test.system}"
includes=
"**/*.java"
destdir=
"${build.system.classes}"
debug=
"${javac.debug}"
>
<classpath refid=
"test.system.classpath"
></classpath>
</javac>
</target>
<!-- ====================================================== -->
<!-- Make a Hadoop contrib's jar -->
<!-- ====================================================== -->
<target name=
"jar"
depends=
"compile"
unless=
"skip.contrib"
>
<
echo
message=
"contrib: ${name}"
></
echo
>
<jar jarfile=
"${build.dir}/hadoop-${name}-${version}.jar"
basedir=
"${build.classes}"
></jar>
</target>
<!-- ====================================================== -->
<!-- Make a Hadoop contrib's examples jar -->
<!-- ====================================================== -->
<target name=
"jar-examples"
depends=
"compile-examples"
if
=
"examples.available"
unless=
"skip.contrib"
>
<
echo
message=
"contrib: ${name}"
></
echo
>
<jar jarfile=
"${build.dir}/hadoop-${name}-examples-${version}.jar"
>
<fileset dir=
"${build.classes}"
>
</fileset>
<fileset dir=
"${build.examples}"
>
</fileset>
</jar>
</target>
<!-- ====================================================== -->
<!-- Package a Hadoop contrib -->
<!-- ====================================================== -->
<target name=
"package"
depends=
"jar, jar-examples"
unless=
"skip.contrib"
>
<
mkdir
dir=
"${dist.dir}/contrib/${name}"
></
mkdir
>
<
copy
todir=
"${dist.dir}/contrib/${name}"
includeemptydirs=
"false"
flatten=
"true"
>
<fileset dir=
"${build.dir}"
>
<
include
name=
"hadoop-${name}-${version}.jar"
></
include
>
</fileset>
</
copy
>
</target>
<!-- ================================================================== -->
<!-- Run unit tests -->
<!-- ================================================================== -->
<target name=
"test"
depends=
"compile-test, compile"
if
=
"test.available"
>
<
echo
message=
"contrib: ${name}"
></
echo
>
<
delete
dir=
"${hadoop.log.dir}"
></
delete
>
<
mkdir
dir=
"${hadoop.log.dir}"
></
mkdir
>
<junit printsummary=
"yes"
showoutput=
"${test.output}"
haltonfailure=
"no"
fork=
"yes"
maxmemory=
"512m"
errorproperty=
"tests.failed"
failureproperty=
"tests.failed"
timeout=
"${test.timeout}"
>
<sysproperty key=
"test.build.data"
value=
"${build.test}/data"
></sysproperty>
<sysproperty key=
"build.test"
value=
"${build.test}"
></sysproperty>
<sysproperty key=
"src.test.data"
value=
"${src.test.data}"
></sysproperty>
<sysproperty key=
"contrib.name"
value=
"${name}"
></sysproperty>
<!-- requires fork=yes
for
:
relative File paths to
use
the specified user.dir
classpath to
use
build/contrib/*.jar
-->
<sysproperty key=
"user.dir"
value=
"${build.test}/data"
></sysproperty>
<sysproperty key=
"fs.default.name"
value=
"${fs.default.name}"
></sysproperty>
<sysproperty key=
"hadoop.test.localoutputfile"
value=
"${hadoop.test.localoutputfile}"
></sysproperty>
<sysproperty key=
"hadoop.log.dir"
value=
"${hadoop.log.dir}"
></sysproperty>
<sysproperty key=
"taskcontroller-path"
value=
"${taskcontroller-path}"
></sysproperty>
<sysproperty key=
"taskcontroller-ugi"
value=
"${taskcontroller-ugi}"
></sysproperty>
<classpath refid=
"test.classpath"
></classpath>
<formatter type=
"${test.junit.output.format}"
></formatter>
<batchtest todir=
"${build.test}"
unless=
"testcase"
>
<fileset dir=
"${src.test}"
includes=
"**/Test*.java"
excludes=
"**/${test.exclude}.java, system/**/*.java"
></fileset>
</batchtest>
<batchtest todir=
"${build.test}"
if
=
"testcase"
>
<fileset dir=
"${src.test}"
includes=
"**/${testcase}.java"
excludes=
"system/**/*.java"
></fileset>
</batchtest>
</junit>
<antcall target=
"checkfailure"
></antcall>
</target>
<!-- ================================================================== -->
<!-- Run system tests -->
<!-- ================================================================== -->
<target name=
"test-system"
depends=
"compile, compile-test-system, jar"
if
=
"test.system.available"
>
<
delete
dir=
"${build.test.system}/extraconf"
></
delete
>
<
mkdir
dir=
"${build.test.system}/extraconf"
></
mkdir
>
<property name=
"test.src.dir"
location=
"${hadoop.root}/src/test"
></property>
<property name=
"test.junit.printsummary"
value=
"yes"
></property>
<property name=
"test.junit.haltonfailure"
value=
"no"
></property>
<property name=
"test.junit.maxmemory"
value=
"512m"
></property>
<property name=
"test.junit.fork.mode"
value=
"perTest"
></property>
<property name=
"test.all.tests.file"
value=
"${test.src.dir}/all-tests"
></property>
<property name=
"test.build.dir"
value=
"${hadoop.root}/build/test"
></property>
<property name=
"basedir"
value=
"${hadoop.root}"
></property>
<property name=
"test.timeout"
value=
"900000"
></property>
<property name=
"test.junit.output.format"
value=
"plain"
></property>
<property name=
"test.tools.input.dir"
value=
"${basedir}/src/test/tools/data"
></property>
<property name=
"c++.src"
value=
"${basedir}/src/c++"
></property>
<property name=
"test.include"
value=
"Test*"
></property>
<property name=
"c++.libhdfs.src"
value=
"${c++.src}/libhdfs"
></property>
<property name=
"test.build.data"
value=
"${build.test.system}/data"
></property>
<property name=
"test.cache.data"
value=
"${build.test.system}/cache"
></property>
<property name=
"test.debug.data"
value=
"${build.test.system}/debug"
></property>
<property name=
"test.log.dir"
value=
"${build.test.system}/logs"
></property>
<patternset id=
"empty.exclude.list.id"
></patternset>
<
exec
executable=
"sed"
inputstring=
"${os.name}"
outputproperty=
"nonspace.os"
>
<arg value=
"s/ /_/g"
></arg>
</
exec
>
<property name=
"build.platform"
value=
"${nonspace.os}-${os.arch}-${sun.arch.data.model}"
></property>
<property name=
"build.native"
value=
"${hadoop.root}/build/native/${build.platform}"
></property>
<property name=
"lib.dir"
value=
"${hadoop.root}/lib"
></property>
<property name=
"install.c++.examples"
value=
"${hadoop.root}/build/c++-examples/${build.platform}"
></property>
<condition property=
"tests.testcase"
>
<
and
>
<isset property=
"testcase"
></isset>
</
and
>
</condition>
<property name=
"test.junit.jvmargs"
value=
"-ea"
></property>
<macro-system-test-runner test.file=
"${test.all.tests.file}"
classpath=
"test.system.classpath"
test.dir=
"${build.test.system}"
fileset.dir=
"${hadoop.root}/src/contrib/${name}/src/test/system"
hadoop.conf.dir.deployed=
"${hadoop.conf.dir.deployed}"
>
</macro-system-test-runner>
</target>
<macrodef name=
"macro-system-test-runner"
>
<attribute name=
"test.file"
></attribute>
<attribute name=
"classpath"
></attribute>
<attribute name=
"test.dir"
></attribute>
<attribute name=
"fileset.dir"
></attribute>
<attribute name=
"hadoop.conf.dir.deployed"
default
=
""
></attribute>
<sequential>
<
delete
dir=
"@{test.dir}/data"
></
delete
>
<
mkdir
dir=
"@{test.dir}/data"
></
mkdir
>
<
delete
dir=
"@{test.dir}/logs"
></
delete
>
<
mkdir
dir=
"@{test.dir}/logs"
></
mkdir
>
<
copy
file=
"${test.src.dir}/hadoop-policy.xml"
todir=
"@{test.dir}/extraconf"
></
copy
>
<
copy
file=
"${test.src.dir}/fi-site.xml"
todir=
"@{test.dir}/extraconf"
></
copy
>
<junit showoutput=
"${test.output}"
printsummary=
"${test.junit.printsummary}"
haltonfailure=
"${test.junit.haltonfailure}"
fork=
"yes"
forkmode=
"${test.junit.fork.mode}"
maxmemory=
"${test.junit.maxmemory}"
dir=
"${basedir}"
timeout=
"${test.timeout}"
errorproperty=
"tests.failed"
failureproperty=
"tests.failed"
>
<jvmarg value=
"${test.junit.jvmargs}"
></jvmarg>
<sysproperty key=
"java.net.preferIPv4Stack"
value=
"true"
></sysproperty>
<sysproperty key=
"test.build.data"
value=
"@{test.dir}/data"
></sysproperty>
<sysproperty key=
"test.tools.input.dir"
value=
"${test.tools.input.dir}"
></sysproperty>
<sysproperty key=
"test.cache.data"
value=
"${test.cache.data}"
></sysproperty>
<sysproperty key=
"test.debug.data"
value=
"${test.debug.data}"
></sysproperty>
<sysproperty key=
"hadoop.log.dir"
value=
"@{test.dir}/logs"
></sysproperty>
<sysproperty key=
"test.src.dir"
value=
"@{fileset.dir}"
></sysproperty>
<sysproperty key=
"taskcontroller-path"
value=
"${taskcontroller-path}"
></sysproperty>
<sysproperty key=
"taskcontroller-ugi"
value=
"${taskcontroller-ugi}"
></sysproperty>
<sysproperty key=
"test.build.extraconf"
value=
"@{test.dir}/extraconf"
></sysproperty>
<sysproperty key=
"hadoop.policy.file"
value=
"hadoop-policy.xml"
></sysproperty>
<sysproperty key=
"java.library.path"
value=
"${build.native}/lib:${lib.dir}/native/${build.platform}"
></sysproperty>
<sysproperty key=
"install.c++.examples"
value=
"${install.c++.examples}"
></sysproperty>
<syspropertyset dynamic=
"no"
>
<propertyref name=
"hadoop.tmp.dir"
></propertyref>
</syspropertyset>
<!-- set compile.c++ in the child jvm only
if
it is set -->
<syspropertyset dynamic=
"no"
>
<propertyref name=
"compile.c++"
></propertyref>
</syspropertyset>
<!-- Pass probability specifications to the spawn JVM -->
<syspropertyset id=
"FaultProbabilityProperties"
>
<propertyref regex=
"fi.*"
></propertyref>
</syspropertyset>
<sysproperty key=
"test.system.hdrc.deployed.hadoopconfdir"
value=
"@{hadoop.conf.dir.deployed}"
></sysproperty>
<classpath refid=
"@{classpath}"
></classpath>
<formatter type=
"${test.junit.output.format}"
></formatter>
<batchtest todir=
"@{test.dir}"
unless=
"testcase"
>
<fileset dir=
"@{fileset.dir}"
excludes=
"**/${test.exclude}.java aop/** system/**"
>
<patternset>
<includesfile name=
"@{test.file}"
></includesfile>
</patternset>
</fileset>
</batchtest>
<batchtest todir=
"@{test.dir}"
if
=
"testcase"
>
<fileset dir=
"@{fileset.dir}"
includes=
"**/${testcase}.java"
></fileset>
</batchtest>
</junit>
<antcall target=
"checkfailure"
></antcall>
</sequential>
</macrodef>
<target name=
"checkfailure"
if
=
"tests.failed"
>
<touch file=
"${build.contrib.dir}/testsfailed"
></touch>
<fail unless=
"continueOnFailure"
>Contrib Tests failed!</fail>
</target>
<!-- ================================================================== -->
<!-- Clean.
Delete
the build files,
and
their directories -->
<!-- ================================================================== -->
<target name=
"clean"
>
<
echo
message=
"contrib: ${name}"
></
echo
>
<
delete
dir=
"${build.dir}"
></
delete
>
</target>
<target name=
"ivy-probe-antlib"
>
<condition property=
"ivy.found"
>
<typefound uri=
"antlib:org.apache.ivy.ant"
name=
"cleancache"
></typefound>
</condition>
</target>
<target name=
"ivy-download"
description=
"To download ivy "
unless=
"offline"
>
<get src=
"%24%7Bivy_repo_url%7D"
dest=
"${ivy.jar}"
usetimestamp=
"true"
></get>
</target>
<target name=
"ivy-init-antlib"
depends=
"ivy-download,ivy-probe-antlib"
unless=
"ivy.found"
>
<typedef uri=
"antlib:org.apache.ivy.ant"
onerror=
"fail"
loaderref=
"ivyLoader"
>
<classpath>
<pathelement location=
"${ivy.jar}"
></pathelement>
</classpath>
</typedef>
<fail>
<condition>
<not>
<typefound uri=
"antlib:org.apache.ivy.ant"
name=
"cleancache"
></typefound>
</not>
</condition>
You need Apache Ivy 2.0
or
later from http:
It could not be loaded from ${ivy_repo_url}
</fail>
</target>
<target name=
"ivy-init"
depends=
"ivy-init-antlib"
>
<configure settingsid=
"${ant.project.name}.ivy.settings"
file=
"${ivysettings.xml}"
></configure>
</target>
<target name=
"ivy-resolve-common"
depends=
"ivy-init"
>
<resolve settingsref=
"${ant.project.name}.ivy.settings"
conf=
"common"
></resolve>
</target>
<target name=
"ivy-retrieve-common"
depends=
"ivy-resolve-common"
description=
"Retrieve Ivy-managed artifacts for the compile/test configurations"
>
<retrieve settingsref=
"${ant.project.name}.ivy.settings"
pattern=
"${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"
sync=
"true"
></retrieve>
<cachepath pathid=
"${ant.project.name}.common-classpath"
conf=
"common"
></cachepath>
</target>
</project>