You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Harry_ <ha...@gmail.com> on 2009/11/11 01:46:12 UTC

Running parallel targets in Ant loop

Hi,

I need to run multiple target in Ant's loop. How can I achieve this. I am
able to make antcall in sequential way as described below. 

    <target name="run">
    		<for begin="1" end="2"  param="idx"> 
     	   <sequential>  
	           <antcall target="run-test">
	                
	                
	                
	                
	                
	                
	                
	            	
	            </antcall>
	 	   </sequential>  
     	 </for>  
    </target>

But I need to do performance testing where i need to call multiple targets
with various values of idx.  If I change sequential to parallel, i get
following error:

C:\Eclipse3.1\eclipse\Workspace\AntProject\d6\build.xml:53: Invalid type
class org.apache.tools.ant.taskdefs.Parallel used in For task, it does not
have a public iterator method


Is there any way to achieve what I desire. i.e running parallel targets with
different value of idx (As sometime I had to run multiple targets sometime
up to 30).
-- 
View this message in context: http://old.nabble.com/Running-parallel-targets-in-Ant-loop-tp26294167p26294167.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: Running parallel targets in Ant loop

Posted by Harry_ <ha...@gmail.com>.
Thanks for replying...

But using <parallel> within for loop (see how I used it below) is not
serving my purpose... It is firing antcall's sequentially... I want to run
multiple instances of target "run-test" with different values for id
param....

   <target name="run">
        <for begin="1" end="2"  param="idx">
            <sequential>
                <parallel>
                    <antcall target="run-test">
                        
                    </antcall>
                </parallel>
            </sequential>
        </for>
   </target>


cvsusr wrote:
> 
> you can use <parallel> task.. 
> 
> 
> 
> Harry_ wrote:
>> 
>> Hi,
>> 
>> I need to run multiple target in Ant's loop. How can I achieve this. I am
>> able to make antcall in sequential way as described below. 
>> 
>>     <target name="run">
>>     		<for begin="1" end="2"  param="idx"> 
>>      	   <sequential>  
>> 	           <antcall target="run-test">
>> 	                
>> 	                
>> 	                
>> 	                
>> 	                
>> 	                
>> 	                
>> 	            	
>> 	            </antcall>
>> 	 	   </sequential>  
>>      	 </for>  
>>     </target>
>> 
>> But I need to do performance testing where i need to call multiple
>> targets with various values of idx.  If I change sequential to parallel,
>> i get following error:
>> 
>> C:\Eclipse3.1\eclipse\Workspace\AntProject\d6\build.xml:53: Invalid type
>> class org.apache.tools.ant.taskdefs.Parallel used in For task, it does
>> not have a public iterator method
>> 
>> 
>> Is there any way to achieve what I desire. i.e running parallel targets
>> with different value of idx (As sometime I had to run multiple targets
>> sometime up to 30).
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Running-parallel-targets-in-Ant-loop-tp26294167p26302304.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: Running parallel targets in Ant loop

Posted by Harry_ <ha...@gmail.com>.
Yes it is working with attribute parallel="true"... :)_

Thanks a ton Peter... :)


Peter Reilly-2 wrote:
> 
> You could use the "parallel" attribute ->
> http://ant-contrib.sourceforge.net/tasks/tasks/for.html
> 
> WARNING:: although I wrote the task, I have never used the parallel
> attribute, since
> most of ant is not parallel safe.
> 
> Peter
> 
>>
>> you can use <parallel> task
>>
>>
>> Harry_ wrote:
>>>
>>> Hi,
>>>
>>> I need to run multiple target in Ant's loop. How can I achieve this. I
>>> am
>>> able to make antcall in sequential way as described below.
>>>
>>>     <target name="run">
>>>               <for begin="1" end="2"  param="idx">
>>>          <sequential>
>>>                  <antcall target="run-test">
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>                   </antcall>
>>>                  </sequential>
>>>        </for>
>>>     </target>
>>>
>>> But I need to do performance testing where i need to call multiple
>>> targets
>>> with various values of idx.  If I change sequential to parallel, i get
>>> following error:
>>>
>>> C:\Eclipse3.1\eclipse\Workspace\AntProject\d6\build.xml:53: Invalid type
>>> class org.apache.tools.ant.taskdefs.Parallel used in For task, it does
>>> not
>>> have a public iterator method
>>>
>>>
>>> Is there any way to achieve what I desire. i.e running parallel targets
>>> with different value of idx (As sometime I had to run multiple targets
>>> sometime up to 30).
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Running-parallel-targets-in-Ant-loop-tp26294167p26298555.html
>> Sent from the Ant - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> 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
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Running-parallel-targets-in-Ant-loop-tp26294167p26302453.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: Running parallel targets in Ant loop

Posted by Peter Reilly <pe...@gmail.com>.
You could use the "parallel" attribute ->
http://ant-contrib.sourceforge.net/tasks/tasks/for.html

WARNING:: although I wrote the task, I have never used the parallel
attribute, since
most of ant is not parallel safe.

Peter

>
> you can use <parallel> task
>
>
> Harry_ wrote:
>>
>> Hi,
>>
>> I need to run multiple target in Ant's loop. How can I achieve this. I am
>> able to make antcall in sequential way as described below.
>>
>>     <target name="run">
>>               <for begin="1" end="2"  param="idx">
>>          <sequential>
>>                  <antcall target="run-test">
>>
>>
>>
>>
>>
>>
>>
>>
>>                   </antcall>
>>                  </sequential>
>>        </for>
>>     </target>
>>
>> But I need to do performance testing where i need to call multiple targets
>> with various values of idx.  If I change sequential to parallel, i get
>> following error:
>>
>> C:\Eclipse3.1\eclipse\Workspace\AntProject\d6\build.xml:53: Invalid type
>> class org.apache.tools.ant.taskdefs.Parallel used in For task, it does not
>> have a public iterator method
>>
>>
>> Is there any way to achieve what I desire. i.e running parallel targets
>> with different value of idx (As sometime I had to run multiple targets
>> sometime up to 30).
>>
>
> --
> View this message in context: http://old.nabble.com/Running-parallel-targets-in-Ant-loop-tp26294167p26298555.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: Running parallel targets in Ant loop

Posted by cvsusr <sp...@rediffmail.com>.
you can use <parallel> task.. 



Harry_ wrote:
> 
> Hi,
> 
> I need to run multiple target in Ant's loop. How can I achieve this. I am
> able to make antcall in sequential way as described below. 
> 
>     <target name="run">
>     		<for begin="1" end="2"  param="idx"> 
>      	   <sequential>  
> 	           <antcall target="run-test">
> 	                
> 	                
> 	                
> 	                
> 	                
> 	                
> 	                
> 	            	
> 	            </antcall>
> 	 	   </sequential>  
>      	 </for>  
>     </target>
> 
> But I need to do performance testing where i need to call multiple targets
> with various values of idx.  If I change sequential to parallel, i get
> following error:
> 
> C:\Eclipse3.1\eclipse\Workspace\AntProject\d6\build.xml:53: Invalid type
> class org.apache.tools.ant.taskdefs.Parallel used in For task, it does not
> have a public iterator method
> 
> 
> Is there any way to achieve what I desire. i.e running parallel targets
> with different value of idx (As sometime I had to run multiple targets
> sometime up to 30).
> 

-- 
View this message in context: http://old.nabble.com/Running-parallel-targets-in-Ant-loop-tp26294167p26298555.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


RE: Running parallel targets in Ant loop

Posted by "Wray, Nathan" <Na...@compuware.com>.
Harry, put the parallel inside the sequential.  They aren't a pair where
you would choose one or the other.  The sequential task has hooks that
let the loop structure set the variable for you.  Inside sequential, you
can access idx as @{idx} rather than the more usual ${idx}

<sequential>
	<parallel/>
	<parallel/>
</sequential>



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: Harry_ [mailto:harjitworks@gmail.com] 
Sent: Tuesday, November 10, 2009 7:46 PM
To: user@ant.apache.org
Subject: Running parallel targets in Ant loop


Hi,

I need to run multiple target in Ant's loop. How can I achieve this. I
am
able to make antcall in sequential way as described below. 

    <target name="run">
    		<for begin="1" end="2"  param="idx"> 
     	   <sequential>  
	           <antcall target="run-test">
	                
	                
	                
	                
	                
	                
	                
	            	
	            </antcall>
	 	   </sequential>  
     	 </for>  
    </target>

But I need to do performance testing where i need to call multiple
targets
with various values of idx.  If I change sequential to parallel, i get
following error:

C:\Eclipse3.1\eclipse\Workspace\AntProject\d6\build.xml:53: Invalid type
class org.apache.tools.ant.taskdefs.Parallel used in For task, it does
not
have a public iterator method


Is there any way to achieve what I desire. i.e running parallel targets
with
different value of idx (As sometime I had to run multiple targets
sometime
up to 30).
-- 
View this message in context:
http://old.nabble.com/Running-parallel-targets-in-Ant-loop-tp26294167p26
294167.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
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