ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: re[2]: Generating XDoclet stuff only if changed
Date Tue, 30 Mar 2004 14:42:14 GMT
This is for a custom XDoclet template generation thing I've used:

<uptodate property="taskdef.uptodate"
           targetfile="${build.classes.dir}/${taskdef.properties}">
   <srcfiles dir="${src.dir}" includes="**/*.java"/>
   <srcfiles dir="${template.dir}" includes="taskdef.template"/>
</uptodate>

(note, I compare against the custom template itself, in case it 
changed, which I don't think XDoclet itself does)

I would pick a file you know is always updated (ejb-jar.xml?) and use 
that as the targetfile, and compare against all your source code.  If 
one source file changes and is newer than the targetfile, the property 
would not be set.  The logic is a little backwards, but it works.  
There are surely other ways to do this type of check, but this works 
for me.

	Erik


On Mar 30, 2004, at 6:45 AM, Marco Tedone wrote:

> That would be fine, Erik, but how could I compare the source/target of 
> files generated by XDoclet in the ejbdoclet task?
>
> Let's say I've got the following folder:
>
> C:\dev\project\xdoclet-gen
>
> under which I've got the interfaces and utility classes generated by 
> XDoclet. How could I use <uptodate> to compare the src already there 
> and the being generated ones?
>
> Marco
>
>
>
>> On Mar 30, 2004, at 4:46 AM, Marco Tedone wrote:
>> Hi, my boss would like to generate the XDoclet generated code for our
>> EJBs only when the "eventually generated" code would be different from
>> the "already generated" one, thus avoiding lost of time.
>>
>> Has anyone something to reccomend?
>
> XDoclet itself does dependency quite well, although it still takes a
> little time to process that.  When things are up-to-date it definitely
> runs much faster.  But, to speed things up even more, you can use
> <uptodate> to check source/target files, set a property, and then use
> an if/unless clause on a target to bypass XDoclet generation.
>
>    Erik
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
>
> <
>
>
>
>
> ----------------------- Original Message -----------------------
>
> From: Erik Hatcher <erik@ehatchersolutions.com>
> To: "Ant Users List" <user@ant.apache.org>
> Date: Tue, 30 Mar 2004 06:26:19 -0500
> Subject: Re: Generating XDoclet stuff only if changed
>
> On Mar 30, 2004, at 4:46 AM, Marco Tedone wrote: > Hi, my boss would 
> like to generate the XDoclet generated code for our > EJBs only when 
> the "eventually generated" code would be different from > the "already 
> generated" one, thus avoiding lost of time. > > Has anyone something 
> to reccomend? XDoclet itself does dependency quite well, although it 
> still takes a little time to process that. When things are up-to-date 
> it definitely runs much faster. But, to speed things up even more, you 
> can use to check source/target files, set a property, and then use an 
> if/unless clause on a target to bypass XDoclet generation. Erik 
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional 
> commands, e-mail: user-help@ant.apache.org 
> ______________________________________________________________________ 
> This email has been scanned by the MessageLabs Email Security System. 
> For more information please visit http://www.messagelabs.com/email 
> ______________________________________________________________________
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


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


Mime
View raw message