Supriya Saha ([EMAIL PROTECTED]) wrote:
> Yes it's a problem. My solution is that just before calling the ant task
> define a local property using the parameter ${jars.dir} and use the local
> property.
> Let me know whether it solves your problem or not.
>
> Best of luck,
> Supriyo

Hi Supriyo --

I just tried putting the taskdef inside the target where it's
used, and I can use the parameters there!  I had it wrong before
(sorry!) that the parameters were coming from a calling buildfile,
this one is standalone.  I had tried:

    <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>

which didn't work, but:

    <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>
        <sqlfwk3.... />
    </target>

works fine!

Thanks for your help!

        Gary


> -----Original Message-----
> From: Gary Shea [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 22, 2001 3:33 PM
> To: [EMAIL PROTECTED]
> Subject: Re: taskdef and <property> declarations
>
> Oops, I don't think I gave enough details!
>
> 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.  If I replace the
> ${jars.dir} in the taskdef with its value, everything works.  I know
> it's not a problem with ${jars.dir} itself, as the buildfile uses it
> successfully outside the taskdef element.
>
> Regards,
>
>         Gary
>
> T Master ([EMAIL PROTECTED]) wrote:
> > You did imeplement a setFoo() method for an attribute called foo ?
> > e.g. foo="blah"
> >
> > That's how i did it.
> >
> >
> > ----- Original Message -----
> > From: "Gary Shea" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, August 22, 2001 1:05 PM
> > Subject: taskdef and <property> declarations
> >
> >
> > > Hi --
> > >
> > > Today I had the pleasure of getting a custom taskdef working, wow!
> > > Very slick.
> > >
> > > My only issue is that I can't seem to use property values (e.g.,
> > > ${jars.dir}) in the taskdef element.  Am I just missing something, or
> > > is this really not possible?
> > >
> > > Regards,
> > >
> > > Gary Shea
> > > [EMAIL PROTECTED]
> > >
> >
> >
>
>

Reply via email to