]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
build doc files only if source files are newer than rendered files
authorChristian Weiske <cweiske@cweiske.de>
Thu, 26 May 2011 19:05:59 +0000 (21:05 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Thu, 26 May 2011 19:05:59 +0000 (21:05 +0200)
build.xml

index 0289c380f75fd6978bd6524f792252fdfac79580..f6731fe3a174fd371c4e95a95c1e0b2438891af5 100644 (file)
--- a/build.xml
+++ b/build.xml
    </foreach>
   </target>
 
-  <target name="build-doc-file" depends="check">
+
+  <target name="build-doc-file" depends="check"
+   description="Builds a single documentation file. Pass file path as $fname"
+  >
    <echo msg="${fname}"/>
    <php function="preg_replace" returnProperty="outfile">
     <param value="/^(.+)(.rst|.txt)$/"/>
-    <param value="\1.html"/>
+    <param value="dist/\1.html"/>
     <param value="${fname}"/>
    </php>
-   <!--<echo msg="${fname} - ${outfile}"/>-->
-   <exec
-    command="rst2html --exit-status=2 ${fname} > dist/${outfile}"
-    checkreturn="1"
-    />
+
+   <!-- only render file if the doc file is newer than the html file -->
+   <property name="isuptodate" value="false"/>
+   <uptodate property="isuptodate" srcfile="${fname}" targetfile="${outfile}" />
+   <if>
+    <not><istrue value="${isuptodate}"/></not>
+    <then>
+     <exec
+      command="rst2html --exit-status=2 ${fname} ${outfile}"
+      checkreturn="1"
+      />
+    </then>
+   </if>
+
   </target>