12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787 |
- <?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://www.apache.org/licenses/LICENSE-2.0
- 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.
- -->
- <project name="Hadoop" default="compile"
- xmlns:artifact="urn:maven-artifact-ant"
- xmlns:ivy="antlib:org.apache.ivy.ant">
- <import file="build-utils.xml" />
- <!-- 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="Hadoop-Mapred"/>
- <property name="name" value="hadoop-mapred"/>
- <property name="version" value="0.21.0-SNAPSHOT"/>
- <property name="final.name" value="${name}-${version}"/>
- <property name="test.final.name" value="${name}-test-${version}"/>
- <property name="examples.final.name" value="${name}-examples-${version}"/>
- <property name="tools.final.name" value="${name}-tools-${version}"/>
- <property name="year" value="2009"/>
- <property name="src.dir" value="${basedir}/src"/>
- <property name="mapred.src.dir" value="${src.dir}/java"/>
- <property name="examples.dir" value="${basedir}/src/examples"/>
- <property name="lib.dir" value="${basedir}/lib"/>
- <property name="conf.dir" value="${basedir}/conf"/>
- <property name="contrib.dir" value="${basedir}/src/contrib"/>
- <property name="docs.src" value="${basedir}/src/docs"/>
- <property name="changes.src" value="${docs.src}/changes"/>
- <property name="c++.src" value="${basedir}/src/c++"/>
- <property name="c++.utils.src" value="${c++.src}/utils"/>
- <property name="c++.pipes.src" value="${c++.src}/pipes"/>
- <property name="c++.examples.pipes.src" value="${examples.dir}/pipes"/>
- <property name="c++.libhdfs.src" value="${c++.src}/libhdfs"/>
- <property name="librecordio.src" value="${c++.src}/librecordio"/>
- <property name="tools.src" value="${basedir}/src/tools"/>
- <property name="xercescroot" value=""/>
- <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.tools" value="${build.dir}/tools"/>
- <property name="build.webapps" value="${build.dir}/webapps"/>
- <property name="build.examples" value="${build.dir}/examples"/>
- <property name="build.librecordio" value="${build.dir}/librecordio"/>
- <!-- 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="jvm.arch"
- value="${sun.arch.data.model}"/>
- <property name="build.native" value="${build.dir}/native/${build.platform}"/>
- <property name="build.c++" value="${build.dir}/c++-build/${build.platform}"/>
- <property name="build.c++.utils" value="${build.c++}/utils"/>
- <property name="build.c++.pipes" value="${build.c++}/pipes"/>
- <property name="build.c++.libhdfs" value="${build.c++}/libhdfs"/>
- <property name="build.c++.examples.pipes"
- value="${build.c++}/examples/pipes"/>
- <property name="build.docs" value="${build.dir}/docs"/>
- <property name="build.javadoc" value="${build.docs}/api"/>
- <property name="build.javadoc.timestamp" value="${build.javadoc}/index.html" />
- <property name="build.javadoc.dev" value="${build.docs}/dev-api"/>
- <property name="build.encoding" value="ISO-8859-1"/>
- <property name="install.c++" value="${build.dir}/c++/${build.platform}"/>
- <property name="install.c++.examples"
- value="${build.dir}/c++-examples/${build.platform}"/>
- <property environment="env"/>
- <property name="test.src.dir" value="${basedir}/src/test"/>
- <property name="test.lib.dir" value="${basedir}/src/test/lib"/>
- <property name="test.build.dir" value="${build.dir}/test"/>
- <property name="test.generated.dir" value="${test.build.dir}/src"/>
- <property name="test.build.data" value="${test.build.dir}/data"/>
- <property name="test.cache.data" value="${test.build.dir}/cache"/>
- <property name="test.debug.data" value="${test.build.dir}/debug"/>
- <property name="test.log.dir" value="${test.build.dir}/logs"/>
- <property name="test.build.classes" value="${test.build.dir}/classes"/>
- <property name="test.mapred.build.testjar" value="${test.build.dir}/mapred/testjar"/>
- <property name="test.mapred.build.testshell" value="${test.build.dir}/mapred/testshell"/>
- <property name="test.build.extraconf" value="${test.build.dir}/extraconf"/>
- <property name="test.build.javadoc" value="${test.build.dir}/docs/api"/>
- <property name="test.build.javadoc.dev" value="${test.build.dir}/docs/dev-api"/>
- <property name="test.include" value="Test*"/>
- <property name="test.classpath.id" value="test.classpath"/>
- <property name="test.output" value="no"/>
- <property name="test.timeout" value="900000"/>
- <property name="test.junit.output.format" value="plain"/>
- <property name="test.junit.fork.mode" value="perTest" />
- <property name="test.junit.printsummary" value="yes" />
- <property name="test.junit.haltonfailure" value="no" />
- <property name="test.junit.maxmemory" value="512m" />
- <property name="test.tmp.dir" value="${env.TMP}" />
- <property name="test.temp.dir" value="${env.TEMP}" />
- <property name="test.conf.dir" value="${build.dir}/test/conf" />
- <property name="test.tools.input.dir" value="${basedir}/src/test/tools/data" />
- <property name="test.mapred.build.classes" value="${test.build.dir}/mapred/classes"/>
- <property name="test.mapred.commit.tests.file" value="${test.src.dir}/commit-tests" />
- <property name="test.mapred.all.tests.file" value="${test.src.dir}/all-tests" />
- <property name="test.libhdfs.conf.dir" value="${c++.libhdfs.src}/tests/conf"/>
- <property name="test.libhdfs.dir" value="${test.build.dir}/libhdfs"/>
- <property name="librecordio.test.dir" value="${test.build.dir}/librecordio"/>
- <property name="web.src.dir" value="${basedir}/src/web"/>
- <property name="src.webapps" value="${basedir}/src/webapps"/>
- <property name="javadoc.link.java"
- value="http://java.sun.com/javase/6/docs/api/"/>
- <property name="javadoc.packages" value="org.apache.hadoop.*"/>
- <property name="javadoc.maxmemory" value="512m" />
- <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.6"/>
- <property name="javac.args" value=""/>
- <property name="javac.args.warnings" value="-Xlint:unchecked"/>
- <property name="clover.db.dir" location="${build.dir}/test/clover/db"/>
- <property name="clover.report.dir" location="${build.dir}/test/clover/reports"/>
- <property name="rat.reporting.classname" value="rat.Report"/>
- <property name="jdiff.build.dir" value="${build.docs}/jdiff"/>
- <property name="jdiff.xml.dir" value="${lib.dir}/jdiff"/>
- <property name="jdiff.stable" value="0.21.0"/>
- <property name="jdiff.stable.javadoc"
- value="http://hadoop.apache.org/core/docs/r${jdiff.stable}/api/"/>
- <property name="scratch.dir" value="${user.home}/tmp"/>
- <property name="svn.cmd" value="svn"/>
- <property name="grep.cmd" value="grep"/>
- <property name="patch.cmd" value="patch"/>
- <property name="make.cmd" value="make"/>
- <property name="findbugs.heap.size" value="512M"/>
- <!-- task-controller properties set here -->
- <!-- Source directory from where configure is run and files are copied
- -->
-
- <property name="c++.task-controller.src"
- value="${basedir}/src/c++/task-controller" />
- <!-- directory where autoconf files + temporary files and src is
- stored for compilation -->
- <property name="build.c++.task-controller"
- value="${build.c++}/task-controller" />
- <!-- the default install dir is build directory override it using
- -Dtask-controller.install.dir=$HADOOP_HOME/bin -->
- <property name="task-controller.install.dir" value="${dist.dir}/bin" />
- <!-- end of task-controller properties -->
-
- <!-- IVY properteis set here -->
- <property name="ivy.dir" location="ivy" />
- <loadproperties srcfile="${ivy.dir}/libraries.properties"/>
- <property name="mvn.repo" value="http://repo2.maven.org/maven2"/>
- <property name="ivy.jar" location="${ivy.dir}/ivy-${ivy.version}.jar"/>
- <property name="repo" value="snapshots"/>
- <property name="asfrepo" value="https://repository.apache.org/content/repositories/${repo}"/>
- <property name="ant_task.jar" location="${ivy.dir}/maven-ant-tasks-${ant-task.version}.jar"/>
- <property name="ant_task_repo_url" value="${mvn.repo}/org/apache/maven/maven-ant-tasks/${ant-task.version}/maven-ant-tasks-${ant-task.version}.jar"/>
- <property name="ivy_repo_url" value="${mvn.repo}/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar"/>
- <property name="ivysettings.xml" location="${ivy.dir}/ivysettings.xml" />
- <property name="ivy.org" value="org.apache.hadoop"/>
- <property name="build.dir" location="build" />
- <property name="dist.dir" value="${build.dir}/${final.name}"/>
- <property name="build.ivy.dir" location="${build.dir}/ivy" />
- <property name="build.ivy.lib.dir" location="${build.ivy.dir}/lib" />
- <property name="common.ivy.lib.dir" location="${build.ivy.lib.dir}/${ant.project.name}/common"/>
- <property name="build.ivy.report.dir" location="${build.ivy.dir}/report" />
- <property name="build.ivy.maven.dir" location="${build.ivy.dir}/maven" />
- <property name="build.ivy.maven.pom" location="${build.ivy.maven.dir}/hadoop-mapred-${version}.pom" />
- <property name="build.ivy.maven.jar" location="${build.ivy.maven.dir}/hadoop-mapred-${version}.jar" />
- <property name="hadoop-mapred.pom" location="${ivy.dir}/hadoop-mapred.xml"/>
- <property name="hadoop-mapred-test.pom" location="${ivy.dir}/hadoop-mapred-test.xml"/>
- <property name="hadoop-mapred-examples.pom" location="${ivy.dir}/hadoop-mapred-examples.xml"/>
- <property name="hadoop-mapred-tools.pom" location="${ivy.dir}/hadoop-mapred-tools.xml"/>
- <!--this is the naming policy for artifacts we want pulled down-->
- <property name="ivy.artifact.retrieve.pattern" value="${ant.project.name}/[conf]/[artifact]-[revision].[ext]"/>
- <!--this is how artifacts that get built are named-->
- <property name="ivy.publish.pattern" value="hadoop-[revision]-core.[ext]"/>
- <property name="hadoop-mapred.jar" location="${build.dir}/${final.name}.jar" />
- <property name="hadoop-mapred-test.jar" location="${build.dir}/${test.final.name}.jar" />
- <property name="hadoop-mapred-examples.jar" location="${build.dir}/${examples.final.name}.jar" />
- <property name="hadoop-mapred-tools.jar" location="${build.dir}/${tools.final.name}.jar" />
- <!-- jdiff.home property set -->
- <property name="jdiff.home" value="${build.ivy.lib.dir}/${ant.project.name}/jdiff"/>
- <property name="jdiff.jar" value="${jdiff.home}/jdiff-${jdiff.version}.jar"/>
- <property name="xerces.jar" value="${jdiff.home}/xerces-${xerces.version}.jar"/>
- <property name="clover.jar" location="${clover.home}/lib/clover.jar"/>
- <available property="clover.present" file="${clover.jar}" />
- <!-- check if clover reports should be generated -->
- <condition property="clover.enabled">
- <and>
- <isset property="run.clover"/>
- <isset property="clover.present"/>
- </and>
- </condition>
- <!-- the normal classpath -->
- <path id="classpath">
- <pathelement location="${build.classes}"/>
- <pathelement location="${conf.dir}"/>
- <path refid="ivy-common.classpath"/>
- </path>
- <path id="test.classpath">
- <pathelement location="${test.build.extraconf}"/>
- <pathelement location="${test.core.build.classes}" />
- <pathelement location="${test.src.dir}"/>
- <pathelement location="${build.dir}"/>
- <pathelement location="${build.examples}"/>
- <pathelement location="${build.tools}"/>
- <pathelement path="${clover.jar}"/>
- <pathelement location="${build.classes}"/>
- <pathelement location="${test.conf.dir}"/>
- <path refid="ivy-common.classpath"/>
- <pathelement location="${test.mapred.build.classes}" />
- <path refid="ivy-test.classpath"/>
- </path>
- <!-- the cluster test classpath: uses conf.dir for configuration -->
- <path id="test.cluster.classpath">
- <path refid="classpath"/>
- <pathelement location="${test.build.classes}" />
- <pathelement location="${test.src.dir}"/>
- <pathelement location="${build.dir}"/>
- </path>
- <!-- ====================================================== -->
- <!-- Macro definitions -->
- <!-- ====================================================== -->
- <macrodef name="macro_tar" description="Worker Macro for tar">
- <attribute name="param.destfile"/>
- <element name="param.listofitems"/>
- <sequential>
- <tar compression="gzip" longfile="gnu"
- destfile="@{param.destfile}">
- <param.listofitems/>
- </tar>
- </sequential>
- </macrodef>
- <!-- ====================================================== -->
- <!-- Stuff needed by all targets -->
- <!-- ====================================================== -->
- <target name="init" depends="ivy-retrieve-common">
- <mkdir dir="${build.dir}"/>
- <mkdir dir="${build.classes}"/>
- <mkdir dir="${build.tools}"/>
- <mkdir dir="${build.src}"/>
- <mkdir dir="${build.webapps}/task/WEB-INF"/>
- <mkdir dir="${build.webapps}/job/WEB-INF"/>
- <mkdir dir="${build.examples}"/>
- <mkdir dir="${build.dir}/c++"/>
-
- <mkdir dir="${test.build.dir}"/>
- <mkdir dir="${test.build.classes}"/>
- <mkdir dir="${test.build.extraconf}"/>
- <tempfile property="touch.temp.file" destDir="${java.io.tmpdir}"/>
- <touch millis="0" file="${touch.temp.file}">
- <fileset dir="${conf.dir}" includes="**/*.template"/>
- <fileset dir="${contrib.dir}" includes="**/*.template"/>
- </touch>
- <delete file="${touch.temp.file}"/>
- <!-- copy all of the jsp and static files -->
- <copy todir="${build.webapps}">
- <fileset dir="${src.webapps}">
- <exclude name="**/*.jsp" />
- <exclude name="**/*.jspx" />
- </fileset>
- </copy>
- <unzip src="${common.ivy.lib.dir}/hadoop-hdfs-${hadoop-hdfs.version}.jar"
- dest="${build.dir}">
- <patternset>
- <include name="webapps/hdfs/**"/>
- <include name="webapps/datanode/**"/>
- <include name="webapps/secondary/**"/>
- </patternset>
- </unzip>
- <copy todir="${conf.dir}" verbose="true">
- <fileset dir="${conf.dir}" includes="**/*.template"/>
- <mapper type="glob" from="*.template" to="*"/>
- </copy>
- <mkdir dir="${test.conf.dir}"/>
- <copy todir="${test.conf.dir}" verbose="true">
- <fileset dir="${conf.dir}" includes="**/*.template"/>
- <mapper type="glob" from="*.template" to="*"/>
- </copy>
- <copy todir="${contrib.dir}" verbose="true">
- <fileset dir="${contrib.dir}" includes="**/*.template"/>
- <mapper type="glob" from="*.template" to="*"/>
- </copy>
- </target>
- <target name="avro-generate" depends="init">
- <mkdir dir="${build.src}/org/apache/hadoop/mapreduce/jobhistory"/>
- <taskdef name="protocol" classname="org.apache.avro.specific.ProtocolTask">
- <classpath refid="classpath" />
- </taskdef>
- <protocol destdir="${build.src}">
- <fileset dir="${mapred.src.dir}">
- <include name="**/*.avpr" />
- </fileset>
- </protocol>
- </target>
- <target name="compile-mapred-classes" depends="init,avro-generate">
- <taskdef classname="org.apache.jasper.JspC" name="jsp-compile" >
- <classpath refid="classpath"/>
- </taskdef>
- <jsp-compile
- uriroot="${src.webapps}/task"
- outputdir="${build.src}"
- package="org.apache.hadoop.mapred"
- webxml="${build.webapps}/task/WEB-INF/web.xml">
- </jsp-compile>
- <jsp-compile
- uriroot="${src.webapps}/job"
- outputdir="${build.src}"
- package="org.apache.hadoop.mapred"
- webxml="${build.webapps}/job/WEB-INF/web.xml">
- </jsp-compile>
- <!-- Compile Java files (excluding JSPs) checking warnings -->
- <javac
- encoding="${build.encoding}"
- srcdir="${mapred.src.dir};${build.src}"
- includes="org/apache/hadoop/**/*.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="${mapred.src.dir}" includes="**/*.properties"/>
- <fileset dir="${mapred.src.dir}" includes="mapred-default.xml"/>
- <fileset dir="${mapred.src.dir}" includes="mapred-queues-default.xml"/>
- </copy>
- </target>
- <target name="compile-tools" depends="init">
- <javac
- encoding="${build.encoding}"
- srcdir="${tools.src}"
- includes="org/apache/hadoop/**/*.java"
- destdir="${build.tools}"
- 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.tools}">
- <fileset
- dir="${tools.src}"
- includes="**/*.properties"
- />
- </copy>
- </target>
- <target name="compile-core" depends="clover, compile-mapred-classes, compile-c++" description="Compile core only"/>
- <target name="compile-contrib" depends="compile-core,tools,compile-c++-libhdfs">
- <subant target="compile">
- <property name="version" value="${version}"/>
- <property name="hadoop-core.version" value="${hadoop-core.version}"/>
- <fileset file="${contrib.dir}/build.xml"/>
- </subant>
- </target>
-
- <target name="compile" depends="compile-core, compile-contrib, compile-tools" description="Compile core, contrib">
- </target>
- <target name="compile-examples"
- depends="compile-core,compile-tools,compile-c++-examples">
- <javac
- encoding="${build.encoding}"
- srcdir="${examples.dir}"
- includes="org/apache/hadoop/**/*.java"
- destdir="${build.examples}"
- debug="${javac.debug}"
- optimize="${javac.optimize}"
- target="${javac.version}"
- source="${javac.version}"
- deprecation="${javac.deprecation}">
- <compilerarg line="${javac.args} ${javac.args.warnings}" />
- <classpath>
- <path refid="classpath"/>
- <pathelement location="${build.tools}"/>
- </classpath>
- </javac>
- </target>
- <!-- ================================================================== -->
- <!-- Make hadoop-mapred.jar -->
- <!-- ================================================================== -->
- <!-- -->
- <!-- ================================================================== -->
- <target name="jar" depends="compile-core" description="Make hadoop-mapered.jar">
- <jar jarfile="${hadoop-mapred.jar}"
- basedir="${build.classes}">
- <manifest>
- <section name="org/apache/hadoop">
- <attribute name="Implementation-Title" value="${ant.project.name}"/>
- <attribute name="Implementation-Version" value="${version}"/>
- <attribute name="Implementation-Vendor" value="Apache"/>
- </section>
- </manifest>
- <!-- <fileset file="${conf.dir}/commons-logging.properties"/>
- <fileset file="${conf.dir}/log4j.properties"/>
- <fileset file="${conf.dir}/hadoop-metrics.properties"/> -->
- <zipfileset dir="${build.webapps}" prefix="webapps"/>
- </jar>
- </target>
- <!-- ================================================================== -->
- <!-- Make the Hadoop examples jar. -->
- <!-- ================================================================== -->
- <!-- -->
- <!-- ================================================================== -->
- <target name="examples" depends="jar, compile-examples" description="Make the Hadoop examples jar.">
- <jar jarfile="${build.dir}/${examples.final.name}.jar"
- basedir="${build.examples}">
- <manifest>
- <attribute name="Main-Class"
- value="org/apache/hadoop/examples/ExampleDriver"/>
- </manifest>
- </jar>
- </target>
- <target name="tools" depends="jar, compile-tools"
- description="Make the Hadoop tools jar.">
- <jar jarfile="${build.dir}/${tools.final.name}.jar"
- basedir="${build.tools}">
- </jar>
- </target>
- <!-- ================================================================== -->
- <!-- Compile test code -->
- <!-- ================================================================== -->
- <target name="compile-mapred-test" depends="compile-mapred-classes, compile-examples, ivy-retrieve-test">
- <mkdir dir="${test.mapred.build.classes}"/>
- <mkdir dir="${test.mapred.build.testjar}"/>
- <mkdir dir="${test.mapred.build.testshell}"/>
- <javac
- encoding="${build.encoding}"
- srcdir="${test.src.dir}/mapred"
- includes="org/apache/hadoop/**/*.java"
- destdir="${test.mapred.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="test.classpath"/>
- </javac>
- <javac
- encoding="${build.encoding}"
- srcdir="${test.src.dir}/mapred/testjar"
- includes="*.java"
- destdir="${test.mapred.build.testjar}"
- debug="${javac.debug}"
- optimize="${javac.optimize}"
- target="${javac.version}"
- source="${javac.version}"
- deprecation="${javac.deprecation}">
- <compilerarg line="${javac.args} ${javac.args.warnings}" />
- <classpath refid="test.classpath"/>
- </javac>
- <delete file="${test.mapred.build.testjar}/testjob.jar"/>
- <jar jarfile="${test.mapred.build.testjar}/testjob.jar"
- basedir="${test.mapred.build.testjar}">
- </jar>
- <javac
- encoding="${build.encoding}"
- srcdir="${test.src.dir}/mapred/testshell"
- includes="*.java"
- destdir="${test.mapred.build.testshell}"
- debug="${javac.debug}"
- optimize="${javac.optimize}"
- target="${javac.version}"
- source="${javac.version}"
- deprecation="${javac.deprecation}">
- <compilerarg line="${javac.args} ${javac.args.warnings}"/>
- <classpath refid="test.classpath"/>
- </javac>
- <delete file="${test.mapred.build.testshell}/testshell.jar"/>
- <jar jarfile="${test.mapred.build.testshell}/testshell.jar"
- basedir="${test.mapred.build.testshell}">
- </jar>
- <delete dir="${test.cache.data}"/>
- <mkdir dir="${test.cache.data}"/>
- <delete dir="${test.debug.data}"/>
- <mkdir dir="${test.debug.data}"/>
- <copy file="${test.src.dir}/mapred/org/apache/hadoop/mapred/testscript.txt" todir="${test.debug.data}"/>
- <copy file="${test.src.dir}/mapred/org/apache/hadoop/mapred/test.txt" todir="${test.cache.data}"/>
- <copy file="${test.src.dir}/mapred/org/apache/hadoop/mapred/test.jar" todir="${test.cache.data}"/>
- <copy file="${test.src.dir}/mapred/org/apache/hadoop/mapred/test.zip" todir="${test.cache.data}"/>
- <copy file="${test.src.dir}/mapred/org/apache/hadoop/mapred/test.tar" todir="${test.cache.data}"/>
- <copy file="${test.src.dir}/mapred/org/apache/hadoop/mapred/test.tgz" todir="${test.cache.data}"/>
- <copy file="${test.src.dir}/mapred/org/apache/hadoop/mapred/test.tar.gz" todir="${test.cache.data}"/>
- <copy file="${test.src.dir}/mapred/org/apache/hadoop/cli/testMRConf.xml" todir="${test.cache.data}"/>
- <copy file="${test.src.dir}/mapred/org/apache/hadoop/cli/data60bytes" todir="${test.cache.data}"/>
- </target>
- <!-- ================================================================== -->
- <!-- Make hadoop-mapred-test.jar -->
- <!-- ================================================================== -->
- <!-- -->
- <!-- ================================================================== -->
- <target name="jar-test" depends="compile-mapred-test" description="Make hadoop-mapred-test.jar">
- <copy todir="${test.build.classes}">
- <fileset dir="${test.mapred.build.classes}"/>
- </copy>
- <jar jarfile="${build.dir}/${test.final.name}.jar"
- basedir="${test.build.classes}">
- <manifest>
- <attribute name="Main-Class"
- value="org/apache/hadoop/test/MapredTestDriver"/>
- <section name="org/apache/hadoop">
- <attribute name="Implementation-Title" value="${ant.project.name}"/>
- <attribute name="Implementation-Version" value="${version}"/>
- <attribute name="Implementation-Vendor" value="Apache"/>
- </section>
- </manifest>
- </jar>
- </target>
- <macrodef name="macro-test-runner">
- <attribute name="test.file" />
- <sequential>
- <delete dir="${test.build.data}"/>
- <mkdir dir="${test.build.data}"/>
- <delete dir="${test.log.dir}"/>
- <mkdir dir="${test.log.dir}"/>
- <copy file="${test.src.dir}/hadoop-policy.xml"
- todir="${test.build.extraconf}" />
- <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">
- <sysproperty key="test.build.data" value="${test.build.data}"/>
- <sysproperty key="test.tools.input.dir" value = "${test.tools.input.dir}"/>
- <sysproperty key="test.cache.data" value="${test.cache.data}"/>
- <sysproperty key="test.debug.data" value="${test.debug.data}"/>
- <sysproperty key="hadoop.log.dir" value="${test.log.dir}"/>
- <sysproperty key="test.src.dir" value="${test.src.dir}"/>
- <sysproperty key="taskcontroller-path" value="${taskcontroller-path}"/>
- <sysproperty key="taskcontroller-ugi" value="${taskcontroller-ugi}"/>
- <sysproperty key="test.build.extraconf" value="${test.build.extraconf}" />
- <sysproperty key="hadoop.policy.file" value="hadoop-policy.xml"/>
- <sysproperty key="java.library.path"
- value="${build.native}/lib:${lib.dir}/native/${build.platform}"/>
- <sysproperty key="install.c++.examples" value="${install.c++.examples}"/>
- <syspropertyset dynamic="no">
- <propertyref name="hadoop.tmp.dir"/>
- </syspropertyset>
- <!-- set compile.c++ in the child jvm only if it is set -->
- <syspropertyset dynamic="no">
- <propertyref name="compile.c++"/>
- </syspropertyset>
- <classpath refid="test.classpath"/>
- <formatter type="${test.junit.output.format}" />
- <batchtest todir="${test.build.dir}" unless="testcase">
- <fileset dir="${test.src.dir}/mapred" excludes="**/${test.exclude}.java">
- <patternset>
- <includesfile name="@{test.file}"/>
- </patternset>
- </fileset>
- </batchtest>
- <batchtest todir="${test.build.dir}" if="testcase">
- <fileset dir="${test.src.dir}/mapred" includes="**/${testcase}.java"/>
- </batchtest>
- </junit>
- <antcall target="checkfailure"/>
- </sequential>
- </macrodef>
- <target name="run-test-mapred" depends="compile-mapred-test" description="Run mapred unit tests">
- <macro-test-runner test.file="${test.mapred.all.tests.file}" />
- </target>
- <target name="run-commit-test" depends="compile-mapred-test" description="Run approximate 10-minute set of unit tests prior to commiting">
- <macro-test-runner test.file="${test.mapred.commit.tests.file}" />
- </target>
-
- <target name="checkfailure" if="tests.failed">
- <touch file="${test.build.dir}/testsfailed"/>
- <fail unless="continueOnFailure">Tests failed!</fail>
- </target>
- <target name="test-contrib" depends="compile,compile-tools,compile-mapred-test" description="Run contrib unit tests">
- <subant target="test">
- <property name="version" value="${version}"/>
- <property name="clover.jar" value="${clover.jar}"/>
- <fileset file="${contrib.dir}/build.xml"/>
- </subant>
- </target>
- <target name="test-core" description="Run core, hdfs and mapred unit tests">
- <delete file="${test.build.dir}/testsfailed"/>
- <property name="continueOnFailure" value="true"/>
- <antcall target="run-test-mapred"/>
- <available file="${test.build.dir}/testsfailed" property="testsfailed"/>
- <fail if="testsfailed">Tests failed!</fail>
- </target>
- <target name="test" depends="test-c++-libhdfs, jar-test, test-core" description="Run all unit tests">
- <subant target="test-contrib">
- <fileset file="${basedir}/build.xml"/>
- </subant>
- </target>
- <!-- Run all unit tests, not just Test*, and use non-test configuration. -->
- <target name="test-cluster" description="Run all unit tests, not just Test*, and use non-test configuration.">
- <antcall target="test">
- <param name="test.include" value="*"/>
- <param name="test.classpath.id" value="test.cluster.classpath"/>
- </antcall>
- </target>
- <target name="nightly" depends="test, tar">
- </target>
-
- <!-- ================================================================== -->
- <!-- Run optional third-party tool targets -->
- <!-- ================================================================== -->
- <target name="checkstyle" depends="ivy-retrieve-checkstyle,check-for-checkstyle" if="checkstyle.present" description="Run optional third-party tool targets">
- <taskdef resource="checkstyletask.properties">
- <classpath refid="checkstyle-classpath"/>
- </taskdef>
-
- <mkdir dir="${test.build.dir}"/>
-
- <checkstyle config="${test.src.dir}/checkstyle.xml"
- failOnViolation="false">
- <fileset dir="${mapred.src.dir}" includes="**/*.java" excludes="**/generated/**"/>
- <formatter type="xml" toFile="${test.build.dir}/checkstyle-errors.xml"/>
- </checkstyle>
-
- <xslt style="${test.src.dir}/checkstyle-noframes-sorted.xsl"
- in="${test.build.dir}/checkstyle-errors.xml"
- out="${test.build.dir}/checkstyle-errors.html"/>
- </target>
-
- <target name="check-for-checkstyle">
- <available property="checkstyle.present" resource="checkstyletask.properties">
- <classpath refid="checkstyle-classpath"/>
- </available>
- </target>
- <target name="all-jars" depends="tools,examples,jar-test">
- <subant target="jar">
- <property name="version" value="${version}"/>
- <property name="dist.dir" value="${dist.dir}"/>
- <fileset file="${contrib.dir}/streaming/build.xml"/>
- <fileset file="${contrib.dir}/gridmix/build.xml"/>
- <fileset file="${contrib.dir}/mumak/build.xml"/>
- </subant>
- </target>
- <property name="findbugs.home" value=""/>
- <target name="findbugs" depends="check-for-findbugs, all-jars" if="findbugs.present" description="Run findbugs if present">
- <property name="findbugs.out.dir" value="${test.build.dir}/findbugs"/>
- <property name="findbugs.exclude.file" value="${test.src.dir}/findbugsExcludeFile.xml"/>
- <property name="findbugs.report.htmlfile" value="${findbugs.out.dir}/hadoop-findbugs-report.html"/>
- <property name="findbugs.report.xmlfile" value="${findbugs.out.dir}/hadoop-findbugs-report.xml"/>
- <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
- classpath="${findbugs.home}/lib/findbugs-ant.jar" />
- <mkdir dir="${findbugs.out.dir}"/>
- <findbugs home="${findbugs.home}" output="xml:withMessages"
- outputFile="${findbugs.report.xmlfile}" effort="max"
- excludeFilter="${findbugs.exclude.file}" jvmargs="-Xmx${findbugs.heap.size}">
- <auxClasspath>
- <fileset dir="${lib.dir}">
- <include name="**/*.jar"/>
- </fileset>
- <fileset dir="${build.ivy.lib.dir}/${ant.project.name}/common">
- <include name="**/*.jar"/>
- </fileset>
- </auxClasspath>
- <sourcePath path="${mapred.src.dir}"/>
- <sourcePath path="${examples.dir}" />
- <sourcePath path="${tools.src}" />
- <sourcePath path="${basedir}/src/contrib/streaming/src/java" />
- <sourcePath path="${basedir}/src/contrib/gridmix/src/java" />
- <sourcePath path="${basedir}/src/contrib/mumak/src/java" />
- <class location="${basedir}/build/${final.name}.jar" />
- <class location="${basedir}/build/${examples.final.name}.jar" />
- <class location="${basedir}/build/${tools.final.name}.jar" />
- <class location="${basedir}/build/contrib/streaming/hadoop-${version}-streaming.jar" />
- <class location="${basedir}/build/contrib/gridmix/hadoop-${version}-gridmix.jar" />
- <class location="${basedir}/build/contrib/mumak/hadoop-${version}-mumak.jar" />
- </findbugs>
- <xslt style="${findbugs.home}/src/xsl/default.xsl"
- in="${findbugs.report.xmlfile}"
- out="${findbugs.report.htmlfile}"/>
- </target>
-
- <target name="check-for-findbugs">
- <available property="findbugs.present"
- file="${findbugs.home}/lib/findbugs.jar" />
- </target>
- <!-- ================================================================== -->
- <!-- Documentation -->
- <!-- ================================================================== -->
-
- <target name="docs" depends="forrest.check" description="Generate forrest-based documentation. To use, specify -Dforrest.home=<base of Apache Forrest installation> on the command line." if="forrest.home">
- <copy file="${conf.dir}/mapred-queues.xml.template"
- tofile="${build.docs}/mapred-queues.xml"/>
- <exec dir="${docs.src}" executable="${forrest.home}/bin/forrest"
- failonerror="true">
- <env key="JAVA_HOME" value="${java5.home}"/>
- </exec>
- <copy todir="${build.docs}">
- <fileset dir="${docs.src}/build/site/" />
- </copy>
- <copy file="${docs.src}/releasenotes.html" todir="${build.docs}"/>
- <style basedir="${mapred.src.dir}" destdir="${build.docs}"
- includes="mapred-default.xml" style="conf/configuration.xsl"/>
- <antcall target="changes-to-html"/>
- <subant target="docs">
- <property name="build.docs" value="${build.docs}"/>
- <fileset file="${contrib.dir}/build.xml"/>
- </subant>
- </target>
- <target name="javadoc-dev" depends="compile, ivy-retrieve-javadoc" description="Generate javadoc for hadoop developers">
- <mkdir dir="${build.javadoc.dev}"/>
- <javadoc
- overview="${mapred.src.dir}/overview.html"
- packagenames="org.apache.hadoop.*"
- destdir="${build.javadoc.dev}"
- author="true"
- version="true"
- use="true"
- windowtitle="${Name} ${version} API"
- doctitle="${Name} ${version} Developer API"
- bottom="Copyright &copy; ${year} The Apache Software Foundation"
- maxmemory="${javadoc.maxmemory}"
- >
- <packageset dir="${mapred.src.dir}"/>
- <packageset dir="${examples.dir}"/>
- <packageset dir="src/contrib/streaming/src/java"/>
- <packageset dir="src/contrib/data_join/src/java"/>
- <packageset dir="src/contrib/index/src/java"/>
- <packageset dir="src/contrib/gridmix/src/java"/>
- <packageset dir="src/contrib/mumak/src/java"/>
- <link href="${javadoc.link.java}"/>
- <classpath >
- <path refid="classpath" />
- <fileset dir="src/contrib/">
- <include name="*/lib/*.jar" />
- </fileset>
- <path refid="javadoc-classpath"/>
- <pathelement path="${java.class.path}"/>
- <pathelement path="${lib.dir}/hadoop-core-test-${hadoop-core.version}.jar"/>
- <pathelement location="${build.tools}"/>
- </classpath>
- <group title="Examples" packages="org.apache.hadoop.examples*"/>
- <group title="contrib: Streaming" packages="org.apache.hadoop.streaming*"/>
- <group title="contrib: DataJoin" packages="org.apache.hadoop.contrib.utils.join*"/>
- <group title="contrib: Index" packages="org.apache.hadoop.contrib.index*"/>
- </javadoc>
- </target>
- <target name="javadoc-uptodate" depends="compile, ivy-retrieve-javadoc">
- <uptodate property="javadoc.is.uptodate">
- <srcfiles dir="${src.dir}">
- <include name="**/*.java" />
- <include name="**/*.html" />
- </srcfiles>
- <mapper type="merge" to="${build.javadoc.timestamp}" />
- </uptodate>
- </target>
-
- <target name="javadoc" description="Generate javadoc" depends="javadoc-uptodate"
- unless="javadoc.is.uptodate">
- <mkdir dir="${build.javadoc}"/>
- <javadoc
- overview="${mapred.src.dir}/overview.html"
- packagenames="org.apache.hadoop.*"
- destdir="${build.javadoc}"
- author="true"
- version="true"
- use="true"
- windowtitle="${Name} ${version} API"
- doctitle="${Name} ${version} API"
- bottom="Copyright &copy; ${year} The Apache Software Foundation"
- maxmemory="${javadoc.maxmemory}"
- >
- <packageset dir="${mapred.src.dir}"/>
- <packageset dir="${examples.dir}"/>
- <packageset dir="src/contrib/streaming/src/java"/>
- <packageset dir="src/contrib/data_join/src/java"/>
- <packageset dir="src/contrib/index/src/java"/>
- <packageset dir="src/contrib/gridmix/src/java"/>
- <packageset dir="src/contrib/mumak/src/java"/>
-
- <link href="${javadoc.link.java}"/>
- <classpath >
- <path refid="classpath" />
- <fileset dir="src/contrib/">
- <include name="*/lib/*.jar" />
- </fileset>
- <path refid="javadoc-classpath"/>
- <pathelement path="${java.class.path}"/>
- <pathelement path="${lib.dir}/hadoop-core-test-${hadoop-core.version}.jar"/>
- <pathelement location="${build.tools}"/>
- </classpath>
- <group title="Examples" packages="org.apache.hadoop.examples*"/>
- <group title="contrib: Streaming" packages="org.apache.hadoop.streaming*"/>
- <group title="contrib: DataJoin" packages="org.apache.hadoop.contrib.utils.join*"/>
- <group title="contrib: Index" packages="org.apache.hadoop.contrib.index*"/>
- </javadoc>
- </target>
- <target name="api-xml" depends="ivy-retrieve-jdiff,javadoc,write-null">
- <javadoc maxmemory="${javadoc.maxmemory}">
- <doclet name="jdiff.JDiff"
- path="${jdiff.jar}:${xerces.jar}">
- <param name="-apidir" value="${jdiff.xml.dir}"/>
- <param name="-apiname" value="hadoop-mapred ${version}"/>
- </doclet>
- <packageset dir="src/java"/>
- <packageset dir="src/tools"/>
- <classpath >
- <path refid="classpath" />
- <path refid="jdiff-classpath" />
- <pathelement path="${java.class.path}"/>
- </classpath>
- </javadoc>
- </target>
-
- <target name="write-null">
- <exec executable="touch">
- <arg value="${jdiff.home}/Null.java"/>
- </exec>
- </target>
- <target name="api-report" depends="ivy-retrieve-jdiff,api-xml">
- <mkdir dir="${jdiff.build.dir}"/>
- <javadoc sourcepath="src/java,src/tools"
- destdir="${jdiff.build.dir}"
- sourceFiles="${jdiff.home}/Null.java"
- maxmemory="${javadoc.maxmemory}">
- <doclet name="jdiff.JDiff"
- path="${jdiff.jar}:${xerces.jar}">
- <param name="-oldapi" value="hadoop-mapred ${jdiff.stable}"/>
- <param name="-newapi" value="hadoop-mapred ${version}"/>
- <param name="-oldapidir" value="${jdiff.xml.dir}"/>
- <param name="-newapidir" value="${jdiff.xml.dir}"/>
- <param name="-javadocold" value="${jdiff.stable.javadoc}"/>
- <param name="-javadocnew" value="../../api/"/>
- <param name="-stats"/>
- </doclet>
- <classpath >
- <path refid="classpath" />
- <path refid="jdiff-classpath"/>
- <pathelement path="${java.class.path}"/>
- </classpath>
- </javadoc>
- </target>
-
- <target name="changes-to-html" description="Convert CHANGES.txt into an html file">
- <mkdir dir="${build.docs}"/>
- <exec executable="perl" input="CHANGES.txt" output="${build.docs}/changes.html" failonerror="true">
- <arg value="${changes.src}/changes2html.pl"/>
- </exec>
- <copy todir="${build.docs}">
- <fileset dir="${changes.src}" includes="*.css"/>
- </copy>
- </target>
- <!-- ================================================================== -->
- <!-- D I S T R I B U T I O N -->
- <!-- ================================================================== -->
- <!-- -->
- <!-- ================================================================== -->
- <target name="package" depends="compile, jar, javadoc, docs, api-report, examples, tools, jar-test, package-librecordio"
- description="Build distribution">
- <mkdir dir="${dist.dir}"/>
- <mkdir dir="${dist.dir}/lib"/>
- <mkdir dir="${dist.dir}/contrib"/>
- <mkdir dir="${dist.dir}/bin"/>
- <mkdir dir="${dist.dir}/docs"/>
- <mkdir dir="${dist.dir}/docs/api"/>
- <mkdir dir="${dist.dir}/docs/jdiff"/>
- <copy todir="${dist.dir}/lib" includeEmptyDirs="false" flatten="true">
- <fileset dir="${common.ivy.lib.dir}"/>
- </copy>
- <copy todir="${dist.dir}/lib" includeEmptyDirs="false">
- <fileset dir="lib">
- <exclude name="**/native/**"/>
- </fileset>
- </copy>
- <subant target="package">
- <!--Pass down the version in case its needed again and the target
- distribution directory so contribs know where to install to.-->
- <property name="version" value="${version}"/>
- <property name="dist.dir" value="${dist.dir}"/>
- <fileset file="${contrib.dir}/build.xml"/>
- </subant>
- <copy todir="${dist.dir}/webapps">
- <fileset dir="${build.webapps}"/>
- </copy>
- <copy todir="${dist.dir}">
- <fileset file="${build.dir}/${final.name}*.jar"/>
- <fileset file="${build.dir}/${test.final.name}.jar"/>
- <fileset file="${build.dir}/${examples.final.name}.jar"/>
- <fileset file="${build.dir}/${tools.final.name}.jar"/>
- </copy>
-
- <copy todir="${dist.dir}/conf">
- <fileset dir="${conf.dir}" excludes="**/*.template"/>
- </copy>
- <copy todir="${dist.dir}/docs">
- <fileset dir="${build.docs}"/>
- </copy>
- <copy file="ivy.xml" tofile="${dist.dir}/ivy.xml"/>
- <copy todir="${dist.dir}/ivy">
- <fileset dir="ivy"/>
- </copy>
- <copy todir="${dist.dir}">
- <fileset dir=".">
- <include name="*.txt" />
- </fileset>
- </copy>
- <copy todir="${dist.dir}/src" includeEmptyDirs="true">
- <fileset dir="src" excludes="**/*.template **/docs/build/**/*"/>
- </copy>
-
- <copy todir="${dist.dir}/c++" includeEmptyDirs="false">
- <fileset dir="${build.dir}/c++"/>
- </copy>
- <copy todir="${dist.dir}/" file="build.xml"/>
- <chmod perm="ugo+x" type="file" parallel="false">
- <fileset dir="${dist.dir}/src/contrib/">
- <include name="*/bin/*" />
- </fileset>
- </chmod>
- <chmod perm="ugo+x" type="file">
- <fileset dir="${dist.dir}/src/c++/pipes/debug"/>
- </chmod>
- </target>
- <!-- ================================================================== -->
- <!-- Make release tarball -->
- <!-- ================================================================== -->
- <target name="tar" depends="package" description="Make release tarball">
- <macro_tar param.destfile="${build.dir}/${final.name}.tar.gz">
- <param.listofitems>
- <tarfileset dir="${build.dir}" mode="664">
- <exclude name="${final.name}/bin/*" />
- <exclude name="${final.name}/contrib/*/bin/*" />
- <include name="${final.name}/**" />
- </tarfileset>
- <tarfileset dir="${build.dir}" mode="755">
- <include name="${final.name}/bin/*" />
- <include name="${final.name}/contrib/*/bin/*" />
- </tarfileset>
- </param.listofitems>
- </macro_tar>
- </target>
- <target name="bin-package" depends="compile, jar, examples, tools, jar-test, package-librecordio"
- description="assembles artifacts for binary target">
- <mkdir dir="${dist.dir}"/>
- <mkdir dir="${dist.dir}/lib"/>
- <mkdir dir="${dist.dir}/contrib"/>
- <mkdir dir="${dist.dir}/bin"/>
- <copy todir="${dist.dir}/lib" includeEmptyDirs="false" flatten="true">
- <fileset dir="${common.ivy.lib.dir}"/>
- </copy>
- <copy todir="${dist.dir}/lib" includeEmptyDirs="false">
- <fileset dir="lib">
- <exclude name="**/native/**"/>
- </fileset>
- </copy>
- <subant target="package">
- <!--Pass down the version in case its needed again and the target
- distribution directory so contribs know where to install to.-->
- <property name="version" value="${version}"/>
- <property name="dist.dir" value="${dist.dir}"/>
- <fileset file="${contrib.dir}/build.xml"/>
- </subant>
- <copy todir="${dist.dir}/webapps">
- <fileset dir="${build.webapps}"/>
- </copy>
- <copy todir="${dist.dir}">
- <fileset file="${build.dir}/${final.name}*.jar"/>
- <!-- <fileset file="${build.dir}/${test.final.name}.jar"/>
- <fileset file="${build.dir}/${examples.final.name}.jar"/>
- <fileset file="${build.dir}/${tools.final.name}.jar"/> -->
- </copy>
-
- <copy todir="${dist.dir}/conf">
- <fileset dir="${conf.dir}" excludes="**/*.template"/>
- </copy>
- <copy file="ivy.xml" tofile="${dist.dir}/ivy.xml"/>
- <copy todir="${dist.dir}/ivy">
- <fileset dir="ivy"/>
- </copy>
- <copy todir="${dist.dir}">
- <fileset dir=".">
- <include name="*.txt" />
- </fileset>
- </copy>
-
- <copy todir="${dist.dir}/c++" includeEmptyDirs="false">
- <fileset dir="${build.dir}/c++"/>
- </copy>
- <copy todir="${dist.dir}/" file="build.xml"/>
- </target>
- <target name="binary" depends="bin-package" description="Make tarball without source and documentation">
- <macro_tar param.destfile="${build.dir}/${final.name}-bin.tar.gz">
- <param.listofitems>
- <tarfileset dir="${build.dir}" mode="664">
- <exclude name="${final.name}/bin/*" />
- <exclude name="${final.name}/src/**" />
- <exclude name="${final.name}/docs/**" />
- <include name="${final.name}/**" />
- </tarfileset>
- </param.listofitems>
- </macro_tar>
- </target>
- <target name="ant-task-download" description="To download mvn-ant-task">
- <get src="${ant_task_repo_url}" dest="${ant_task.jar}" usetimestamp="true"/>
- </target>
- <target name="mvn-taskdef" depends="ant-task-download">
- <path id="mvn-ant-task.classpath" path="${ant_task.jar}"/>
- <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
- uri="urn:maven-artifact-ant"
- classpathref="mvn-ant-task.classpath"/>
- </target>
- <target name="clean-cache" description="Clean. Delete ivy cache">
- <delete dir="${user.home}/.ivy2/cache/org.apache.hadoop/hadoop-core"/>
- <delete dir="${user.home}/.ivy2/cache/org.apache.hadoop/hadoop-core-test"/>
- <delete dir="${user.home}/.ivy2/cache/org.apache.hadoop/hadoop-hdfs"/>
- <delete dir="${user.home}/.ivy2/cache/org.apache.hadoop/hadoop-hdfs-test"/>
- </target>
- <target name="mvn-install-mapred" depends="mvn-taskdef,examples,tools,set-version">
- <artifact:pom file="${hadoop-mapred.pom}" id="hadoop.mapred"/>
- <artifact:pom file="${hadoop-mapred-examples.pom}" id="hadoop.mapred.examples"/>
- <artifact:pom file="${hadoop-mapred-tools.pom}" id="hadoop.mapred.tools"/>
- <artifact:install file="${hadoop-mapred.jar}">
- <pom refid="hadoop.mapred"/>
- </artifact:install>
- <artifact:install file="${hadoop-mapred-examples.jar}">
- <pom refid="hadoop.mapred.examples"/>
- </artifact:install>
- <artifact:install file="${hadoop-mapred-tools.jar}">
- <pom refid="hadoop.mapred.tools"/>
- </artifact:install>
- </target>
- <target name="mvn-install" depends="mvn-taskdef,examples,tools,jar-test,set-version">
- <artifact:pom file="${hadoop-mapred.pom}" id="hadoop.mapred"/>
- <artifact:pom file="${hadoop-mapred-test.pom}" id="hadoop.mapred.test"/>
- <artifact:pom file="${hadoop-mapred-examples.pom}" id="hadoop.mapred.examples"/>
- <artifact:pom file="${hadoop-mapred-tools.pom}" id="hadoop.mapred.tools"/>
- <artifact:install file="${hadoop-mapred.jar}">
- <pom refid="hadoop.mapred"/>
- </artifact:install>
- <artifact:install file="${hadoop-mapred-test.jar}">
- <pom refid="hadoop.mapred.test"/>
- </artifact:install>
- <artifact:install file="${hadoop-mapred-examples.jar}">
- <pom refid="hadoop.mapred.examples"/>
- </artifact:install>
- <artifact:install file="${hadoop-mapred-tools.jar}">
- <pom refid="hadoop.mapred.tools"/>
- </artifact:install>
- </target>
- <target name="mvn-deploy" depends="mvn-taskdef, examples, tools, jar-test, set-version">
- <artifact:pom file="${hadoop-mapred.pom}" id="hadoop.mapred"/>
- <artifact:pom file="${hadoop-mapred-test.pom}" id="hadoop.mapred.test"/>
- <artifact:pom file="${hadoop-mapred-examples.pom}" id="hadoop.mapred.examples"/>
- <artifact:pom file="${hadoop-mapred-tools.pom}" id="hadoop.mapred.tools"/>
- <artifact:install-provider artifactId="wagon-http" version="1.0-beta-2"/>
- <artifact:deploy file="${hadoop-mapred.jar}">
- <remoteRepository id="apache.snapshots.https" url="${asfrepo}"/>
- <pom refid="hadoop.mapred"/>
- </artifact:deploy>
- <artifact:deploy file="${hadoop-mapred-test.jar}">
- <remoteRepository id="apache.snapshots.https" url="${asfrepo}"/>
- <pom refid="hadoop.mapred.test"/>
- </artifact:deploy>
- <artifact:deploy file="${hadoop-mapred-examples.jar}">
- <remoteRepository id="apache.snapshots.https" url="${asfrepo}"/>
- <pom refid="hadoop.mapred.examples"/>
- </artifact:deploy>
- <artifact:deploy file="${hadoop-mapred-tools.jar}">
- <remoteRepository id="apache.snapshots.https" url="${asfrepo}"/>
- <pom refid="hadoop.mapred.tools"/>
- </artifact:deploy>
- </target>
-
- <target name="set-version">
- <delete file="${basedir}/ivy/hadoop-mapred.xml"/>
- <delete file="${basedir}/ivy/hadoop-mapred-test.xml"/>
- <delete file="${basedir}/ivy/hadoop-mapred-examples.xml"/>
- <delete file="${basedir}/ivy/hadoop-mapred-tools.xml"/>
- <copy file="${basedir}/ivy/hadoop-mapred-template.xml" tofile="${basedir}/ivy/hadoop-mapred.xml"/>
- <copy file="${basedir}/ivy/hadoop-mapred-test-template.xml" tofile="${basedir}/ivy/hadoop-mapred-test.xml"/>
- <copy file="${basedir}/ivy/hadoop-mapred-examples-template.xml" tofile="${basedir}/ivy/hadoop-mapred-examples.xml"/>
- <copy file="${basedir}/ivy/hadoop-mapred-tools-template.xml" tofile="${basedir}/ivy/hadoop-mapred-tools.xml"/>
- <replaceregexp byline="true">
- <regexp pattern="@version"/>
- <substitution expression="${version}"/>
- <fileset dir="${basedir}/ivy">
- <include name="hadoop-mapred.xml"/>
- </fileset>
- </replaceregexp>
- <replaceregexp byline="true">
- <regexp pattern="@version"/>
- <substitution expression="${version}"/>
- <fileset dir="${basedir}/ivy">
- <include name="hadoop-mapred-test.xml"/>
- </fileset>
- </replaceregexp>
- <replaceregexp byline="true">
- <regexp pattern="@version"/>
- <substitution expression="${version}"/>
- <fileset dir="${basedir}/ivy">
- <include name="hadoop-mapred-examples.xml"/>
- </fileset>
- </replaceregexp>
- <replaceregexp byline="true">
- <regexp pattern="@version"/>
- <substitution expression="${version}"/>
- <fileset dir="${basedir}/ivy">
- <include name="hadoop-mapred-tools.xml"/>
- </fileset>
- </replaceregexp>
- </target>
- <!-- ================================================================== -->
- <!-- Perform audit activities for the release -->
- <!-- ================================================================== -->
- <target name="rats-taskdef" depends="ivy-retrieve-releaseaudit">
- <typedef format="xml" resource="org/apache/rat/anttasks/antlib.xml" uri="antlib:org.apache.rat.anttasks"
- classpathref="releaseaudit-classpath"/>
- </target>
- <target name="releaseaudit" depends="package, rats-taskdef" description="Release Audit activities">
- <rat:report xmlns:rat="antlib:org.apache.rat.anttasks">
- <fileset dir="${dist.dir}">
- <exclude name="CHANGES.txt"/>
- <exclude name="docs/"/>
- <exclude name="lib/jdiff/"/>
- <exclude name="src/test/all-tests"/>
- <exclude name="src/test/commit-tests"/>
- </fileset>
- </rat:report>
- </target>
- <!-- ================================================================== -->
- <!-- Clean. Delete the build files, and their directories -->
- <!-- ================================================================== -->
- <target name="clean" depends="clean-contrib" description="Clean. Delete the build files, and their directories">
- <delete dir="${build.dir}"/>
- <delete dir="${docs.src}/build"/>
- <delete file="${hadoop-mapred.pom}"/>
- <delete file="${hadoop-mapred-test.pom}"/>
- <delete file="${hadoop-mapred-examples.pom}"/>
- <delete file="${hadoop-mapred-tools.pom}"/>
- </target>
- <target name="veryclean" depends="clean-cache,clean"
- description="veryclean. Delete ivy and ant maven task jar">
- <delete file="${ant_task.jar}"/>
- <delete file="${ivy.jar}"/>
- </target>
- <!-- ================================================================== -->
- <!-- Clean contrib target. For now, must be called explicitly -->
- <!-- Using subant instead of ant as a workaround for 30569 -->
- <!-- ================================================================== -->
- <target name="clean-contrib">
- <subant target="clean">
- <fileset file="src/contrib/build.xml"/>
- </subant>
- </target>
-
- <target name="test-c++-libhdfs" depends="compile-c++-libhdfs, compile-core" if="islibhdfs">
- <delete dir="${test.libhdfs.dir}"/>
- <mkdir dir="${test.libhdfs.dir}"/>
- <mkdir dir="${test.libhdfs.dir}/logs"/>
- <mkdir dir="${test.libhdfs.dir}/hdfs/name"/>
- <exec dir="${build.c++.libhdfs}" executable="${make.cmd}" failonerror="true">
- <env key="OS_NAME" value="${os.name}"/>
- <env key="OS_ARCH" value="${os.arch}"/>
- <env key="JVM_ARCH" value="${jvm.arch}"/>
- <env key="LIBHDFS_BUILD_DIR" value="${build.c++.libhdfs}"/>
- <env key="HADOOP_HOME" value="${basedir}"/>
- <env key="HADOOP_CONF_DIR" value="${test.libhdfs.conf.dir}"/>
- <env key="HADOOP_LOG_DIR" value="${test.libhdfs.dir}/logs"/>
- <env key="LIBHDFS_SRC_DIR" value="${c++.libhdfs.src}"/>
- <env key="LIBHDFS_INSTALL_DIR" value="${install.c++}/lib"/>
- <env key="LIB_DIR" value="${common.ivy.lib.dir}"/>
- <arg value="test"/>
- </exec>
- </target>
- <!-- ================================================================== -->
- <!-- librecordio targets. -->
- <!-- ================================================================== -->
- <target name="compile-librecordio" depends="init" if="librecordio" >
- <mkdir dir="${build.librecordio}"/>
- <exec dir="${librecordio.src}" executable="${make.cmd}" failonerror="true">
- <env key="XERCESCROOT" value="${xercescroot}"/>
- <env key="LIBRECORDIO_BUILD_DIR" value="${build.librecordio}"/>
- </exec>
- </target>
-
- <target name="test-librecordio" depends="compile-librecordio, compile-core" if="librecordio">
- <delete dir="${librecordio.test.dir}"/>
- <mkdir dir="${librecordio.test.dir}"/>
- <exec dir="${librecordio.src}/test" executable="${make.cmd}" failonerror="true">
- <env key="HADOOP_HOME" value="${basedir}"/>
- <env key="XERCESCROOT" value="${xercescroot}"/>
- <env key="LIBRECORDIO_BUILD_DIR" value="${build.librecordio}"/>
- <env key="LIBRECORDIO_TEST_DIR" value="${librecordio.test.dir}"/>
- <arg value="all"/>
- </exec>
- </target>
- <target name="package-librecordio" depends="compile-librecordio" if="librecordio">
- <mkdir dir="${dist.dir}/librecordio"/>
- <copy todir="${dist.dir}/librecordio">
- <fileset dir="${build.librecordio}" casesensitive="yes" followsymlinks="false">
- <exclude name="**/tests/**"/>
- <exclude name="*.so"/>
- <exclude name="*.o"/>
- </fileset>
- </copy>
- <chmod perm="ugo+x" type="file">
- <fileset dir="${dist.dir}/librecordio"/>
- </chmod>
- </target>
-
- <target name="create-c++-configure" depends="init" if="compile.c++">
- <exec executable="autoreconf" dir="${c++.utils.src}" searchpath="yes"
- failonerror="yes">
- <arg value="-if"/>
- </exec>
- <exec executable="autoreconf" dir="${c++.pipes.src}" searchpath="yes"
- failonerror="yes">
- <arg value="-if"/>
- </exec>
- <exec executable="autoreconf" dir="${c++.examples.pipes.src}"
- searchpath="yes" failonerror="yes">
- <arg value="-if"/>
- </exec>
- <antcall target="create-c++-configure-libhdfs"/>
- </target>
-
- <target name="create-c++-configure-libhdfs" depends="check-c++-libhdfs" if="islibhdfs">
- <exec executable="autoreconf" dir="${c++.libhdfs.src}"
- searchpath="yes" failonerror="yes">
- <arg value="-if"/>
- </exec>
- </target>
- <target name="check-c++-makefiles" depends="init" if="compile.c++">
- <condition property="need.c++.utils.makefile">
- <not> <available file="${build.c++.utils}/Makefile"/> </not>
- </condition>
- <condition property="need.c++.pipes.makefile">
- <not> <available file="${build.c++.pipes}/Makefile"/> </not>
- </condition>
- <condition property="need.c++.examples.pipes.makefile">
- <not> <available file="${build.c++.examples.pipes}/Makefile"/> </not>
- </condition>
- </target>
- <target name="check-c++-libhdfs">
- <condition property="islibhdfs">
- <and>
- <isset property="compile.c++"/>
- <isset property="libhdfs"/>
- </and>
- </condition>
- </target>
- <target name="check-c++-makefile-libhdfs" depends="init,check-c++-libhdfs" if="islibhdfs">
- <condition property="need.c++.libhdfs.makefile">
- <not> <available file="${build.c++.libhdfs}/Makefile"/> </not>
- </condition>
- </target>
- <target name="create-c++-libhdfs-makefile" depends="check-c++-makefile-libhdfs"
- if="need.c++.libhdfs.makefile">
- <mkdir dir="${build.c++.libhdfs}"/>
- <chmod file="${c++.libhdfs.src}/configure" perm="ugo+x"/>
- <exec executable="${c++.libhdfs.src}/configure" dir="${build.c++.libhdfs}"
- failonerror="yes">
- <env key="ac_cv_func_malloc_0_nonnull" value="yes"/>
- <env key="JVM_ARCH" value="${jvm.arch}"/>
- <arg value="--prefix=${install.c++}"/>
- </exec>
- </target>
- <target name="create-c++-utils-makefile" depends="check-c++-makefiles"
- if="need.c++.utils.makefile">
- <mkdir dir="${build.c++.utils}"/>
- <chmod file="${c++.utils.src}/configure" perm="ugo+x"/>
- <exec executable="${c++.utils.src}/configure" dir="${build.c++.utils}"
- failonerror="yes">
- <arg value="--prefix=${install.c++}"/>
- </exec>
- </target>
- <target name="compile-c++-utils" depends="create-c++-utils-makefile"
- if="compile.c++">
- <exec executable="${make.cmd}" dir="${build.c++.utils}" searchpath="yes"
- failonerror="yes">
- <arg value="install"/>
- </exec>
- </target>
- <target name="create-c++-pipes-makefile" depends="check-c++-makefiles"
- if="need.c++.pipes.makefile">
- <mkdir dir="${build.c++.pipes}"/>
- <chmod file="${c++.pipes.src}/configure" perm="ugo+x"/>
- <exec executable="${c++.pipes.src}/configure" dir="${build.c++.pipes}"
- failonerror="yes">
- <arg value="--prefix=${install.c++}"/>
- </exec>
- </target>
- <target name="compile-c++-pipes"
- depends="create-c++-pipes-makefile,compile-c++-utils"
- if="compile.c++">
- <exec executable="${make.cmd}" dir="${build.c++.pipes}" searchpath="yes"
- failonerror="yes">
- <arg value="install"/>
- </exec>
- </target>
- <target name="compile-c++"
- depends="compile-c++-pipes"/>
- <target name="create-c++-examples-pipes-makefile"
- depends="check-c++-makefiles"
- if="need.c++.examples.pipes.makefile">
- <mkdir dir="${build.c++.examples.pipes}"/>
- <chmod file="${c++.examples.pipes.src}/configure" perm="ugo+x"/>
- <exec executable="${c++.examples.pipes.src}/configure"
- dir="${build.c++.examples.pipes}"
- failonerror="yes">
- <arg value="--prefix=${install.c++.examples}"/>
- <arg value="--with-hadoop-utils=${install.c++}"/>
- <arg value="--with-hadoop-pipes=${install.c++}"/>
- </exec>
- </target>
- <target name="compile-c++-examples-pipes"
- depends="create-c++-examples-pipes-makefile,compile-c++-pipes"
- if="compile.c++">
- <exec executable="${make.cmd}" dir="${build.c++.examples.pipes}" searchpath="yes"
- failonerror="yes">
- <arg value="install"/>
- </exec>
- </target>
- <target name="compile-c++-examples"
- depends="compile-c++-examples-pipes"/>
- <target name="compile-c++-libhdfs" depends="create-c++-libhdfs-makefile" if="islibhdfs">
- <exec executable="${make.cmd}" dir="${build.c++.libhdfs}" searchpath="yes"
- failonerror="yes">
- <env key="ac_cv_func_malloc_0_nonnull" value="yes"/>
- <env key="JVM_ARCH" value="${jvm.arch}"/>
- <arg value="install"/>
- </exec>
- </target>
- <target name="clover" depends="clover.setup, clover.info" description="Instrument the Unit tests using Clover. To use, specify -Dclover.home=<base of clover installation> -Drun.clover=true on the command line."/>
- <target name="clover.setup" if="clover.enabled">
- <taskdef resource="cloverlib.xml" classpath="${clover.jar}"/>
- <mkdir dir="${clover.db.dir}"/>
- <clover-setup initString="${clover.db.dir}/hadoop_coverage.db">
- <fileset dir="src" includes="tools/**/* java/**/*"/>
- </clover-setup>
- </target>
- <target name="clover.info" unless="clover.present">
- <echo>
- Clover not found. Code coverage reports disabled.
- </echo>
- </target>
- <target name="clover.check">
- <fail unless="clover.present">
- ##################################################################
- Clover not found.
- Please specify -Dclover.home=<base of clover installation>
- on the command line.
- ##################################################################
- </fail>
- </target>
- <target name="generate-clover-reports" depends="clover.check, clover">
- <mkdir dir="${clover.report.dir}"/>
- <clover-report>
- <current outfile="${clover.report.dir}" title="${final.name}">
- <format type="html"/>
- </current>
- </clover-report>
- <clover-report>
- <current outfile="${clover.report.dir}/clover.xml" title="${final.name}">
- <format type="xml"/>
- </current>
- </clover-report>
- </target>
- <target name="findbugs.check" depends="check-for-findbugs" unless="findbugs.present">
- <fail message="'findbugs.home' is not defined. Please pass -Dfindbugs.home=<base of Findbugs installation> to Ant on the command-line." />
- </target>
- <target name="patch.check" unless="patch.file">
- <fail message="'patch.file' is not defined. Please pass -Dpatch.file=<location of patch file> to Ant on the command-line." />
- </target>
- <target name="test-patch" depends="patch.check,findbugs.check,forrest.check">
- <exec executable="bash" failonerror="true">
- <arg value="${basedir}/src/test/bin/test-patch.sh"/>
- <arg value="DEVELOPER"/>
- <arg value="${patch.file}"/>
- <arg value="${scratch.dir}"/>
- <arg value="${svn.cmd}"/>
- <arg value="${grep.cmd}"/>
- <arg value="${patch.cmd}"/>
- <arg value="${findbugs.home}"/>
- <arg value="${forrest.home}"/>
- <arg value="${basedir}"/>
- <arg value="${java5.home}"/>
- </exec>
- </target>
- <target name="hudson-test-patch" depends="findbugs.check,forrest.check">
- <exec executable="bash" failonerror="true">
- <arg value="${basedir}/src/test/bin/test-patch.sh"/>
- <arg value="HUDSON"/>
- <arg value="${scratch.dir}"/>
- <arg value="${support.dir}"/>
- <arg value="${ps.cmd}"/>
- <arg value="${wget.cmd}"/>
- <arg value="${jiracli.cmd}"/>
- <arg value="${svn.cmd}"/>
- <arg value="${grep.cmd}"/>
- <arg value="${patch.cmd}"/>
- <arg value="${findbugs.home}"/>
- <arg value="${forrest.home}"/>
- <arg value="${eclipse.home}"/>
- <arg value="${python.home}"/>
- <arg value="${basedir}"/>
- <arg value="${trigger.url}"/>
- <arg value="${jira.passwd}"/>
- <arg value="${java5.home}"/>
- <arg value="${curl.cmd}"/>
- <arg value="${defect}"/>
- </exec>
- </target>
-
- <target name="eclipse-files" depends="init"
- description="Generate files for Eclipse">
- <pathconvert property="eclipse.project">
- <path path="${basedir}"/>
- <regexpmapper from="^.*/([^/]+)$$" to="\1" handledirsep="yes"/>
- </pathconvert>
- <copy todir="." overwrite="true">
- <fileset dir=".eclipse.templates">
- <exclude name="**/README.txt"/>
- </fileset>
- <filterset>
- <filter token="PROJECT" value="${eclipse.project}"/>
- </filterset>
- </copy>
- </target>
- <target name="ivy-init-dirs">
- <mkdir dir="${build.ivy.dir}" />
- <mkdir dir="${build.ivy.lib.dir}" />
- <mkdir dir="${build.ivy.report.dir}" />
- <mkdir dir="${build.ivy.maven.dir}" />
- </target>
- <target name="ivy-probe-antlib" >
- <condition property="ivy.found">
- <typefound uri="antlib:org.apache.ivy.ant" name="cleancache"/>
- </condition>
- </target>
- <target name="ivy-download" description="To download ivy" unless="offline">
- <get src="${ivy_repo_url}" dest="${ivy.jar}" usetimestamp="true"/>
- </target>
- <!--
- To avoid Ivy leaking things across big projects, always load Ivy in the same classloader.
- Also note how we skip loading Ivy if it is already there, just to make sure all is well.
- -->
- <target name="ivy-init-antlib" depends="ivy-download,ivy-init-dirs,ivy-probe-antlib" unless="ivy.found">
- <typedef uri="antlib:org.apache.ivy.ant" onerror="fail"
- loaderRef="ivyLoader">
- <classpath>
- <pathelement location="${ivy.jar}"/>
- </classpath>
- </typedef>
- <fail >
- <condition >
- <not>
- <typefound uri="antlib:org.apache.ivy.ant" name="cleancache"/>
- </not>
- </condition>
- You need Apache Ivy 2.0 or later from http://ant.apache.org/
- It could not be loaded from ${ivy_repo_url}
- </fail>
- </target>
- <target name="ivy-init" depends="ivy-init-antlib" >
- <!--Configure Ivy by reading in the settings file
- If anyone has already read in a settings file into this settings ID, it gets priority
- -->
- <ivy:configure settingsid="${ant.project.name}.ivy.settings" file="${ivysettings.xml}" override='false'/>
- </target>
- <target name="ivy-resolve" depends="ivy-init">
- <ivy:resolve settingsRef="${ant.project.name}.ivy.settings"/>
- </target>
- <target name="ivy-resolve-javadoc" depends="ivy-init">
- <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="javadoc"/>
- </target>
- <target name="ivy-resolve-releaseaudit" depends="ivy-init">
- <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="releaseaudit"/>
- </target>
- <target name="ivy-resolve-test" depends="ivy-init">
- <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="test" />
- </target>
- <target name="ivy-resolve-common" depends="ivy-init">
- <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="common" />
- </target>
- <target name="ivy-resolve-jdiff" depends="ivy-init">
- <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="jdiff" />
- </target>
- <target name="ivy-resolve-checkstyle" depends="ivy-init">
- <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="checkstyle"/>
- </target>
- <target name="ivy-retrieve" depends="ivy-resolve"
- description="Retrieve Ivy-managed artifacts">
- <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
- pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"/>
- </target>
- <target name="ivy-retrieve-checkstyle" depends="ivy-resolve-checkstyle"
- description="Retrieve Ivy-managed artifacts for the checkstyle configurations">
- <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
- pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"/>
- <ivy:cachepath pathid="checkstyle-classpath" conf="checkstyle"/>
- </target>
- <target name="ivy-retrieve-jdiff" depends="ivy-resolve-jdiff"
- description="Retrieve Ivy-managed artifacts for the javadoc configurations">
- <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
- pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"/>
- <ivy:cachepath pathid="jdiff-classpath" conf="jdiff"/>
- </target>
- <target name="ivy-retrieve-javadoc" depends="ivy-resolve-javadoc"
- description="Retrieve Ivy-managed artifacts for the javadoc configurations">
- <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
- pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"/>
- <ivy:cachepath pathid="javadoc-classpath" conf="javadoc"/>
- </target>
- <target name="ivy-retrieve-test" depends="ivy-resolve-test"
- description="Retrieve Ivy-managed artifacts for the test configurations">
- <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
- pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"/>
- <ivy:cachepath pathid="ivy-test.classpath" conf="test"/>
- </target>
- <target name="ivy-retrieve-common" depends="ivy-resolve-common"
- description="Retrieve Ivy-managed artifacts for the compile configurations">
- <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
- pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"/>
- <ivy:cachepath pathid="ivy-common.classpath" conf="common"/>
- </target>
- <target name="ivy-retrieve-releaseaudit" depends="ivy-resolve-releaseaudit"
- description="Retrieve Ivy-managed artifacts for the compile configurations">
- <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
- pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" />
- <ivy:cachepath pathid="releaseaudit-classpath" conf="releaseaudit"/>
- </target>
- <target name="ivy-report" depends="ivy-resolve-releaseaudit"
- description="Generate">
- <ivy:report todir="${build.ivy.report.dir}" settingsRef="${ant.project.name}.ivy.settings"/>
- <echo>
- Reports generated:${build.ivy.report.dir}
- </echo>
- </target>
- <!-- taskcontroller targets -->
- <target name="init-task-controller-build">
- <mkdir dir="${build.c++.task-controller}" />
- <copy todir="${build.c++.task-controller}">
- <fileset dir="${c++.task-controller.src}" includes="*.c"/>
- <fileset dir="${c++.task-controller.src}" includes="*.h"/>
- </copy>
- <chmod file="${c++.task-controller.src}/configure" perm="ugo+x"/>
- <condition property="task-controller.conf.dir.passed">
- <not>
- <equals arg1="${hadoop.conf.dir}" arg2="$${hadoop.conf.dir}"/>
- </not>
- </condition>
- </target>
- <target name="configure-task-controller" depends="init,
- init-task-controller-build,
- task-controller-configuration-with-confdir,
- task-controller-configuration-with-no-confdir">
- </target>
- <target name="task-controller-configuration-with-confdir"
- if="task-controller.conf.dir.passed" >
- <exec executable="${c++.task-controller.src}/configure"
- dir="${build.c++.task-controller}" failonerror="yes">
- <arg value="--prefix=${task-controller.install.dir}" />
- <arg value="--with-confdir=${hadoop.conf.dir}" />
- </exec>
- </target>
- <target name="task-controller-configuration-with-no-confdir"
- unless="task-controller.conf.dir.passed">
- <exec executable="${c++.task-controller.src}/configure"
- dir="${build.c++.task-controller}" failonerror="yes">
- <arg value="--prefix=${task-controller.install.dir}" />
- </exec>
- </target>
- <!--
- * Create the installation directory.
- * Do a make install.
- -->
- <target name="task-controller" depends="configure-task-controller">
- <mkdir dir="${task-controller.install.dir}" />
- <exec executable="${make.cmd}" dir="${build.c++.task-controller}"
- searchpath="yes" failonerror="yes">
- <arg value="install" />
- </exec>
- </target>
- <target name="test-task-controller" depends="task-controller">
- <copy todir="${build.c++.task-controller}" verbose="true">
- <fileset dir="${c++.task-controller.src}" includes="tests/"/>
- </copy>
- <exec executable="${make.cmd}" dir="${build.c++.task-controller}"
- searchpath="yes" failonerror="yes">
- <arg value="clean" />
- <arg value="test" />
- </exec>
- <exec executable="${build.c++.task-controller}/tests/test-task-controller"
- dir="${build.c++.task-controller}/tests/"
- failonerror="yes">
- </exec>
- </target>
- <!-- end of task-controller targets -->
- </project>
|