You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Westlin Peter <pe...@wmdata.com> on 2002/08/21 11:16:16 UTC

and Windows in Ant 1.5

Has anyone successfully used <uptodate> with Windows (98) in ANT 1.5?
Here is my config:
   <target name="ejbdoclet" depends="prepare">
    <uptodate property="xdoclet.uptodate" srcfile="${ejb.weblogic.file}" targetfile="${ejb.generic.file}" value="fisk"/>
    <antcall target="ejbdoclet-run" inheritRefs="true" />
   </target>
   
   <!-- Run EJBDoclet -->
   <target name="ejbdoclet-run" unless="xdoclet.uptodate">
   ....

ejbdoclet-run always run even if one of the files does not exist...
 
Thanks Weasel

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: and Windows in Ant 1.5

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 21 Aug 2002, Westlin Peter <pe...@wmdata.com> wrote:

> <target name="ejbdoclet" depends="prepare">
>   <uptodate property="xdoclet.uptodate" srcfile="${ejb.weblogic.file}"
>             targetfile="${ejb.generic.file}" value="fisk"/>
>   <antcall target="ejbdoclet-run" inheritRefs="true" />
> </target>

>    <target name="ejbdoclet-run" unless="xdoclet.uptodate">
> 
> ejbdoclet-run always run even if one of the files does not exist...

<uptodate> will execute and set the property xdoclet.uptodate to fisk
if ${ejb.generic.file} is as new or newer than ${ejb.weblogic.file} -
otherwise it will not set the property at all.

If you throw in an <echo> there (before the <antcall>), will it say
that xdoclet.uptodate has been set?  If not, consult Ant's -debug
output to see why it thinks the file is out of date.

May I also suggest to use

<target name="ejbdoclet-check" depends="prepare">
  <uptodate property="xdoclet.uptodate" srcfile="${ejb.weblogic.file}"
            targetfile="${ejb.generic.file}" value="fisk"/>
</target>

<target name="ejbdoclet" unless="xdoclet.uptodate"
        depends="ejbdoclet-check">
  ... your stuff from your original ejbdoclet-run target here ...
</target>

instead of your construct?  It will be more explicit (because it
states its dependencies better) and a lot faster (depending on the
size of your build file).

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>