ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <co...@cortexebusiness.com.au>
Subject Re: taskdef and <property> declarations
Date Tue, 28 Aug 2001 11:31:41 GMT
From: "Stefano Mancarella" <mancarella@opoipi.bancaintesa.it>


> > >     <taskdef name="sqlfwk3"
> > >             classname="com.gtsdesign.sqlfwk3.ant.Sqlfwk3Taskdef" >
> > >         <classpath>
> > >             <pathelement
> > >             location="${jars.dir}/sqlfwk3-taskdef.jar"/>
> > >         </classpath>
> > >     </taskdef>
> > > but ${jars.dir} (which is actually coming from the calling
> > > buildfile) doesn't seem to get substituted.
> > It should - and your task won't even notice.  If you get a literal
> > ${jars.dir}, this means the property is not set.  Try <echo>ing it
> > before the taskdef.
> > It must be defined, before the <taskdef> gets executed.
> > Stefan
>
> Let me know if I understood well...

Unfortunately not.

> Every property defined after a <taskdef> declaration is not available
> to the custom task (which includes all properties defined inside a
> target). Is it right?

No.

> If so, it seems a strong limitation to me. I tought that <taskdef>
> acted as a kind of "import" statement for custom tasks and import
> statements usually appear before everything else.
>

At the time the <taskdef> is executed, the properties which define its
classpath in the above declaration must be set so the classpath can be
determined so that the <taskdef> can find the appropriate classes. The task
that is created by the taskdef will operate like any other ant task and
will benefit from property resolution including properties which are
undefined at the time of the <taskdef>.

Conor



Mime
View raw message