From 61636a356881670554cc3d1b9b9748a68347cad5 Mon Sep 17 00:00:00 2001
From: Douglass Cutting <cutting@apache.org>
Date: Mon, 23 Feb 2009 22:30:34 +0000
Subject: [PATCH] HADOOP-5240. Skip re-building javadoc when it is already up-to-date. Contributed by Aaron Kimball.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@747169 13f79535-47bb-0310-9956-ffa450edef68
---
 build.xml |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/build.xml b/build.xml
index fe128aa..735ad34 100644
--- a/build.xml
+++ b/build.xml
@@ -80,6 +80,7 @@
   <property name="build.docs" value="${build.dir}/docs"/>
   <property name="build.docs.cn" value="${build.dir}/docs/cn"/>
   <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}"/>
@@ -942,7 +943,18 @@
     </javadoc>
   </target>	
 
-  <target name="javadoc" depends="compile, ivy-retrieve-javadoc" description="Generate javadoc">
+  <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="${core.src.dir}/overview.html"
-- 
1.6.0.4

