ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter reilly <peter.rei...@corvil.com>
Subject Re: generate files *only* if a one of set of sources was modified
Date Tue, 11 Nov 2003 16:48:33 GMT
On Tuesday 11 November 2003 16:34, Stefan Bodewig wrote:
> On 11 Nov 2003, Pedro Salazar <pedro-b-salazar@ptinovacao.pt> wrote:
> > On Tue, 2003-11-11 at 15:49, Stefan Bodewig wrote:
> >> Is it possible to identify a single generated source by name?  All
> >> generated sources should have the same timestamps IIUC so picking
> >> one should be enough.  If so, use a merge mapper and point to an
> >> arbitrary generated source with the to attribute.
> >
> > Shouldn't be on the other side?
>
> No, I'd simply also negate the meaning of the property - run the task
> only if the property has not been set.  So if any source (with tags)
> is more recent than the example generated source, the property will
> not be set and the task will get executed.
>
> > Could you change the target below to explain me better what you
> > said?
>
> Your ejb-xdoclet-gen <target> probably looks like
>
> <target name="ejb-xdoclet-gen" if="ejb-changed">
>
> and I'd change it to
>
> <target name="X">
>     <uptodate property="ejb-not-changed"
>        <mapper type="merge"
>                to="a single sample generated source"/>
>        <srcfiles dir= "${src.etc.dir}"
>                 includes="**/ejb/access/**"/>
>     </uptodate>
>
>     <antcall target="ejb-xdoclet-gen" >
>         <param name="p_include_bean"
>            value="**/ejb/access/*Bean.java"/>
> </target>
>
> <target name="ejb-xdoclet-gen" unless="ejb-not-changed">
>
> and in the next step I'd try to eliminate <antcall> completely, but
> that's a different issue.

One could use <outofdate> from ant-contrib:
http://ant-contrib.sourceforge.net/

<outofdate>
  <sourcefiles>
     <fileset dir= "${src.etc.dir}"
              includes="**/ejb/access/**"/>
  </sourcefiles>
  <targetfiles path="path to a sample sample generated file"/>
  <sequential>
      <echo>Call xdoclet here</echo>
      <xdoclet .../>
  </sequential>
</outofdate>

Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message