ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
Subject RE: How do I call antcall once per line of file using line value as parameter?
Date Wed, 02 Jul 2008 10:59:40 GMT
 

-----Original Message-----
From: Paul Taylor [mailto:paul_t100@fastmail.fm] 
Sent: Wednesday, July 02, 2008 10:30 AM
To: Ant Users List
Subject: Re: How do I call antcall once per line of file using line
value as parameter?

/*
I did it using Ant-contrib as follows

<target name="Maintask"> 
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<loadfile property="params" srcFile="inputfile"/> 
<foreach list="${params}" delimiter="&#x0A;" target="subtask" 
param="param1"/>
</target>
*/

also possible without antcontrib =

<script language="ruby">
<![CDATA[
  echoTask = $project.createTask 'echo'
  IO.readlines("Y:/foobar.txt").each do |line|
    echoTask.addText(line)
    echoTask.execute
  end
]]>
</script>

you have full access to the ant api


Regards, Gilbert

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message