> From: Diane Holt [mailto:[EMAIL PROTECTED] > > --- Jose Alberto Fernandez <[EMAIL PROTECTED]> wrote: > > > Another thing, is there a way to define new tasks defined > by scripts? > > Now, this one I can answer -- because I snarf'd it from the doc :) > > <target name="setup"> > <script language="javascript"> <![CDATA[ > for (i=1; i<=10; i++) { > echo = squares.createTask("echo"); > main.addTask(echo); > echo.setMessage(i*i); > } > ]]> </script> > </target> > > <target name="main" depends="setup" /> >
This defines a TARGET which is fine, but what I had in mind was a way to define a real TASK. Yes I know I can use <antcall> to make a target behave like a task, But I really think it would be nice to be able to do: <taskdef name="myscripttask" ....> <script....> </taskdef> and then being able to do: <target .....> <myscripttask ....../> </target> In escence giving the scripting languages the same footing as Java code. Jose Alberto
