ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Taylor <paul_t...@fastmail.fm>
Subject Re: How do I call antcall once per line of file using line value as parameter?
Date Wed, 02 Jul 2008 11:11:18 GMT
I dont understand Ruby so this wouldnt be an option for me. It just 
seems that this is such a common problem that it shoulg go into ant proper

Rebhan, Gilbert wrote:
>  
>
> -----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