ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject Re: Foreach task)
Date Tue, 12 Jun 2001 08:02:08 GMT
At 09:29 AM 6/12/01 +0200, Stefan Bodewig wrote:
>Peter Donald <donaldp@apache.org> wrote:
>
>> At 09:20 AM 6/12/01 +0200, Stefan Bodewig wrote:
>>>Peter Donald <donaldp@apache.org> wrote:
>>>
>>>> (3) Remove iteration from all tasks and core and implement it in
>>>> another layer ;)
>>>
>>>In another layer that is not a task?
>> 
>> yup ;)
>
>Care to expand?

Okay - but remember you asked for the can of worms to be opened ;) 

"templating" - if you remember the first example of using XSLT (posted eons
ago) they defined multiple input data items which got expanded into
appropriate underlying form. For instance you could have an input file that
looked something like

<cluster>
  <server ip="192.168.1.1" dir="/pub"/>
  <server ip="192.168.1.2" dir="/pub/somedir"/>
  <server ip="192.168.1.3" dir="/pub/another/place"/>
  <server ip="192.168.1.4" dir="/pub/blah"/>
  <server ip="192.168.1.5" dir="/pub"/>
</cluster>

<products>
  <product name="foo" package="com.biz.foo" version="1.0"/>
  <product name="bar" package="com.biz.some.package.bar" version="1.0"/>
  <product name="baz" package="com.biz.lalalalalalala" version="1.0"/>
  <product name="meep" package="com.biz.type2.meep" version="1.0"/>
  <product name="muup" package="com.biz.type2.muup" version="1.0"/>
  <product name="moop" package="com.biz.type2.moop" version="1.0"/>
</products>

When this is passed through template, each product would be expanded to a
set of tasks such as.

 <copy useing filters to replace version/>
 <javac/>
 <jar/>
 <signjar/>
 <scp jar to server1 />
 <scp jar to server2 />
 <scp jar to server3 />
  ...

The transformation from input-data to tasks would be via some rule/template
system (ie XSLT) and in theory could be implemented in any number of ways
(most obvious optimization would be to copy and compile all java classes at
once). 



Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*


Mime
View raw message