Try the <modified> selector instead of a mapper.

Jan 

>-----Ursprüngliche Nachricht-----
>Von: Bailey, David [mailto:[EMAIL PROTECTED] 
>Gesendet: Dienstag, 5. Dezember 2006 01:05
>An: Ant Users List
>Betreff: uptodate
>
>This seems like a problem which must have a very simple 
>solution, but I can't find it.
>
> 
>
>A single XML file is used to generate a large number of HTML 
>files.  And I actually have nearly 100 such XML files.  These 
>XML files rarely change, so I'd like to save time by using 
><uptodate> to only regenerate the HTML when necessary.  
>However, I can't figure out the correct way to define a mapper.
>
> 
>
>I'm trying to use the following construct:
>
> 
>
><target name="gen_html" depends="check_html" unless="html_uptodate">
>
>            . . .
>
></target>
>
> 
>
><target name="check_html">
>
>            <uptodate property="html_uptodate"
>
>                        srcfile="${xmldir}/SubDir/${xml_filename}.xml">
>
>                        <mapper . . . />
>
>            </uptodate>
>
></target>
>
> 
>
>Looking at my choices of available mappers, none seem to do 
>what I want.
>I have attempted variants of the globmapper such as
>
> 
>
><globmapper from="." to="${htmldir}/*.html" />
>
> 
>
> . . . but it seems that globmappers don't work unless you 
>include a * in the 'from' attribute.  I thought I would get it 
>with the following regexp mapper:
>
> 
>
><regexpmapper from="\.*" to="${htmldir}/*.html" />
>
> 
>
> . . . but frustratingly, the regexpmapper interprets '*.html'
>literally, rather than interpolating the * as a wild card.  In 
>fact, my experimentation indicates that the only regexp 
>interpolation which occurs in the 'to' attribute is \1, \2, 
>etc.  Similarly, if I abandon the <mapper> altogether and 
>instead use the targetfile attribute, such as 
>'targetfile="${htmldir}/*.html"', the * is interpreted literally.
>
> 
>
>Obviously I can write my own mapper, but I can't believe there 
>isn't a solution out there with the tasks already available.  
>Am I overlooking something?
>
> 
>
>Thanks,
>
>--dave
>
>
>***************************************************************
>*************
>This email may contain confidential material. 
>If you were not an intended recipient,
>Please notify the sender and delete all copies. 
>We may monitor email to and from our network. 
>***************************************************************
>*************
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to