ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Shea <s...@gtsdesign.com>
Subject Re: taskdef and <property> declarations
Date Thu, 23 Aug 2001 06:20:19 GMT
Stefan Bodewig (bodewig@apache.org) wrote:
> On Wed, 22 Aug 2001, Gary Shea <shea@gtsdesign.com> wrote:
>
> > What I want to write is:
> >
> >     <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

Here's what I initially tried, which does not work with 1.3:

    <target name="init">
	<property name="jars.dir" value="..."/>
    </target>

    <taskdef name="sqlfwk3"
	    classname="com.gtsdesign.sqlfwk3.ant.Sqlfwk3Taskdef" >
	<classpath>
	    <pathelement
	    location="${jars.dir}/sqlfwk3-taskdef.jar"/>
	</classpath>
    </taskdef>

I get a ClassNotFoundException on the class given in the classname
attribute.

Here's a slightly different version that works just fine:

    <target name="init">
	<property name="jars.dir" value="..."/>
    </target>

    <target name="sqlfwk3" depends="init">
	<taskdef name="sqlfwk3"
		classname="com.gtsdesign.sqlfwk3.ant.Sqlfwk3Taskdef" >
	    <classpath>
		<pathelement
		location="${jars.dir}/sqlfwk3-taskdef.jar"/>
	    </classpath>
	</taskdef>
    </target>

Is that the expected behavior?

Thanks!

	Gary


Mime
View raw message