ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Sunde" <>
Subject RE: BeanShellDef - java.lang.LinkageError: duplicate class definition: AList
Date Fri, 23 Jan 2004 19:50:53 GMT

Can't wait to see beanshelldef or something equivalent in a new version of ant. How about
this for a task name:
- inlinetypedef
- scripttypedef
or maybe merge the functionality into typedef.

Looking at your example of reflectdef, the only thing I don't like is the line:
I prefer how it is done in beanshelldef with the classname attribute. That is just my $0.02,
so do what you think is best.

For now, I managed to modify beanshelldef to work around the antcall problem. See the attachment.

Keep up the good work. I look forward to seeing future versions of ant.

> -----Original Message-----
> From: Peter Reilly []
> Sent: Friday, January 23, 2004 4:08 AM
> To: Ant Developers List
> Subject: Re: BeanShellDef - java.lang.LinkageError: duplicate class
> definition: AList
> Thanks,
>   Yes I find it very usefull to write small tasks using beanshelldef.
>   There is a  problem with antcall and beanshelldef.
> The easiest work-around would be to place the definition in an init
> target that gets called only if a property is not defined:
> <target name="init-beanshell-tasks" unless="beanshell-tests-defined">
>    <beanshelldef .../>
>    <property name="beanshell-tasks-defined" value="yes"/>
> </target>
> About the beanshelldef, I have found that I can use BSF to do 
> this and not
> call beanshell directly. This will mean that the define will 
> support any
> BSF language that can export proper java classes and also make the
> ant code independant of linking to beanshell.
> The working title is reflectdef:
>     <reflectdef name="hello" language="beanshell">
>       import;
>       public class hello extends Task {
>           public void execute() {
>              log("Hello world");
>           }
>       }
>       hello.class;
>     </reflectdef>
>     <hello/>
> Currently the only language (I know) that can export a java 
> class that 
> can be
> reflected is beanshell 2.0b1.  It looks like grovvy and pnuts 
> may have this
> ability. jython and rhino (As far as I can see) do not.
> Peter

View raw message