ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pedro Salazar <pedro-b-sala...@ptinovacao.pt>
Subject Re: generate files *only* if a one of set of sources was modified
Date Tue, 11 Nov 2003 16:18:41 GMT
On Tue, 2003-11-11 at 15:49, Stefan Bodewig wrote:
> On 11 Nov 2003, Pedro Salazar <pedro-b-salazar@ptinovacao.pt> wrote:
> 
> > There is no relation with the _sources_ (generated files) and the
> > _target_ (java sources with xdoclet tags), besides the timestamp. I
> > just want say this: -generate new files (e.g. run task) if any of my
> > java sources files are more *uptodate* than the generated ones.
> 
> 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?

-Set of java sources files (with xdoclet tags):

${src.etc.dir}/**/access/**  ---> TARGET FILES

-Generated sources files (all with the same timestamp)

${build.gen.dir}/**/access/**  ----> SOURCE FILES

If *any* of the TARGET FILES is more *uptodate* than the SOURCE FILES,
run the TASK to generate new ones (SOURCE FILES).

So the "TO" attribute in <mapper> must point to the TARGET FILES which
have different timestamps and must be defined with wildcards!! On the
other side, the SOURCE FILES (generated) should have a shared timestamp.
However, with the <srcfiles> is easy to define a wildcard.

Could you change the target below to explain me better what you said?

<target name="X">
    <uptodate property="ejb-changed" 
       <mapper type="merge"
to="${src.server.dir}/**/ejb/access/*.java"/>
       <srcfiles dir= "${build.gen.dir}" 
                includes="**/ejb/access/**"/>
    </uptodate>

    <antcall target="ejb-xdoclet-gen" >
        <param name="p_include_bean"
           value="**/ejb/access/*Bean.java"/>

</target>

regards,
Pedro Salazar.
-- 
PS
pedro-b-salazar@ptinovacao.pt
PGP:0E129E31D803BC61


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


Mime
View raw message