Trying to catch up on this thread. Are you saying you
want to do something for each line of a file? No
problem. The ResourceCollection API was designed to
return an Iterator partly with the aim of maintaining
compatibility with antcontrib's for and foreach tasks.
Simply use the <tokens> ResourceCollection:
<ac:for param="x">
<tokens>
<file file="${input.file}" />
</tokens>
<sequential>
....
</sequential>
</ac:for>
HTH,
Matt
--- Gilbert Rebhan <[EMAIL PROTECTED]> wrote:
> Paul Taylor schrieb:
> > 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
>
> As you already noticed, (core) ant has it limits.
> OK, to be fair, it
> was never meant as a scripting language, but is
> often used
> like that.
>
> If i get to the limits i use <script> with (j)ruby
> or write a new task.
> There are other languages that run in the VM via
> BSF, f.e. if you want a
> syntax similar to java, use beanshell or javascript
> (rhino).
>
>
> >> 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:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]