From 8e2f1a2543b70d72696a3ac5b21a3a9a28f77ec7 Mon Sep 17 00:00:00 2001
From: Jonathan Hsieh <jon@cloudera.com>
Date: Fri, 4 Feb 2011 22:28:56 -0800
Subject: [PATCH] FLUME-510: Add windows guide compile to to docs build

---
 build.xml                |   29 ++++++++++++++++++++++++++++-
 src/docs/Windows/Windows |    5 +++++
 src/docs/web/index.txt   |    2 +-
 3 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/build.xml b/build.xml
index ac49caa..cfbecb7 100644
--- a/build.xml
+++ b/build.xml
@@ -179,6 +179,7 @@ to call at top-level: ant deploy-contrib compile-core-test
     <mkdir dir="${build.docs}/DeveloperGuide"/>
     <mkdir dir="${build.docs}/UserGuide"/>
     <mkdir dir="${build.docs}/Cookbook"/>
+    <mkdir dir="${build.docs}/Windows"/>
     <mkdir dir="${ivy.tools.lib}"/>
 
     <condition property="ivy.jar.exists">
@@ -732,7 +733,7 @@ to call at top-level: ant deploy-contrib compile-core-test
   <!--  converts to docbook and then to html to avoid GPL code insertion  -->
   <!--  in ubuntu requires pkgs: asciidoc,source-highlight,graphviz       -->
   <!-- ================================================================== -->
-  <target name="docs" depends="userguide,cookbook,developerguide,docindex" description="Build documentation"/>
+  <target name="docs" depends="userguide,cookbook,developerguide,windowsguide,docindex" description="Build documentation"/>
 
   <uptodate property="userguide.uptodate"
 	    targetfile="${build.docs}/UserGuide/index.html">
@@ -749,6 +750,11 @@ to call at top-level: ant deploy-contrib compile-core-test
     <srcfiles dir="${docs.src.dir}/DeveloperGuide" includes="*"/>
     <srcfiles dir="${docs.src.dir}/web" includes="*"/>
   </uptodate>
+  <uptodate property="windowsguide.uptodate"
+	    targetfile="${build.docs}/Windows/index.html" >
+    <srcfiles dir="${docs.src.dir}/Windows" includes="*"/>
+    <srcfiles dir="${docs.src.dir}/web" includes="*"/>
+  </uptodate>
   <uptodate property="docindex.uptodate"
 	    targetfile="${build.docs}/index.html" >
     <srcfiles dir="${docs.src.dir}/web" includes="*"/>
@@ -816,6 +822,27 @@ to call at top-level: ant deploy-contrib compile-core-test
   </target>
 
 
+  <target name="windowsguide" depends="init" description="Build Windows Guide" unless="windowsguide.uptodate">
+    <exec executable="asciidoc" dir="${basedir}" failonerror="true">
+      <arg line="-a revnumber=${version} -a revdate='${TODAY}' -b docbook -o ${build.docs}/Windows/index.xml ${docs.src.dir}/Windows/Windows"/>
+    </exec>
+
+    <exec executable="xmlto" dir="${basedir}" failonerror="true">
+      <arg line="--skip-validation -o ${build.docs}/Windows -m src/docs/web/html.xsl html-nochunks ${build.docs}/Windows/index.xml "/>
+    </exec>
+
+    <delete file="${build.docs}/Windows/index.xml" />
+
+    <copy todir="${docs.dir}/Windows">
+      <fileset dir="${docs.src.dir}/web" includes="**"/>
+    </copy>
+
+    <copy todir="${docs.dir}/Windows">
+      <fileset dir="${docs.src.dir}/Windows" includes="**/*.png"/>
+    </copy>
+  </target>
+
+
   <target name="docindex" depends="init" description="Build Index Page for docs" unless="docindex.uptodate">
     <exec executable="asciidoc" dir="${basedir}" failonerror="true">
       <arg line="-a revnumber=${version} -a revdate='${TODAY}' -b docbook -o ${build.docs}/index.xml ${docs.src.dir}/web/index.txt"/>
diff --git a/src/docs/Windows/Windows b/src/docs/Windows/Windows
index 0393a2d..e810e94 100644
--- a/src/docs/Windows/Windows
+++ b/src/docs/Windows/Windows
@@ -1,3 +1,8 @@
+Flume Windows Guide
+===================
+flume-dev@cloudera.org
+
+// version number comes from command line
 
 ////////////////////
 Licensed to Cloudera, Inc. under one
diff --git a/src/docs/web/index.txt b/src/docs/web/index.txt
index 04ff317..104a9ba 100644
--- a/src/docs/web/index.txt
+++ b/src/docs/web/index.txt
@@ -24,4 +24,4 @@ The following pages are the documentation for Flume v{revnumber}:
 - link:UserGuide/index.html[Flume User Guide]
 - link:DeveloperGuide/index.html[Flume Developer Guide]
 - link:Cookbook/index.html[Flume Cookbook]
-
+- link:Windows/index.html[Flume Windows Guide]
-- 
1.7.1

