You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by norken76 <na...@yahoo.com> on 2009/01/22 19:30:56 UTC

Re: AW: Call a target with parameter?

Hi there,
Has anyone tried to pass in params to a called target via 'calltarget' of
antcontrib (without creating new project) OR maybe a different way to
achieve this goal (pass param to a called target without creating new
project) I've tried using <variable> (set and unset after the target is
called) but no success, the called target sees always the first value of
that variable

thank you



Jan.Materne wrote:
> 
> <target name="run" if="class">
>     <java classname="${class}"/>
> </target>
> 
> $ ant -Dclass=MyClass
> $ ant -Dclass=YourClass
> $ ant -Dclass=HisClass 
> 
> 
> or
> 
> 
> <macrodef name="run">
>     <attribute name="class" default="MyClass"/>
>     <sequential>
>         <java classname="@{class}"/>
>     </sequential>
> </macrodef>
> <target name="run-a">
>     <run/>
> </target>
> <target name="run-b">
>     <run class="YourClass"/>
> </target>
> <target name="run-C">
>     <run class="HisClass"/>
> </target>
> 
> 
> 
> or
> 
> <target name="-run">
>     <java classname="${class}"/>
> </target>
> <target name="run-a">
>     <antcall target="-run">
>         
>     </antcall>
> </target>
> ...
> 
> 
> Jan
> 
> 
> 
> 
>>-----Ursprüngliche Nachricht-----
>>Von: hezjing [mailto:hezjing@gmail.com] 
>>Gesendet: Mittwoch, 8. August 2007 12:08
>>An: ant-users
>>Betreff: Call a target with parameter?
>>
>>Hi!
>>
>>My build.xml contains few targets to run different main classes,
>>
>>  <target name="run-a">
>>    <java classname="MyClass" />
>>  </target>
>>  <target name="run-b">
>>    <java classname="YourClass" />
>>  </target>
>>  <target name="run-c">
>>    <java classname="HisClass" />
>>  </target>
>>
>>
>>Can I simplify this by defining one target with <java> and the common
>>classpath and system properties configuration, and then call this
>>target with different class names?
>>
>>
>>-- 
>>
>>Hez
>>
>>---------------------------------------------------------------------
>>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://www.nabble.com/Call-a-target-with-parameter--tp12050352p21610285.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: AW: Call a target with parameter?

Posted by norken76 <na...@yahoo.com>.
sorry, that <call> is under entelope package, but ant-contrib also provide a
similar one <runtarget>

thanks



Scot P. Floess-2 wrote:
> 
> 
> Sorry just trying to understand the problem...and find a fix :)
> 
> On Thu, 22 Jan 2009, Scot P. Floess wrote:
> 
>>
>> Right...gotcha...
>>
>> But...what library are you using for call?  If it is available in Ant 
>> Contrib...what version?
>>
>> On Thu, 22 Jan 2009, norken76 wrote:
>>
>>> 
>>> I know that it works with <antcall> and I mentioned that, but I want to
>>> use
>>> <call> OR <runtarget> that do not create a new project like <antcall>
>>> 
>>> 
>>> thanks
>>> 
>>> 
>>> Scot P. Floess-2 wrote:
>>>> 
>>>> 
>>>> Hold on...I just used your snippet...
>>>> 
>>>> First...are you using antcall???  If not, I dont think ant contrib is
>>>> giving you unset nor call...at least not the version I am using
>>>> 
>>>> Anyway, it seems to have worked for me...
>>>> 
>>>> Here is my output:
>>>>
>>>>       [echo] current package :
>>>> /home/sfloess/development/keros/trunk/folder/alpha.zip
>>>>       [echo] Running test2 . package is :
>>>> /home/sfloess/development/keros/trunk/folder/alpha.zip..
>>>>       [echo] current package :
>>>> /home/sfloess/development/keros/trunk/folder/bar.zip
>>>>       [echo] Running test2 . package is :
>>>> /home/sfloess/development/keros/trunk/folder/bar.zip..
>>>>       [echo] current package :
>>>> /home/sfloess/development/keros/trunk/folder/foo.zip
>>>>       [echo] Running test2 . package is :
>>>> /home/sfloess/development/keros/trunk/folder/foo.zip..
>>>> 
>>>> Here is the code I have in place:
>>>> 
>>>> <target name="forTest">
>>>>      <ant-contrib:for param="package">
>>>>          <path>
>>>>              <fileset dir="folder" includes="*.zip"/>
>>>>          </path>
>>>>
>>>>          <sequential>
>>>>              <echo message="current package : @{package} "/>
>>>>              <ant-contrib:var name="myVar" value="@{package}"/>
>>>>              <echo message="my var is  : ${myVar} "/>
>>>>              <antcall target="runtargetTest2"/>
>>>>          </sequential>
>>>>      </ant-contrib:for>
>>>> </target>
>>>> 
>>>> <target name="runtargetTest2">
>>>>      <echo message="Running test2 . package is : ${myVar}.."/>
>>>> </target>
>>>> 
>>>> I think the difference is I am using antcall... Again unfamliar with
>>>> unset
>>>> and call...
>>>> 
>>>> On Thu, 22 Jan 2009, norken76 wrote:
>>>> 
>>>>> 
>>>>> 
>>>>> NO. that doesn't work either,
>>>>> 
>>>>> thanks
>>>>> 
>>>>> 
>>>>> Scot P. Floess-2 wrote:
>>>>>> 
>>>>>> 
>>>>>> Sorry type-o on my end...
>>>>>> 
>>>>>> I am unfamiliar with <unset> - that's from ant contrib????
>>>>>> 
>>>>>> That is strange...the unset I mean not working...
>>>>>> 
>>>>>> How about trying
>>>>>> 
>>>>>> <var name="myVar" unset="true" value="@{package}"/>
>>>>>> 
>>>>>> On Thu, 22 Jan 2009, norken76 wrote:
>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> <unset> does not support 'unset' attribute, unset itself is to unset
>>>>>>> a
>>>>>>> variable.
>>>>>>> 
>>>>>>> I have even tried : <var name="myVar" unset="true"/>
>>>>>>> but still no luck. it looks like the variable get's stuck somewhere
>>>>>>> only
>>>>>>> for
>>>>>>> the called target :)
>>>>>>> 
>>>>>>> thanks
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> Scot P. Floess-2 wrote:
>>>>>>>> 
>>>>>>>> 
>>>>>>>> How about,
>>>>>>>> 
>>>>>>>> <unset  name = "myVar"  unset = "true"/>
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On Thu, 22 Jan 2009, norken76 wrote:
>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> sure here it is :
>>>>>>>>> 
>>>>>>>>> <!-- the 'myVar' variable gets the right value inside the
>>>>>>>>> sequential
>>>>>>>>> tag,
>>>>>>>>> but not in the called target.
>>>>>>>>> it keeps always the same value in there despite the 'unset' ??? 
>>>>>>>>> -->
>>>>>>>>>
>>>>>>>>>       <target name="forTest">
>>>>>>>>> 		<for param="package">
>>>>>>>>> 		   <path>
>>>>>>>>> 		     <fileset dir="folder" includes="*.zip"/>
>>>>>>>>> 		   </path>
>>>>>>>>>
>>>>>>>>> 		   <sequential>
>>>>>>>>> 				<echo message="current package : 
>>>>>>>>> @{package} "/>
>>>>>>>>> 				<var name="myVar" 
>>>>>>>>> value="@{package}"/>
>>>>>>>>> 				<echo message="my var is  : ${myVar} 
>>>>>>>>> "/>
>>>>>>>>> 				<call target="runtargetTest2"/>
>>>>>>>>> 				<unset name="myVar"/>
>>>>>>>>> 		   </sequential>
>>>>>>>>> 		 </for>
>>>>>>>>> 	</target>
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>>
>>>>>>>>> 	<target name="runtargetTest2">
>>>>>>>>>
>>>>>>>>> 		<echo message="Running test2 . package is : 
>>>>>>>>> ${myVar}.."/>
>>>>>>>>>
>>>>>>>>> 	</target>
>>>>>>>>> 
>>>>>>>>> thank you
>>>>>>>>> 
>>>>>>>>> --
>>>>>>>>> View this message in context:
>>>>>>>>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21610828.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
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>> 
>>>>>>>> Scot P. Floess
>>>>>>>> 27 Lake Royale
>>>>>>>> Louisburg, NC  27549
>>>>>>>> 
>>>>>>>> 252-478-8087 (Home)
>>>>>>>> 919-754-4592 (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
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21611257.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
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> Scot P. Floess
>>>>>> 27 Lake Royale
>>>>>> Louisburg, NC  27549
>>>>>> 
>>>>>> 252-478-8087 (Home)
>>>>>> 919-754-4592 (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
>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21611690.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
>>>>> 
>>>>> 
>>>> 
>>>> Scot P. Floess
>>>> 27 Lake Royale
>>>> Louisburg, NC  27549
>>>> 
>>>> 252-478-8087 (Home)
>>>> 919-754-4592 (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
>>>> 
>>>> 
>>>> 
>>> 
>>> -- 
>>> View this message in context: 
>>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21613517.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
>>> 
>>> 
>>
>> Scot P. Floess
>> 27 Lake Royale
>> Louisburg, NC  27549
>>
>> 252-478-8087 (Home)
>> 919-754-4592 (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
>>
>>
> 
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC  27549
> 
> 252-478-8087 (Home)
> 919-754-4592 (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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21617178.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: AW: Call a target with parameter?

Posted by "Scot P. Floess" <sf...@nc.rr.com>.
Sorry just trying to understand the problem...and find a fix :)

On Thu, 22 Jan 2009, Scot P. Floess wrote:

>
> Right...gotcha...
>
> But...what library are you using for call?  If it is available in Ant 
> Contrib...what version?
>
> On Thu, 22 Jan 2009, norken76 wrote:
>
>> 
>> I know that it works with <antcall> and I mentioned that, but I want to use
>> <call> OR <runtarget> that do not create a new project like <antcall>
>> 
>> 
>> thanks
>> 
>> 
>> Scot P. Floess-2 wrote:
>>> 
>>> 
>>> Hold on...I just used your snippet...
>>> 
>>> First...are you using antcall???  If not, I dont think ant contrib is
>>> giving you unset nor call...at least not the version I am using
>>> 
>>> Anyway, it seems to have worked for me...
>>> 
>>> Here is my output:
>>>
>>>       [echo] current package :
>>> /home/sfloess/development/keros/trunk/folder/alpha.zip
>>>       [echo] Running test2 . package is :
>>> /home/sfloess/development/keros/trunk/folder/alpha.zip..
>>>       [echo] current package :
>>> /home/sfloess/development/keros/trunk/folder/bar.zip
>>>       [echo] Running test2 . package is :
>>> /home/sfloess/development/keros/trunk/folder/bar.zip..
>>>       [echo] current package :
>>> /home/sfloess/development/keros/trunk/folder/foo.zip
>>>       [echo] Running test2 . package is :
>>> /home/sfloess/development/keros/trunk/folder/foo.zip..
>>> 
>>> Here is the code I have in place:
>>> 
>>> <target name="forTest">
>>>      <ant-contrib:for param="package">
>>>          <path>
>>>              <fileset dir="folder" includes="*.zip"/>
>>>          </path>
>>>
>>>          <sequential>
>>>              <echo message="current package : @{package} "/>
>>>              <ant-contrib:var name="myVar" value="@{package}"/>
>>>              <echo message="my var is  : ${myVar} "/>
>>>              <antcall target="runtargetTest2"/>
>>>          </sequential>
>>>      </ant-contrib:for>
>>> </target>
>>> 
>>> <target name="runtargetTest2">
>>>      <echo message="Running test2 . package is : ${myVar}.."/>
>>> </target>
>>> 
>>> I think the difference is I am using antcall... Again unfamliar with unset
>>> and call...
>>> 
>>> On Thu, 22 Jan 2009, norken76 wrote:
>>> 
>>>> 
>>>> 
>>>> NO. that doesn't work either,
>>>> 
>>>> thanks
>>>> 
>>>> 
>>>> Scot P. Floess-2 wrote:
>>>>> 
>>>>> 
>>>>> Sorry type-o on my end...
>>>>> 
>>>>> I am unfamiliar with <unset> - that's from ant contrib????
>>>>> 
>>>>> That is strange...the unset I mean not working...
>>>>> 
>>>>> How about trying
>>>>> 
>>>>> <var name="myVar" unset="true" value="@{package}"/>
>>>>> 
>>>>> On Thu, 22 Jan 2009, norken76 wrote:
>>>>> 
>>>>>> 
>>>>>> 
>>>>>> <unset> does not support 'unset' attribute, unset itself is to unset a
>>>>>> variable.
>>>>>> 
>>>>>> I have even tried : <var name="myVar" unset="true"/>
>>>>>> but still no luck. it looks like the variable get's stuck somewhere
>>>>>> only
>>>>>> for
>>>>>> the called target :)
>>>>>> 
>>>>>> thanks
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> Scot P. Floess-2 wrote:
>>>>>>> 
>>>>>>> 
>>>>>>> How about,
>>>>>>> 
>>>>>>> <unset  name = "myVar"  unset = "true"/>
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> On Thu, 22 Jan 2009, norken76 wrote:
>>>>>>> 
>>>>>>>> 
>>>>>>>> sure here it is :
>>>>>>>> 
>>>>>>>> <!-- the 'myVar' variable gets the right value inside the sequential
>>>>>>>> tag,
>>>>>>>> but not in the called target.
>>>>>>>> it keeps always the same value in there despite the 'unset' ???  -->
>>>>>>>>
>>>>>>>>       <target name="forTest">
>>>>>>>> 		<for param="package">
>>>>>>>> 		   <path>
>>>>>>>> 		     <fileset dir="folder" includes="*.zip"/>
>>>>>>>> 		   </path>
>>>>>>>>
>>>>>>>> 		   <sequential>
>>>>>>>> 				<echo message="current package : 
>>>>>>>> @{package} "/>
>>>>>>>> 				<var name="myVar" 
>>>>>>>> value="@{package}"/>
>>>>>>>> 				<echo message="my var is  : ${myVar} 
>>>>>>>> "/>
>>>>>>>> 				<call target="runtargetTest2"/>
>>>>>>>> 				<unset name="myVar"/>
>>>>>>>> 		   </sequential>
>>>>>>>> 		 </for>
>>>>>>>> 	</target>
>>>>>>>> 
>>>>>>>> 
>>>>>>>>
>>>>>>>> 	<target name="runtargetTest2">
>>>>>>>>
>>>>>>>> 		<echo message="Running test2 . package is : 
>>>>>>>> ${myVar}.."/>
>>>>>>>>
>>>>>>>> 	</target>
>>>>>>>> 
>>>>>>>> thank you
>>>>>>>> 
>>>>>>>> --
>>>>>>>> View this message in context:
>>>>>>>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21610828.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
>>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>>>> Scot P. Floess
>>>>>>> 27 Lake Royale
>>>>>>> Louisburg, NC  27549
>>>>>>> 
>>>>>>> 252-478-8087 (Home)
>>>>>>> 919-754-4592 (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
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21611257.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
>>>>>> 
>>>>>> 
>>>>> 
>>>>> Scot P. Floess
>>>>> 27 Lake Royale
>>>>> Louisburg, NC  27549
>>>>> 
>>>>> 252-478-8087 (Home)
>>>>> 919-754-4592 (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
>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21611690.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
>>>> 
>>>> 
>>> 
>>> Scot P. Floess
>>> 27 Lake Royale
>>> Louisburg, NC  27549
>>> 
>>> 252-478-8087 (Home)
>>> 919-754-4592 (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
>>> 
>>> 
>>> 
>> 
>> -- 
>> View this message in context: 
>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21613517.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
>> 
>> 
>
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC  27549
>
> 252-478-8087 (Home)
> 919-754-4592 (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
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (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: AW: Call a target with parameter?

Posted by "Scot P. Floess" <sf...@nc.rr.com>.
Right...gotcha...

But...what library are you using for call?  If it is available in Ant 
Contrib...what version?

On Thu, 22 Jan 2009, norken76 wrote:

>
> I know that it works with <antcall> and I mentioned that, but I want to use
> <call> OR <runtarget> that do not create a new project like <antcall>
>
>
> thanks
>
>
> Scot P. Floess-2 wrote:
>>
>>
>> Hold on...I just used your snippet...
>>
>> First...are you using antcall???  If not, I dont think ant contrib is
>> giving you unset nor call...at least not the version I am using
>>
>> Anyway, it seems to have worked for me...
>>
>> Here is my output:
>>
>>       [echo] current package :
>> /home/sfloess/development/keros/trunk/folder/alpha.zip
>>       [echo] Running test2 . package is :
>> /home/sfloess/development/keros/trunk/folder/alpha.zip..
>>       [echo] current package :
>> /home/sfloess/development/keros/trunk/folder/bar.zip
>>       [echo] Running test2 . package is :
>> /home/sfloess/development/keros/trunk/folder/bar.zip..
>>       [echo] current package :
>> /home/sfloess/development/keros/trunk/folder/foo.zip
>>       [echo] Running test2 . package is :
>> /home/sfloess/development/keros/trunk/folder/foo.zip..
>>
>> Here is the code I have in place:
>>
>> <target name="forTest">
>>      <ant-contrib:for param="package">
>>          <path>
>>              <fileset dir="folder" includes="*.zip"/>
>>          </path>
>>
>>          <sequential>
>>              <echo message="current package : @{package} "/>
>>              <ant-contrib:var name="myVar" value="@{package}"/>
>>              <echo message="my var is  : ${myVar} "/>
>>              <antcall target="runtargetTest2"/>
>>          </sequential>
>>      </ant-contrib:for>
>> </target>
>>
>> <target name="runtargetTest2">
>>      <echo message="Running test2 . package is : ${myVar}.."/>
>> </target>
>>
>> I think the difference is I am using antcall... Again unfamliar with unset
>> and call...
>>
>> On Thu, 22 Jan 2009, norken76 wrote:
>>
>>>
>>>
>>> NO. that doesn't work either,
>>>
>>> thanks
>>>
>>>
>>> Scot P. Floess-2 wrote:
>>>>
>>>>
>>>> Sorry type-o on my end...
>>>>
>>>> I am unfamiliar with <unset> - that's from ant contrib????
>>>>
>>>> That is strange...the unset I mean not working...
>>>>
>>>> How about trying
>>>>
>>>> <var name="myVar" unset="true" value="@{package}"/>
>>>>
>>>> On Thu, 22 Jan 2009, norken76 wrote:
>>>>
>>>>>
>>>>>
>>>>> <unset> does not support 'unset' attribute, unset itself is to unset a
>>>>> variable.
>>>>>
>>>>> I have even tried : <var name="myVar" unset="true"/>
>>>>> but still no luck. it looks like the variable get's stuck somewhere
>>>>> only
>>>>> for
>>>>> the called target :)
>>>>>
>>>>> thanks
>>>>>
>>>>>
>>>>>
>>>>> Scot P. Floess-2 wrote:
>>>>>>
>>>>>>
>>>>>> How about,
>>>>>>
>>>>>> <unset  name = "myVar"  unset = "true"/>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, 22 Jan 2009, norken76 wrote:
>>>>>>
>>>>>>>
>>>>>>> sure here it is :
>>>>>>>
>>>>>>> <!-- the 'myVar' variable gets the right value inside the sequential
>>>>>>> tag,
>>>>>>> but not in the called target.
>>>>>>> it keeps always the same value in there despite the 'unset' ???  -->
>>>>>>>
>>>>>>>       <target name="forTest">
>>>>>>> 		<for param="package">
>>>>>>> 		   <path>
>>>>>>> 		     <fileset dir="folder" includes="*.zip"/>
>>>>>>> 		   </path>
>>>>>>>
>>>>>>> 		   <sequential>
>>>>>>> 				<echo message="current package : @{package} "/>
>>>>>>> 				<var name="myVar" value="@{package}"/>
>>>>>>> 				<echo message="my var is  : ${myVar} "/>
>>>>>>> 				<call target="runtargetTest2"/>
>>>>>>> 				<unset name="myVar"/>
>>>>>>> 		   </sequential>
>>>>>>> 		 </for>
>>>>>>> 	</target>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 	<target name="runtargetTest2">
>>>>>>>
>>>>>>> 		<echo message="Running test2 . package is : ${myVar}.."/>
>>>>>>>
>>>>>>> 	</target>
>>>>>>>
>>>>>>> thank you
>>>>>>>
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21610828.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
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> Scot P. Floess
>>>>>> 27 Lake Royale
>>>>>> Louisburg, NC  27549
>>>>>>
>>>>>> 252-478-8087 (Home)
>>>>>> 919-754-4592 (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
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21611257.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
>>>>>
>>>>>
>>>>
>>>> Scot P. Floess
>>>> 27 Lake Royale
>>>> Louisburg, NC  27549
>>>>
>>>> 252-478-8087 (Home)
>>>> 919-754-4592 (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
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21611690.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
>>>
>>>
>>
>> Scot P. Floess
>> 27 Lake Royale
>> Louisburg, NC  27549
>>
>> 252-478-8087 (Home)
>> 919-754-4592 (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
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21613517.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
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (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: AW: Call a target with parameter?

Posted by norken76 <na...@yahoo.com>.
I know that it works with <antcall> and I mentioned that, but I want to use
<call> OR <runtarget> that do not create a new project like <antcall>


thanks 


Scot P. Floess-2 wrote:
> 
> 
> Hold on...I just used your snippet...
> 
> First...are you using antcall???  If not, I dont think ant contrib is 
> giving you unset nor call...at least not the version I am using
> 
> Anyway, it seems to have worked for me...
> 
> Here is my output:
> 
>       [echo] current package : 
> /home/sfloess/development/keros/trunk/folder/alpha.zip
>       [echo] Running test2 . package is : 
> /home/sfloess/development/keros/trunk/folder/alpha.zip..
>       [echo] current package : 
> /home/sfloess/development/keros/trunk/folder/bar.zip
>       [echo] Running test2 . package is : 
> /home/sfloess/development/keros/trunk/folder/bar.zip..
>       [echo] current package : 
> /home/sfloess/development/keros/trunk/folder/foo.zip
>       [echo] Running test2 . package is : 
> /home/sfloess/development/keros/trunk/folder/foo.zip..
> 
> Here is the code I have in place:
> 
> <target name="forTest">
>      <ant-contrib:for param="package">
>          <path>
>              <fileset dir="folder" includes="*.zip"/>
>          </path>
> 
>          <sequential>
>              <echo message="current package : @{package} "/>
>              <ant-contrib:var name="myVar" value="@{package}"/>
>              <echo message="my var is  : ${myVar} "/>
>              <antcall target="runtargetTest2"/>
>          </sequential>
>      </ant-contrib:for>
> </target>
> 
> <target name="runtargetTest2">
>      <echo message="Running test2 . package is : ${myVar}.."/>
> </target>
> 
> I think the difference is I am using antcall... Again unfamliar with unset 
> and call...
> 
> On Thu, 22 Jan 2009, norken76 wrote:
> 
>>
>>
>> NO. that doesn't work either,
>>
>> thanks
>>
>>
>> Scot P. Floess-2 wrote:
>>>
>>>
>>> Sorry type-o on my end...
>>>
>>> I am unfamiliar with <unset> - that's from ant contrib????
>>>
>>> That is strange...the unset I mean not working...
>>>
>>> How about trying
>>>
>>> <var name="myVar" unset="true" value="@{package}"/>
>>>
>>> On Thu, 22 Jan 2009, norken76 wrote:
>>>
>>>>
>>>>
>>>> <unset> does not support 'unset' attribute, unset itself is to unset a
>>>> variable.
>>>>
>>>> I have even tried : <var name="myVar" unset="true"/>
>>>> but still no luck. it looks like the variable get's stuck somewhere
>>>> only
>>>> for
>>>> the called target :)
>>>>
>>>> thanks
>>>>
>>>>
>>>>
>>>> Scot P. Floess-2 wrote:
>>>>>
>>>>>
>>>>> How about,
>>>>>
>>>>> <unset  name = "myVar"  unset = "true"/>
>>>>>
>>>>>
>>>>>
>>>>> On Thu, 22 Jan 2009, norken76 wrote:
>>>>>
>>>>>>
>>>>>> sure here it is :
>>>>>>
>>>>>> <!-- the 'myVar' variable gets the right value inside the sequential
>>>>>> tag,
>>>>>> but not in the called target.
>>>>>> it keeps always the same value in there despite the 'unset' ???  -->
>>>>>>
>>>>>>       <target name="forTest">
>>>>>> 		<for param="package">
>>>>>> 		   <path>
>>>>>> 		     <fileset dir="folder" includes="*.zip"/>
>>>>>> 		   </path>
>>>>>>
>>>>>> 		   <sequential>
>>>>>> 				<echo message="current package : @{package} "/>
>>>>>> 				<var name="myVar" value="@{package}"/>
>>>>>> 				<echo message="my var is  : ${myVar} "/>
>>>>>> 				<call target="runtargetTest2"/>
>>>>>> 				<unset name="myVar"/>
>>>>>> 		   </sequential>
>>>>>> 		 </for>
>>>>>> 	</target>
>>>>>>
>>>>>>
>>>>>>
>>>>>> 	<target name="runtargetTest2">
>>>>>>
>>>>>> 		<echo message="Running test2 . package is : ${myVar}.."/>
>>>>>>
>>>>>> 	</target>
>>>>>>
>>>>>> thank you
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21610828.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
>>>>>>
>>>>>>
>>>>>
>>>>> Scot P. Floess
>>>>> 27 Lake Royale
>>>>> Louisburg, NC  27549
>>>>>
>>>>> 252-478-8087 (Home)
>>>>> 919-754-4592 (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
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21611257.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
>>>>
>>>>
>>>
>>> Scot P. Floess
>>> 27 Lake Royale
>>> Louisburg, NC  27549
>>>
>>> 252-478-8087 (Home)
>>> 919-754-4592 (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
>>>
>>>
>>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21611690.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
>>
>>
> 
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC  27549
> 
> 252-478-8087 (Home)
> 919-754-4592 (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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21613517.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: AW: Call a target with parameter?

Posted by "Scot P. Floess" <sf...@nc.rr.com>.
Hold on...I just used your snippet...

First...are you using antcall???  If not, I dont think ant contrib is 
giving you unset nor call...at least not the version I am using

Anyway, it seems to have worked for me...

Here is my output:

      [echo] current package : 
/home/sfloess/development/keros/trunk/folder/alpha.zip
      [echo] Running test2 . package is : 
/home/sfloess/development/keros/trunk/folder/alpha.zip..
      [echo] current package : 
/home/sfloess/development/keros/trunk/folder/bar.zip
      [echo] Running test2 . package is : 
/home/sfloess/development/keros/trunk/folder/bar.zip..
      [echo] current package : 
/home/sfloess/development/keros/trunk/folder/foo.zip
      [echo] Running test2 . package is : 
/home/sfloess/development/keros/trunk/folder/foo.zip..

Here is the code I have in place:

<target name="forTest">
     <ant-contrib:for param="package">
         <path>
             <fileset dir="folder" includes="*.zip"/>
         </path>

         <sequential>
             <echo message="current package : @{package} "/>
             <ant-contrib:var name="myVar" value="@{package}"/>
             <echo message="my var is  : ${myVar} "/>
             <antcall target="runtargetTest2"/>
         </sequential>
     </ant-contrib:for>
</target>

<target name="runtargetTest2">
     <echo message="Running test2 . package is : ${myVar}.."/>
</target>

I think the difference is I am using antcall... Again unfamliar with unset 
and call...

On Thu, 22 Jan 2009, norken76 wrote:

>
>
> NO. that doesn't work either,
>
> thanks
>
>
> Scot P. Floess-2 wrote:
>>
>>
>> Sorry type-o on my end...
>>
>> I am unfamiliar with <unset> - that's from ant contrib????
>>
>> That is strange...the unset I mean not working...
>>
>> How about trying
>>
>> <var name="myVar" unset="true" value="@{package}"/>
>>
>> On Thu, 22 Jan 2009, norken76 wrote:
>>
>>>
>>>
>>> <unset> does not support 'unset' attribute, unset itself is to unset a
>>> variable.
>>>
>>> I have even tried : <var name="myVar" unset="true"/>
>>> but still no luck. it looks like the variable get's stuck somewhere only
>>> for
>>> the called target :)
>>>
>>> thanks
>>>
>>>
>>>
>>> Scot P. Floess-2 wrote:
>>>>
>>>>
>>>> How about,
>>>>
>>>> <unset  name = "myVar"  unset = "true"/>
>>>>
>>>>
>>>>
>>>> On Thu, 22 Jan 2009, norken76 wrote:
>>>>
>>>>>
>>>>> sure here it is :
>>>>>
>>>>> <!-- the 'myVar' variable gets the right value inside the sequential
>>>>> tag,
>>>>> but not in the called target.
>>>>> it keeps always the same value in there despite the 'unset' ???  -->
>>>>>
>>>>>       <target name="forTest">
>>>>> 		<for param="package">
>>>>> 		   <path>
>>>>> 		     <fileset dir="folder" includes="*.zip"/>
>>>>> 		   </path>
>>>>>
>>>>> 		   <sequential>
>>>>> 				<echo message="current package : @{package} "/>
>>>>> 				<var name="myVar" value="@{package}"/>
>>>>> 				<echo message="my var is  : ${myVar} "/>
>>>>> 				<call target="runtargetTest2"/>
>>>>> 				<unset name="myVar"/>
>>>>> 		   </sequential>
>>>>> 		 </for>
>>>>> 	</target>
>>>>>
>>>>>
>>>>>
>>>>> 	<target name="runtargetTest2">
>>>>>
>>>>> 		<echo message="Running test2 . package is : ${myVar}.."/>
>>>>>
>>>>> 	</target>
>>>>>
>>>>> thank you
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21610828.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
>>>>>
>>>>>
>>>>
>>>> Scot P. Floess
>>>> 27 Lake Royale
>>>> Louisburg, NC  27549
>>>>
>>>> 252-478-8087 (Home)
>>>> 919-754-4592 (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
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21611257.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
>>>
>>>
>>
>> Scot P. Floess
>> 27 Lake Royale
>> Louisburg, NC  27549
>>
>> 252-478-8087 (Home)
>> 919-754-4592 (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
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21611690.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
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (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: AW: Call a target with parameter?

Posted by norken76 <na...@yahoo.com>.

NO. that doesn't work either,

thanks


Scot P. Floess-2 wrote:
> 
> 
> Sorry type-o on my end...
> 
> I am unfamiliar with <unset> - that's from ant contrib????
> 
> That is strange...the unset I mean not working...
> 
> How about trying
> 
> <var name="myVar" unset="true" value="@{package}"/>
> 
> On Thu, 22 Jan 2009, norken76 wrote:
> 
>>
>>
>> <unset> does not support 'unset' attribute, unset itself is to unset a
>> variable.
>>
>> I have even tried : <var name="myVar" unset="true"/>
>> but still no luck. it looks like the variable get's stuck somewhere only
>> for
>> the called target :)
>>
>> thanks
>>
>>
>>
>> Scot P. Floess-2 wrote:
>>>
>>>
>>> How about,
>>>
>>> <unset  name = "myVar"  unset = "true"/>
>>>
>>>
>>>
>>> On Thu, 22 Jan 2009, norken76 wrote:
>>>
>>>>
>>>> sure here it is :
>>>>
>>>> <!-- the 'myVar' variable gets the right value inside the sequential
>>>> tag,
>>>> but not in the called target.
>>>> it keeps always the same value in there despite the 'unset' ???  -->
>>>>
>>>>       <target name="forTest">
>>>> 		<for param="package">
>>>> 		   <path>
>>>> 		     <fileset dir="folder" includes="*.zip"/>
>>>> 		   </path>
>>>>
>>>> 		   <sequential>
>>>> 				<echo message="current package : @{package} "/>
>>>> 				<var name="myVar" value="@{package}"/>
>>>> 				<echo message="my var is  : ${myVar} "/>
>>>> 				<call target="runtargetTest2"/>
>>>> 				<unset name="myVar"/>
>>>> 		   </sequential>
>>>> 		 </for>
>>>> 	</target>
>>>>
>>>>
>>>>
>>>> 	<target name="runtargetTest2">
>>>>
>>>> 		<echo message="Running test2 . package is : ${myVar}.."/>
>>>>
>>>> 	</target>
>>>>
>>>> thank you
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21610828.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
>>>>
>>>>
>>>
>>> Scot P. Floess
>>> 27 Lake Royale
>>> Louisburg, NC  27549
>>>
>>> 252-478-8087 (Home)
>>> 919-754-4592 (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
>>>
>>>
>>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21611257.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
>>
>>
> 
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC  27549
> 
> 252-478-8087 (Home)
> 919-754-4592 (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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21611690.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: AW: Call a target with parameter?

Posted by "Scot P. Floess" <sf...@nc.rr.com>.
Sorry type-o on my end...

I am unfamiliar with <unset> - that's from ant contrib????

That is strange...the unset I mean not working...

How about trying

<var name="myVar" unset="true" value="@{package}"/>

On Thu, 22 Jan 2009, norken76 wrote:

>
>
> <unset> does not support 'unset' attribute, unset itself is to unset a
> variable.
>
> I have even tried : <var name="myVar" unset="true"/>
> but still no luck. it looks like the variable get's stuck somewhere only for
> the called target :)
>
> thanks
>
>
>
> Scot P. Floess-2 wrote:
>>
>>
>> How about,
>>
>> <unset  name = "myVar"  unset = "true"/>
>>
>>
>>
>> On Thu, 22 Jan 2009, norken76 wrote:
>>
>>>
>>> sure here it is :
>>>
>>> <!-- the 'myVar' variable gets the right value inside the sequential tag,
>>> but not in the called target.
>>> it keeps always the same value in there despite the 'unset' ???  -->
>>>
>>>       <target name="forTest">
>>> 		<for param="package">
>>> 		   <path>
>>> 		     <fileset dir="folder" includes="*.zip"/>
>>> 		   </path>
>>>
>>> 		   <sequential>
>>> 				<echo message="current package : @{package} "/>
>>> 				<var name="myVar" value="@{package}"/>
>>> 				<echo message="my var is  : ${myVar} "/>
>>> 				<call target="runtargetTest2"/>
>>> 				<unset name="myVar"/>
>>> 		   </sequential>
>>> 		 </for>
>>> 	</target>
>>>
>>>
>>>
>>> 	<target name="runtargetTest2">
>>>
>>> 		<echo message="Running test2 . package is : ${myVar}.."/>
>>>
>>> 	</target>
>>>
>>> thank you
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21610828.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
>>>
>>>
>>
>> Scot P. Floess
>> 27 Lake Royale
>> Louisburg, NC  27549
>>
>> 252-478-8087 (Home)
>> 919-754-4592 (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
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21611257.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
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (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: AW: Call a target with parameter?

Posted by norken76 <na...@yahoo.com>.

<unset> does not support 'unset' attribute, unset itself is to unset a
variable.

I have even tried : <var name="myVar" unset="true"/>
but still no luck. it looks like the variable get's stuck somewhere only for
the called target :)

thanks



Scot P. Floess-2 wrote:
> 
> 
> How about,
> 
> <unset  name = "myVar"  unset = "true"/>
> 
> 
> 
> On Thu, 22 Jan 2009, norken76 wrote:
> 
>>
>> sure here it is :
>>
>> <!-- the 'myVar' variable gets the right value inside the sequential tag,
>> but not in the called target.
>> it keeps always the same value in there despite the 'unset' ???  -->
>>
>>       <target name="forTest">
>> 		<for param="package">
>> 		   <path>
>> 		     <fileset dir="folder" includes="*.zip"/>
>> 		   </path>
>>
>> 		   <sequential>
>> 				<echo message="current package : @{package} "/>
>> 				<var name="myVar" value="@{package}"/>
>> 				<echo message="my var is  : ${myVar} "/>
>> 				<call target="runtargetTest2"/>
>> 				<unset name="myVar"/>
>> 		   </sequential>
>> 		 </for>
>> 	</target>
>>
>>
>>
>> 	<target name="runtargetTest2">
>>
>> 		<echo message="Running test2 . package is : ${myVar}.."/>
>>
>> 	</target>
>>
>> thank you
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21610828.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
>>
>>
> 
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC  27549
> 
> 252-478-8087 (Home)
> 919-754-4592 (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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21611257.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: AW: Call a target with parameter?

Posted by "Scot P. Floess" <sf...@nc.rr.com>.
How about,

<unset  name = "myVar"  unset = "true"/>



On Thu, 22 Jan 2009, norken76 wrote:

>
> sure here it is :
>
> <!-- the 'myVar' variable gets the right value inside the sequential tag,
> but not in the called target.
> it keeps always the same value in there despite the 'unset' ???  -->
>
>       <target name="forTest">
> 		<for param="package">
> 		   <path>
> 		     <fileset dir="folder" includes="*.zip"/>
> 		   </path>
>
> 		   <sequential>
> 				<echo message="current package : @{package} "/>
> 				<var name="myVar" value="@{package}"/>
> 				<echo message="my var is  : ${myVar} "/>
> 				<call target="runtargetTest2"/>
> 				<unset name="myVar"/>
> 		   </sequential>
> 		 </for>
> 	</target>
>
>
>
> 	<target name="runtargetTest2">
>
> 		<echo message="Running test2 . package is : ${myVar}.."/>
>
> 	</target>
>
> thank you
>
> -- 
> View this message in context: http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21610828.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
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (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: AW: Call a target with parameter?

Posted by norken76 <na...@yahoo.com>.
sure here it is :

<!-- the 'myVar' variable gets the right value inside the sequential tag,
but not in the called target.
 it keeps always the same value in there despite the 'unset' ???  -->

       <target name="forTest">
		<for param="package">
		   <path>
		     <fileset dir="folder" includes="*.zip"/>
		   </path>

		   <sequential>
				<echo message="current package : @{package} "/>
				<var name="myVar" value="@{package}"/>
				<echo message="my var is  : ${myVar} "/>
				<call target="runtargetTest2"/>
				<unset name="myVar"/>
		   </sequential>
		 </for>
	</target>

	

	<target name="runtargetTest2">
		
		<echo message="Running test2 . package is : ${myVar}.."/>
		
	</target>

thank you

-- 
View this message in context: http://www.nabble.com/Call-a-target-with-parameter--tp12050352p21610828.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: AW: Call a target with parameter?

Posted by "Scot P. Floess" <sf...@nc.rr.com>.
Can we see an example of your code?

On Thu, 22 Jan 2009, norken76 wrote:

>
> yes, but as I mentioned, I need to use the ant-contrib 'calltarget' because I
> do not want to create a new project as is the case with 'antcall'.
> the reason is because I run the project remotly, so the file and the path
> are not available to create a new project.
>
> I've tried may things. no success.
>
> thank you
>
>
>
> Blaine Simpson wrote:
>>
>> You don't need ant-contrib for this.  Just use antcall with nested param
>> elements.
>>
>> norken76 wrote:
>>> Hi there,
>>> Has anyone tried to pass in params to a called target via 'calltarget' of
>>> antcontrib (without creating new project) OR maybe a different way to
>>> achieve this goal (pass param to a called target without creating new
>>> project) I've tried using <variable> (set and unset after the target is
>>> called) but no success, the called target sees always the first value of
>>> that variable
>>>
>>> thank you
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> 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://www.nabble.com/Call-a-target-with-parameter--tp12050352p21610591.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
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (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: AW: Call a target with parameter?

Posted by norken76 <na...@yahoo.com>.
yes, but as I mentioned, I need to use the ant-contrib 'calltarget' because I
do not want to create a new project as is the case with 'antcall'.
the reason is because I run the project remotly, so the file and the path
are not available to create a new project.

I've tried may things. no success.

thank you



Blaine Simpson wrote:
> 
> You don't need ant-contrib for this.  Just use antcall with nested param
> elements.
> 
> norken76 wrote:
>> Hi there,
>> Has anyone tried to pass in params to a called target via 'calltarget' of
>> antcontrib (without creating new project) OR maybe a different way to
>> achieve this goal (pass param to a called target without creating new
>> project) I've tried using <variable> (set and unset after the target is
>> called) but no success, the called target sees always the first value of
>> that variable
>>
>> thank you
>>
>>
>>   
> 
> ---------------------------------------------------------------------
> 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://www.nabble.com/Call-a-target-with-parameter--tp12050352p21610591.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: AW: Call a target with parameter?

Posted by Blaine Simpson <bl...@admc.com>.
You don't need ant-contrib for this.  Just use antcall with nested param
elements.

norken76 wrote:
> Hi there,
> Has anyone tried to pass in params to a called target via 'calltarget' of
> antcontrib (without creating new project) OR maybe a different way to
> achieve this goal (pass param to a called target without creating new
> project) I've tried using <variable> (set and unset after the target is
> called) but no success, the called target sees always the first value of
> that variable
>
> thank you
>
>
>   

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