You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jan <ra...@gmail.com> on 2010/04/12 21:08:20 UTC

Looping number of times

Hi All,

Is there any task available to loop for number of times ?

I know we can use ant-contrib for loop for the comma seperated list, instead
of it i want to mention loop it for 10 times

Any one any idea?

AW: Looping number of times

Posted by Ja...@rzf.fin-nrw.de.
<antcontrib:for begin="1" end="10">

Jan 

> -----Ursprüngliche Nachricht-----
> Von: Scot P. Floess [mailto:sfloess@nc.rr.com] 
> Gesendet: Montag, 12. April 2010 21:47
> An: Ant Users List
> Betreff: Re: Looping number of times
> 
> 
> This exact question was posted sometime back...  I wrote a 
> macrodef that 
> does it...  I believe there is also a JWare library that does 
> just that. 
> You may be able to do something using a scripting language...
> 
> On Mon, 12 Apr 2010, Jan wrote:
> 
> > Hi All,
> >
> > Is there any task available to loop for number of times ?
> >
> > I know we can use ant-contrib for loop for the comma 
> seperated list, instead
> > of it i want to mention loop it for 10 times
> >
> > Any one any idea?
> >
> 
> -- 
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC  27549
> 
> 252-478-8087 (Home)
> 919-890-8117 (Work)
> 
> Chief Architect JPlate   http://sourceforge.net/projects/jplate
> Chief Architect JavaPIM  http://sourceforge.net/projects/javapim
> 
> Architect Keros          http://sourceforge.net/projects/keros
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 

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


RE: Looping number of times

Posted by Shawn Castrianni <Sh...@halliburton.com>.
I either could not get the ones I found working, or they were just too complicated.  Here is the one I wrote which is not a for loop, but can become one by maintaining your own index property and setting the if value to the loop maximum.


import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.MacroDef;
import org.apache.tools.ant.taskdefs.MacroInstance;

public class WhileTask extends Task {
  protected String _property = null;
  protected String _ifVal = null;
  protected String _unlessVal = null;
  protected boolean _keepgoing = false;
  protected MacroDef _macroDef = null;
  protected int _taskCount = 0;
  protected int _errorCount = 0;

  public WhileTask()
  {
  }

  public void setKeepgoing(boolean keepgoing)
  {
    _keepgoing = keepgoing;
  }

  public void setProperty(String property)
  {
    _property = property;
  }

  public void setIf(String ifVal)
  {
    _ifVal = ifVal;
  }

  public void setUnless(String unlessVal)
  {
    _unlessVal = unlessVal;
  }

  public Object createSequential()
  {
    _macroDef = new MacroDef();
    _macroDef.setProject(getProject());
    return(_macroDef.createSequential());
  }

  public void execute()
  {
    if(_property == null)
      throw new BuildException("You must supply a property name to check terminating conditions on");
    if((_ifVal == null) && (_unlessVal == null))
      throw new BuildException("You must supply either an if value or unless value for termination of the while loop");
    if(_macroDef == null)
      throw new BuildException("You must supply an embedded sequential to perform");
    doTheTasks();
  }

  protected void doSequentialIteration()
  {
    MacroInstance instance = new MacroInstance();
    instance.setProject(getProject());
    instance.setOwningTarget(getOwningTarget());
    instance.setMacroDef(_macroDef);
    instance.execute();
  }

  protected void doTask()
  {
    try {
      _taskCount++;
      doSequentialIteration();
    } catch(BuildException be) {
      if(_keepgoing) {
        _errorCount++;
      } else {
        throw be;
      }
    }
  }

  protected void doTheTasks()
  {
    _errorCount = 0;
    _taskCount = 0;
    Project proj = getProject();
    if(!proj.getProperties().containsKey(_property))
      throw new BuildException("Property: " + _property + " does not exist");
    String propVal = proj.getProperty(_property);
    while(((_ifVal != null) && (propVal.equals(_ifVal))) || ((_unlessVal != null) && (!propVal.equals(_unlessVal)))) {
      doTask();
      propVal = proj.getProperty(_property);
    }
    if((_keepgoing) && (_errorCount != 0))
      throw new BuildException("Keepgoing execution: " + _errorCount + " of " + _taskCount + " iterations failed.");
  }
}


Shawn Castrianni

----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient.  Any review, use, distribution, or disclosure by others is strictly prohibited.  If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.

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


Re: Looping number of times

Posted by "Scot P. Floess" <sf...@nc.rr.com>.
This exact question was posted sometime back...  I wrote a macrodef that 
does it...  I believe there is also a JWare library that does just that. 
You may be able to do something using a scripting language...

On Mon, 12 Apr 2010, Jan wrote:

> Hi All,
>
> Is there any task available to loop for number of times ?
>
> I know we can use ant-contrib for loop for the comma seperated list, instead
> of it i want to mention loop it for 10 times
>
> Any one any idea?
>

-- 
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-890-8117 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

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


Re: Looping number of times

Posted by Peter Reilly <pe...@gmail.com>.
There is a bug with the <for> task. It is unable to handle
begin and end being the same.

I cannot push a fix, since I forgot my ant-contrib username/password.

Here is a patch:
Index: src/main/java/net/sf/antcontrib/logic/ForTask.java
===================================================================
--- src/main/java/net/sf/antcontrib/logic/ForTask.java  (revision 177)
+++ src/main/java/net/sf/antcontrib/logic/ForTask.java  (working copy)
@@ -237,7 +237,7 @@
                 throw new BuildException("step cannot be 0");
             } else if (iEnd > begin && step < 0) {
                 throw new BuildException("end > begin, step needs to be > 0");
-            } else if (iEnd <= begin && step > 0) {
+            } else if (iEnd < begin && step > 0) {
                 throw new BuildException("end <= begin, step needs to be < 0");
             }
         }

Peter

On Wed, May 12, 2010 at 6:40 PM, Wray, Nathan <Na...@compuware.com> wrote:
> End needs to be strictly greater than begin.  Change end to 2 and you
> should be ok.
>
>
> The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.
>
> From: Jan [mailto:raghurefer@gmail.com]
> Sent: Wednesday, May 12, 2010 12:24 PM
> To: Ant Users List
> Subject: Re: Looping number of times
>
> Hi All,
>
> i started using ant-contrib-1.0b3.jar and stuck with one more problem on
> for
> loop
>
> For example see the "end" & "begin" attribute below, i don't want my
> loop to
> start with "0" i want to start with 1
>
> <project xmlns:ac="antlib:net.sf.antcontrib">
>  <taskdef uri="antlib:net.sf.antcontrib"
> resource="net/sf/antcontrib/antlib.xml"
> classpath="C:\my-ant-extension-libs\ant-contrib-1.0b3.jar"
> />
>
>  <echo>${ant.version}</echo>
>  <ac:for param="i" end="1" begin="1">
>   <sequential>
>     <echo>i is @{i}</echo>
>   </sequential>
>  </ac:for>
> </project>
>
> When i run this i get error
> BUILD FAILED
> C:\Temp\test.xml:8: end <= begin, step needs to be < 0
>
> any one has any idea how to make this work? Please help
>
> Thanks  in advance for your help
>
>
> On Thu, Apr 15, 2010 at 11:00 AM, Jan <ra...@gmail.com> wrote:
>
>> Already tried it and didn't work
>>
>> $ ant -f test.xml
>> Buildfile: test.xml
>> Trying to override old definition of task for
>>      [echo] Apache Ant version 1.6.3 compiled on April 28 2005
>>
>> BUILD FAILED
>> C:\Temp\test.xml:8: The <antlib:net.sf.antcontrib:for> type doesn't
> support
>> the "end" attribute.
>>
>>
>> On Wed, Apr 14, 2010 at 11:52 PM, <Ja...@rzf.fin-nrw.de> wrote:
>>
>>> > It did work with antconrib 1.0b3
>>> >
>>> > I just have another question, is there a way to override jar
>>> > in ant lib
>>> > directory
>>>
>>> Try
>>>
>>> <project xmlns:ac="antlib:net.sf.antcontrib">
>>>   <taskdef resource="net/sf/antcontrib/antlib.xml">
>>>    <classpath>
>>>      <pathelement location="-path-to-your-ac-jar"/>
>>>    </classpath>
>>>  </taskdef>
>>> </project>
>>>
>>>
>>> Jan
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: user-help@ant.apache.org
>>>
>>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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


RE: Looping number of times

Posted by "Wray, Nathan" <Na...@compuware.com>.
End needs to be strictly greater than begin.  Change end to 2 and you
should be ok.


The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.

From: Jan [mailto:raghurefer@gmail.com] 
Sent: Wednesday, May 12, 2010 12:24 PM
To: Ant Users List
Subject: Re: Looping number of times

Hi All,

i started using ant-contrib-1.0b3.jar and stuck with one more problem on
for
loop

For example see the "end" & "begin" attribute below, i don't want my
loop to
start with "0" i want to start with 1

<project xmlns:ac="antlib:net.sf.antcontrib">
 <taskdef uri="antlib:net.sf.antcontrib"
resource="net/sf/antcontrib/antlib.xml"
classpath="C:\my-ant-extension-libs\ant-contrib-1.0b3.jar"
/>

 <echo>${ant.version}</echo>
 <ac:for param="i" end="1" begin="1">
   <sequential>
     <echo>i is @{i}</echo>
   </sequential>
 </ac:for>
</project>

When i run this i get error
BUILD FAILED
C:\Temp\test.xml:8: end <= begin, step needs to be < 0

any one has any idea how to make this work? Please help

Thanks  in advance for your help


On Thu, Apr 15, 2010 at 11:00 AM, Jan <ra...@gmail.com> wrote:

> Already tried it and didn't work
>
> $ ant -f test.xml
> Buildfile: test.xml
> Trying to override old definition of task for
>      [echo] Apache Ant version 1.6.3 compiled on April 28 2005
>
> BUILD FAILED
> C:\Temp\test.xml:8: The <antlib:net.sf.antcontrib:for> type doesn't
support
> the "end" attribute.
>
>
> On Wed, Apr 14, 2010 at 11:52 PM, <Ja...@rzf.fin-nrw.de> wrote:
>
>> > It did work with antconrib 1.0b3
>> >
>> > I just have another question, is there a way to override jar
>> > in ant lib
>> > directory
>>
>> Try
>>
>> <project xmlns:ac="antlib:net.sf.antcontrib">
>>   <taskdef resource="net/sf/antcontrib/antlib.xml">
>>    <classpath>
>>      <pathelement location="-path-to-your-ac-jar"/>
>>    </classpath>
>>  </taskdef>
>> </project>
>>
>>
>> Jan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>


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


Re: Looping number of times

Posted by Jan <ra...@gmail.com>.
Hi All,

i started using ant-contrib-1.0b3.jar and stuck with one more problem on for
loop

For example see the "end" & "begin" attribute below, i don't want my loop to
start with "0" i want to start with 1

<project xmlns:ac="antlib:net.sf.antcontrib">
 <taskdef uri="antlib:net.sf.antcontrib"
resource="net/sf/antcontrib/antlib.xml"
classpath="C:\my-ant-extension-libs\ant-contrib-1.0b3.jar"
/>

 <echo>${ant.version}</echo>
 <ac:for param="i" end="1" begin="1">
   <sequential>
     <echo>i is @{i}</echo>
   </sequential>
 </ac:for>
</project>

When i run this i get error
BUILD FAILED
C:\Temp\test.xml:8: end <= begin, step needs to be < 0

any one has any idea how to make this work? Please help

Thanks  in advance for your help


On Thu, Apr 15, 2010 at 11:00 AM, Jan <ra...@gmail.com> wrote:

> Already tried it and didn't work
>
> $ ant -f test.xml
> Buildfile: test.xml
> Trying to override old definition of task for
>      [echo] Apache Ant version 1.6.3 compiled on April 28 2005
>
> BUILD FAILED
> C:\Temp\test.xml:8: The <antlib:net.sf.antcontrib:for> type doesn't support
> the "end" attribute.
>
>
> On Wed, Apr 14, 2010 at 11:52 PM, <Ja...@rzf.fin-nrw.de> wrote:
>
>> > It did work with antconrib 1.0b3
>> >
>> > I just have another question, is there a way to override jar
>> > in ant lib
>> > directory
>>
>> Try
>>
>> <project xmlns:ac="antlib:net.sf.antcontrib">
>>   <taskdef resource="net/sf/antcontrib/antlib.xml">
>>    <classpath>
>>      <pathelement location="-path-to-your-ac-jar"/>
>>    </classpath>
>>  </taskdef>
>> </project>
>>
>>
>> Jan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>

Re: Looping number of times

Posted by Jan <ra...@gmail.com>.
Already tried it and didn't work

$ ant -f test.xml
Buildfile: test.xml
Trying to override old definition of task for
     [echo] Apache Ant version 1.6.3 compiled on April 28 2005

BUILD FAILED
C:\Temp\test.xml:8: The <antlib:net.sf.antcontrib:for> type doesn't support
the "end" attribute.

On Wed, Apr 14, 2010 at 11:52 PM, <Ja...@rzf.fin-nrw.de> wrote:

> > It did work with antconrib 1.0b3
> >
> > I just have another question, is there a way to override jar
> > in ant lib
> > directory
>
> Try
>
> <project xmlns:ac="antlib:net.sf.antcontrib">
>   <taskdef resource="net/sf/antcontrib/antlib.xml">
>    <classpath>
>      <pathelement location="-path-to-your-ac-jar"/>
>    </classpath>
>  </taskdef>
> </project>
>
>
> Jan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

AW: Looping number of times

Posted by Ja...@rzf.fin-nrw.de.
> It did work with antconrib 1.0b3
> 
> I just have another question, is there a way to override jar 
> in ant lib
> directory

Try

<project xmlns:ac="antlib:net.sf.antcontrib">
  <taskdef resource="net/sf/antcontrib/antlib.xml">
    <classpath>
      <pathelement location="-path-to-your-ac-jar"/>
    </classpath>
  </taskdef>
</project>


Jan

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


Re: Looping number of times

Posted by Jan <ra...@gmail.com>.
Thank you Jan

It did work with antconrib 1.0b3

I just have another question, is there a way to override jar in ant lib
directory

For eg,

in our ant.home/lib directory it has ant-contrib-0.3.jar, and the same
installation is being used by different team and they're not ready to change
the ant-contrib jar, but i want to use this new jar i tried the following
way, but still its not taking  the new ant contrib

<project xmlns:ac="antlib:net.sf.antcontrib">
 <taskdef uri="antlib:net.sf.antcontrib"
resource="net/sf/antcontrib/antlib.xml"
classpath="C:\my-ant-extension-libs\ant-contrib-1.0b3.jar"
/>
 <echo>${ant.version}</echo>
 <ac:for param="i" end="10">
   <sequential>
     <echo>i is @{i}</echo>
   </sequential>
 </ac:for>
</project>

got the error like

Trying to override old definition of task antlib:net.sf.antcontrib:for
     [echo] Apache Ant version 1.7.1 compiled on June 27 2008
Trying to override old definition of task antlib:net.sf.antcontrib:for

BUILD FAILED
C:\my-prj\/test.xml:4: ac:for doesn't support the "end" attribute



On Tue, Apr 13, 2010 at 11:42 PM, <Ja...@rzf.fin-nrw.de> wrote:

> Here is the my working example :
> <?xml version="1.0" encoding="ISO-8859-15"?>
> <project xmlns:ac="antlib:net.sf.antcontrib">
>  <echo>${ant.version}</echo>
>   <ac:for param="i" end="10">
>    <sequential>
>      <echo>i is @{i}</echo>
>    </sequential>
>  </ac:for>
> </project>
>
> Buildfile: build.xml
>     [echo] Apache Ant version 1.7.0 compiled on December 13 2006
>     [echo] i is 0
>     [echo] i is 1
>     [echo] i is 2
>     [echo] i is 3
>     [echo] i is 4
>     [echo] i is 5
>     [echo] i is 6
>     [echo] i is 7
>     [echo] i is 8
>     [echo] i is 9
>     [echo] i is 10
>
> BUILD SUCCESSFUL
>
> Tried with ant-contrib-1.0b3.jar
>
>
> Jan
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: Jan [mailto:raghurefer@gmail.com]
> > Gesendet: Dienstag, 13. April 2010 21:38
> > An: Ant Users List
> > Betreff: Re: Looping number of times
> >
> > Hi Jan
> >
> > is this ant- conrib stuff really works?
> >
> > coz i'm getting the error     --->  The <for> type doesn't
> > support the "end"
> > attribute.
> >
> > On Tue, Apr 13, 2010 at 2:05 AM, <Ja...@rzf.fin-nrw.de> wrote:
> >
> > > or directly from the ac-manual
> > >
> > >  The following example loops from one to ten.
> > >
> > >    <ac:for param="i" end="10">
> > >      <sequential>
> > >        <echo>i is @{i}</echo>
> > >      </sequential>
> > >    </ac:for>
> > >
> > >
> > > Jan
> > >
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: Jan [mailto:raghurefer@gmail.com]
> > > > Gesendet: Montag, 12. April 2010 21:08
> > > > An: Ant Users List
> > > > Betreff: Looping number of times
> > > >
> > > > Hi All,
> > > >
> > > > Is there any task available to loop for number of times ?
> > > >
> > > > I know we can use ant-contrib for loop for the comma
> > > > seperated list, instead
> > > > of it i want to mention loop it for 10 times
> > > >
> > > > Any one any idea?
> > > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > > For additional commands, e-mail: user-help@ant.apache.org
> > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

AW: Looping number of times

Posted by Ja...@rzf.fin-nrw.de.
Here is the my working example :
<?xml version="1.0" encoding="ISO-8859-15"?>
<project xmlns:ac="antlib:net.sf.antcontrib">
  <echo>${ant.version}</echo>
  <ac:for param="i" end="10">
    <sequential>
      <echo>i is @{i}</echo>
    </sequential>
  </ac:for>
</project>

Buildfile: build.xml
     [echo] Apache Ant version 1.7.0 compiled on December 13 2006
     [echo] i is 0
     [echo] i is 1
     [echo] i is 2
     [echo] i is 3
     [echo] i is 4
     [echo] i is 5
     [echo] i is 6
     [echo] i is 7
     [echo] i is 8
     [echo] i is 9
     [echo] i is 10

BUILD SUCCESSFUL

Tried with ant-contrib-1.0b3.jar


Jan


> -----Ursprüngliche Nachricht-----
> Von: Jan [mailto:raghurefer@gmail.com] 
> Gesendet: Dienstag, 13. April 2010 21:38
> An: Ant Users List
> Betreff: Re: Looping number of times
> 
> Hi Jan
> 
> is this ant- conrib stuff really works?
> 
> coz i'm getting the error     --->  The <for> type doesn't 
> support the "end"
> attribute.
> 
> On Tue, Apr 13, 2010 at 2:05 AM, <Ja...@rzf.fin-nrw.de> wrote:
> 
> > or directly from the ac-manual
> >
> >  The following example loops from one to ten.
> >
> >    <ac:for param="i" end="10">
> >      <sequential>
> >        <echo>i is @{i}</echo>
> >      </sequential>
> >    </ac:for>
> >
> >
> > Jan
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Jan [mailto:raghurefer@gmail.com]
> > > Gesendet: Montag, 12. April 2010 21:08
> > > An: Ant Users List
> > > Betreff: Looping number of times
> > >
> > > Hi All,
> > >
> > > Is there any task available to loop for number of times ?
> > >
> > > I know we can use ant-contrib for loop for the comma
> > > seperated list, instead
> > > of it i want to mention loop it for 10 times
> > >
> > > Any one any idea?
> > >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
> 

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


RE: Looping number of times

Posted by Shawn Castrianni <Sh...@halliburton.com>.
That is why I said in my response:

"I either could not get the ones I found working, or they were just too complicated"

If you take the while task I sent source code for, and then combine that with antelope tasks to do math operations, you can write a for loop on an index with:

<?xml version="1.0" encoding="UTF-8"?>
<project name="loop" xmlns:bt="antlib:mytasks" xmlns:at="antlib:ise.antelope.tasks">
	<target name="test">
		<property name="index" value="1"/>
		<bt:while property="index" unless="11">
			<sequential>
            <echo message="index: ${index}"/>
            <at:math result="index" operand1="${index}" operation="+" operand2="1" datatype="int"/>
			</sequential>
		</bt:while>
	</target>
</project>

Running this test, gives you:

test:
     [echo] index: 1
     [echo] index: 2
     [echo] index: 3
     [echo] index: 4
     [echo] index: 5
     [echo] index: 6
     [echo] index: 7
     [echo] index: 8
     [echo] index: 9
     [echo] index: 10

BUILD SUCCESSFUL
Total time: 0 seconds
---
Shawn Castrianni

----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient.  Any review, use, distribution, or disclosure by others is strictly prohibited.  If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.

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


Re: Looping number of times

Posted by Jan <ra...@gmail.com>.
Hi Jan

is this ant- conrib stuff really works?

coz i'm getting the error     --->  The <for> type doesn't support the "end"
attribute.

On Tue, Apr 13, 2010 at 2:05 AM, <Ja...@rzf.fin-nrw.de> wrote:

> or directly from the ac-manual
>
>  The following example loops from one to ten.
>
>    <ac:for param="i" end="10">
>      <sequential>
>        <echo>i is @{i}</echo>
>      </sequential>
>    </ac:for>
>
>
> Jan
>
> > -----Ursprüngliche Nachricht-----
> > Von: Jan [mailto:raghurefer@gmail.com]
> > Gesendet: Montag, 12. April 2010 21:08
> > An: Ant Users List
> > Betreff: Looping number of times
> >
> > Hi All,
> >
> > Is there any task available to loop for number of times ?
> >
> > I know we can use ant-contrib for loop for the comma
> > seperated list, instead
> > of it i want to mention loop it for 10 times
> >
> > Any one any idea?
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

AW: Looping number of times

Posted by Ja...@rzf.fin-nrw.de.
or directly from the ac-manual

 The following example loops from one to ten.

    <ac:for param="i" end="10">
      <sequential>
        <echo>i is @{i}</echo>
      </sequential>
    </ac:for>
    

Jan 

> -----Ursprüngliche Nachricht-----
> Von: Jan [mailto:raghurefer@gmail.com] 
> Gesendet: Montag, 12. April 2010 21:08
> An: Ant Users List
> Betreff: Looping number of times
> 
> Hi All,
> 
> Is there any task available to loop for number of times ?
> 
> I know we can use ant-contrib for loop for the comma 
> seperated list, instead
> of it i want to mention loop it for 10 times
> 
> Any one any idea?
> 

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


Re: Looping number of times

Posted by Gilbert Rebhan <an...@schillbaer.de>.
-------- Original Message  --------
Subject: Looping number of times
From: Jan <ra...@gmail.com>
To: Ant Users List <us...@ant.apache.org>
Date: 12.04.2010 21:08

> Hi All,
> 
> Is there any task available to loop for number of times ?
> 
> I know we can use ant-contrib for loop for the comma seperated list, instead
> of it i want to mention loop it for 10 times
> 
> Any one any idea?
> 

see Antelope Ant Tasks =
http://antelope.tigris.org/nonav/docs/manual/bk03.html

repeat task =
http://antelope.tigris.org/nonav/docs/manual/bk03ch24.html


Regards, Gilbert

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