ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose Alberto Fernandez <JFernan...@viquity.com>
Subject RE: [PATCH] New <case> task
Date Thu, 12 Oct 2000 19:55:30 GMT
> From: Diane Holt [mailto:holtdl@yahoo.com]
> 
> --- Jose  Alberto Fernandez <JFernandez@viquity.com> 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

Mime
View raw message