build doc files only if source files are newer than rendered files
This commit is contained in:
parent
b56d604e7e
commit
a396759f22
1 changed files with 19 additions and 7 deletions
26
build.xml
26
build.xml
|
@ -219,18 +219,30 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
</target>
|
</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}"/>
|
<echo msg="${fname}"/>
|
||||||
<php function="preg_replace" returnProperty="outfile">
|
<php function="preg_replace" returnProperty="outfile">
|
||||||
<param value="/^(.+)(.rst|.txt)$/"/>
|
<param value="/^(.+)(.rst|.txt)$/"/>
|
||||||
<param value="\1.html"/>
|
<param value="dist/\1.html"/>
|
||||||
<param value="${fname}"/>
|
<param value="${fname}"/>
|
||||||
</php>
|
</php>
|
||||||
<!--<echo msg="${fname} - ${outfile}"/>-->
|
|
||||||
<exec
|
<!-- only render file if the doc file is newer than the html file -->
|
||||||
command="rst2html --exit-status=2 ${fname} > dist/${outfile}"
|
<property name="isuptodate" value="false"/>
|
||||||
checkreturn="1"
|
<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>
|
</target>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue