I've even noticed a difference between a couple built-in tasks. <property> replaces
${}'s when loaded from a file, but <filter> does NOT. Both DO replace ${}'s when a
single one is defined in the build.xml. With this case it seemed to be that the
<filter> code just chose not to call the <project> function to replace ${}'s with
property values... I don't know why that was, and maybe your case is similar - a
programmer's choice that may have a reason, but it's not readily apparent.
Tim
>>> [EMAIL PROTECTED] 10/03/01 12:46PM >>>
I looked into that a little, but I don't know the code well enough to know.
One thing I did see was that
org.apache.tools.ant.ProjectHelper.NestedElementHandler.init() was handling
'param' differently depending on whether it is the built-in task or the
custom task.
Kris
> -----Original Message-----
> From: Diane Holt [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 03, 2001 10:41 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Property Replacement and Custom Tasks
>
>
> Not sure, but you might want to look thru the changes that
> implemented the
> new "inheritAll" attribute for <ant>/<antcall>.
>
> Diane
>
> --- "Kusumoto, Kris" <[EMAIL PROTECTED]> wrote:
> > After upgrading from 1.2 to 1.4 one of my custom tasks quit
> working.
> > After some testing, I narrowed the problem down to an unexpected
> > difference in property replacement between built-in tasks vs. custom
> > tasks.
> >
> > The build.xml below is a minimal example which doesn't use my custom
> > task but still illustrates the issue. The custom task
> 'testcall' maps
> > to Ant's CallTarget (i.e. antcall). I would expect both calls to
> > the 'test' target to operate the same, but they don't. Am
> I mis-using
> > property replacement?
> >
> > Kris
> >
> > BUILD.XML
> > ---------------------------------------------------------------
> > <project name="unused" default="all" basedir=".">
> >
> > <target name="all">
> > <property name="bad" value="good" />
> > <taskdef name="testcall"
> > classname="org.apache.tools.ant.taskdefs.CallTarget" />
> > <antcall target="test">
> > <param name="arg" value="${bad}" />
> > </antcall>
> > <testcall target="test">
> > <param name="arg" value="${bad}" />
> > </testcall>
> > </target>
> >
> > <target name="test">
> > <echo message="test is ${arg}" />
> > </target>
> >
> > </project>
> >
> > OUTPUT
> > ----------------------------------------------------------------
> > Buildfile: build.xml
> >
> > all:
> >
> > test:
> > [echo] test is good
> >
> > test:
> > [echo] test is ${bad}
> >
> > BUILD SUCCESSFUL
> >
> > Total time: 0 seconds
>
>
> =====
> ([EMAIL PROTECTED])
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Listen to your Yahoo! Mail messages from any phone.
> http://phone.yahoo.com
>