Skip to content

Commit c2cca16

Browse files
committed
HADOOP-6206 trying to unwind the cycle
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hdfs/branches/HDFS-326@808832 13f79535-47bb-0310-9956-ffa450edef68
1 parent c47b8b4 commit c2cca16

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

build.xml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,10 @@
255255
<exclude name="**/*.jsp" />
256256
</fileset>
257257
</copy>
258-
<unzip src="${lib.dir}/hadoop-mapred-${hadoop-mr.version}.jar"
259-
dest="${build.dir}">
260-
<patternset>
261-
<include name="webapps/**"/>
262-
</patternset>
263-
</unzip>
258+
<property name="hadoop-mapred.jar"
259+
location="${lib.dir}/hadoop-mapred-${hadoop-mr.version}.jar" />
260+
<available property="hadoop-mapred.jar.exists"
261+
file="${hadoop-mapred.jar}" />
264262

265263
<copy todir="${conf.dir}" verbose="true">
266264
<fileset dir="${conf.dir}" includes="**/*.template"/>
@@ -274,7 +272,19 @@
274272

275273
</target>
276274

277-
<target name="compile-hdfs-classes" depends="init">
275+
<!-- unzip the web applications of mapred, if found-->
276+
<target name="unzip-mapred-webapps" depends="init" if="hadoop-mapred.jar.exists">
277+
<unzip src="${hadoop-mapred.jar}"
278+
dest="${build.dir}">
279+
<patternset>
280+
<include name="webapps/**"/>
281+
</patternset>
282+
</unzip>
283+
</target>
284+
285+
<target name="ready-to-compile" depends="unzip-mapred-webapps, clover" />
286+
287+
<target name="compile-hdfs-classes" depends="ready-to-compile">
278288
<taskdef classname="org.apache.jasper.JspC" name="jsp-compile" >
279289
<classpath refid="classpath"/>
280290
</taskdef>
@@ -494,7 +504,8 @@
494504
<copy file="${test.src.dir}/hdfs/org/apache/hadoop/hdfs/tools/offlineImageViewer/fsimageV19" todir="${test.cache.data}"/>
495505
</target>
496506

497-
<target name="compile-hdfs-with-mr-test" depends="compile-hdfs-test">
507+
<target name="compile-hdfs-with-mr-test" depends="compile-hdfs-test"
508+
if="hadoop-mapred.jar.exists">
498509
<mkdir dir="${test.hdfs.with.mr.build.classes}"/>
499510
<javac
500511
encoding="${build.encoding}"
@@ -651,7 +662,9 @@
651662
<macro-test-runner test.file="${test.hdfs.commit.tests.file}" />
652663
</target>
653664

654-
<target name="run-test-hdfs-with-mr" depends="compile-hdfs-with-mr-test" description="Run hdfs unit tests that require mapred">
665+
<target name="run-test-hdfs-with-mr" depends="compile-hdfs-with-mr-test"
666+
description="Run hdfs unit tests that require mapred"
667+
if="hadoop-mapred.jar.exists">
655668

656669
<delete dir="${test.build.data}"/>
657670
<mkdir dir="${test.build.data}"/>

0 commit comments

Comments
 (0)