aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-05-26 21:05:59 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-05-26 21:05:59 +0200
commita396759f22ff06689e25d92d4faaaf0835bf8bc8 (patch)
tree52d99469c5eb59bd4e538aca05737394299bf34b
parentb56d604e7eedc1c748e90da4f3a1948b052e20cb (diff)
downloadsemanticscuttle-a396759f22ff06689e25d92d4faaaf0835bf8bc8.tar.gz
semanticscuttle-a396759f22ff06689e25d92d4faaaf0835bf8bc8.tar.bz2
build doc files only if source files are newer than rendered files
-rw-r--r--build.xml26
1 files changed, 19 insertions, 7 deletions
diff --git a/build.xml b/build.xml
index 0289c38..f6731fe 100644
--- a/build.xml
+++ b/build.xml
@@ -219,18 +219,30 @@
</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>