Thanks for the <uptodate> pointer.

uptodate seems indirect.  You can put it inside the target you're considering 
building, but then how do you have it stop building the current target?

So I think I have to create a new target that uses an uptodate task to set a new 
variable, and reference both this target and variable in my original target.  See 
below.

Moreover, this doesn't quite work.  The style task still does its own dependency 
determination on the in and style files, and if the out file is more recent it does 
not do anything.  Is there a way to force a task to run?  I guess I could delete the 
out file, or touch the in file, in order to convince the style task it needs to get to 
work.  ("Respect my authorah-tay!" - Eric Cartman :o)

Here's my build.xml, simplified.  Thanks in advance for any suggestions, or sample 
build.xml's doing similar things.


<!-- Decide if we need to build the product target -->
<target name="productUptodateNess">
    <uptodate property="productNoRebuild" targetfile="${project.base}/home.html" >
        <srcfiles dir="." includes="product_home_parts_list.xml,*.xsl,${data_file}"/>
    </uptodate>
</target>

<target name="product" depends="productUptodateNess" unless="${productNoRebuild}">
    <!-- The style task below may still decide it doesn't need to run. -->
    <style
        destdir="UNUSED_BUG_1996_FILED"
        style="master.xsl"
        in="product_home_parts_list.xml"
        out="${project.base}/home.html"
        >
        <param name="product_info" expression="${data_file}" />
    </style>
</target>

-- 
=S Page
  my rough ant notes to myself at http://www.slip.net/~spage/ant/

Reply via email to