Hi, 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: hello.class; 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. Michael > -----Original Message----- > From: Peter Reilly [mailto:[EMAIL PROTECTED] > 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 org.apache.tools.ant.Task; > 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
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]