What you describe is a template mechanism. 
It is very useful, but it is not that easy to implement.

My submission was more modest in scope:
  It allows an Argument to be shared like a PatternSet or a FileSet.
  It also allows transformations between argument and path.

Obviously it is not anywhere as powerful as a template,
but it requires only modest changes to Ant and it is still useful:

<argset id="mydefinitions">
  <arg value="-Dsecurity.policy" />
  <arg value="-Djava.security.policy=${config.dir}/${policy.name}"/>
</argset>

 <target ... >
   <java ...>
     <jvmarg refid="mydefinitions"/>
   </java>
 </target>


Note that your example already uses a reference to path <classpath refid="..." 
/>. 
This is not all that different from a reference to an argument, is it?

I'll make you that promise: I will look at a possible implementation of 
taskdef, 
and if does not require rewriting half of Ant core or adding huge amount of 
code,
it may yet show up in one of my submissions.

Vincent.

----- Original Message ----- 
From: "Jose Alberto Fernandez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 27, 2000 4:05 PM
Subject: RE: Some Thoughts on Ant 1.3 and 2.0

> I really, think it would be more usefull we we could define new
> tasks which just provide a predefined set of parameters for
> normal tasks. A loose set of arguments as a datatype is a very strange
> concept that smells to me like a MACRO expansion.
> 
> I would prefer having something like closures:
> 
>  <taskdef name="mycommand" >
>    <java classname="....." >
>     <classpath refid="..." />
>     <sysproperty key=".." value="..." />
>     <arg value="..." />
>    </java>
>  </taskdef>
> 
> ....
> 
>  <target ... >
>   <mycommand>
>    <arg file="..." />
>   </mycommand>
>  </target>
> 
> Here the <mycommand> task is equivalent to:
> 
>    <java classname="....." >
>     <classpath refid="..." />
>     <sysproperty key=".." value="..." />
>     <arg value="..." />
>     <arg file="..." />
>    </java> 
> 
> If I had this functionality, I could reduce my build files for at least 50%
> and they would be 10X more readable.
> 
> Jose Alberto
> PS: This is not just for the <java> task, but for any other task.


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Reply via email to