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: [email protected]
For additional commands, e-mail: [email protected]



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: [email protected]
For additional commands, e-mail: [email protected]




--
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: [email protected]
For additional commands, e-mail: [email protected]



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: [email protected]
For additional commands, e-mail: [email protected]




--
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: [email protected]
For additional commands, e-mail: [email protected]



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: [email protected]
For additional commands, e-mail: [email protected]




--
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: [email protected]
For additional commands, e-mail: [email protected]



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: [email protected]
For additional commands, e-mail: [email protected]



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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to