ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@mad.scientist.com>
Subject Re: Gentle introduction to scripting
Date Fri, 30 Jun 2000 05:15:22 GMT
At 11:19  29/6/00 -0400, you wrote:
>Peter Donald wrote:
>> The only thing I guess that would have to change
>> (assuming we go with some proxy-task holder) is
>> setting of parameters. Basically you would have
>> to go
>>
>> setParameter("message","someValue");
>> instead of
>> setMessage("someValue");
>
>Obviously, there should be an object before the method in the cases above.

yup :P

>There actually is a bug in Rhino which prevents the cleaner syntax being
>used:
>
>   echo.message="some value";
>
>This bug can be worked around by adding a getMessage to the echo Task.  If
>we find that there is a significant demand for scripting, adding getters
>may be a good idea anyway.

there was a whole bunch of bug-fixes in the latest Rhino (1.5 from memory)
that may fix this. It certainly works with beans that I tested thou I am
not sure. There has also been someone who adpated BSF to use the latest
rhino too - so it may or may not be fixed :P

>Note: the ability to call methods on objects is not limited to setting of
>parameters.  Imagine:
>
>   javac.createExclude().name = "**/*.java"
>
>The above does work with Rhino today.  Or even:
>
>   target3.setDependency("target2")

yup. What I was more referring to was in the future when hopefully we get
away from the "instantiate all tasks at begining" to the "instantiate as we
go" + proxies that you suggested. Because the proxy object is unlikely to
have the same properties as the task there needs to be some way to set
properties on the proxy task. Thus neither the 

echo.message = "blah"
or
echo.setMessage( "blah" )

would work. You would have to use some sort of generic mechanism such as 

echo.setParameter("message","blah");

when deferred instantiation of tasks is implemented.


Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

Mime
View raw message