You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by kleinfisch <kl...@gmx.net> on 2009/07/09 09:44:01 UTC

for task inside path task

example:
i have a property as following defined:
<property name="reference" value="ref1,ref2,ref3"/>
the count of value is dynamic.
the question is: how can i define the refid inside path with for task:
- Test 1:
<path id="build.path">
   <for list="${reference}" param="ref">
      <sequential>
         <path refid="@{ref}">
      </sequential>
   </for>
</path>
Result: failed, because "path" doesn't support the nested "for" element.

- Test 2:
<for list="${reference}" param="ref">
   <path id="build.path">
      <sequential>
         <path refid="@{ref}">
      </sequential>
   </path>
</for>
Result: only last value of "reference" is defined always, because the recent
value of "reference" is always replaced by the next value of "reference".

Has anybody else an idea, "path" task with a loop definition?
-- 
View this message in context: http://www.nabble.com/for-task-inside-path-task-tp24405629p24405629.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: ****SPAM**** for task inside path task

Posted by kleinfisch <kl...@gmx.net>.
by this solution the definition of build.path is no problem any more, but the
reference of the contents of build.path has an error:

Error Message:
This data type contains a circular reference.


Knuplesch, Juergen wrote:
> 
>  Hello,
> 
> Maybe ANT this way:
> 
>   <path id="build.path2">
>          <path refid="emptypath">
>    </path>
> 
> <for list="${reference}" param="ref">
>    <sequential>
>    <path id="build.path">
>          <path refid="build.path2">
>          <path refid="@{ref}">
>    </path>
> 
>    <path id="build.path2">
>          <path refid="build.path">
>    </path>
> 
>    </sequential>
> </for>
> 
> 
> -- 
> Jürgen Knuplesch  
> -----Ursprüngliche Nachricht-----
> Von: kleinfisch [mailto:kleinfisch@gmx.net] 
> Gesendet: Donnerstag, 9. Juli 2009 09:44
> An: user@ant.apache.org
> Betreff: ****SPAM**** for task inside path task
> 
> 
> example:
> i have a property as following defined:
> <property name="reference" value="ref1,ref2,ref3"/> the count of value is
> dynamic.
> the question is: how can i define the refid inside path with for task:
> - Test 1:
> <path id="build.path">
>    <for list="${reference}" param="ref">
>       <sequential>
>          <path refid="@{ref}">
>       </sequential>
>    </for>
> </path>
> Result: failed, because "path" doesn't support the nested "for" element.
> 
> - Test 2:
> <for list="${reference}" param="ref">
>    <path id="build.path">
>       <sequential>
>          <path refid="@{ref}">
>       </sequential>
>    </path>
> </for>
> Result: only last value of "reference" is defined always, because the
> recent value of "reference" is always replaced by the next value of
> "reference".
> 
> Has anybody else an idea, "path" task with a loop definition?
> --
> View this message in context:
> http://www.nabble.com/for-task-inside-path-task-tp24405629p24405629.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://www.nabble.com/for-task-inside-path-task-tp24405629p24406833.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


AW: ****SPAM**** for task inside path task

Posted by "Knuplesch, Juergen" <Ju...@icongmbh.de>.
 Hello,

Maybe ANT this way:

  <path id="build.path2">
         <path refid="emptypath">
   </path>

<for list="${reference}" param="ref">
   <sequential>
   <path id="build.path">
         <path refid="build.path2">
         <path refid="@{ref}">
   </path>

   <path id="build.path2">
         <path refid="build.path">
   </path>

   </sequential>
</for>


-- 
Jürgen Knuplesch  
-----Ursprüngliche Nachricht-----
Von: kleinfisch [mailto:kleinfisch@gmx.net] 
Gesendet: Donnerstag, 9. Juli 2009 09:44
An: user@ant.apache.org
Betreff: ****SPAM**** for task inside path task


example:
i have a property as following defined:
<property name="reference" value="ref1,ref2,ref3"/> the count of value is dynamic.
the question is: how can i define the refid inside path with for task:
- Test 1:
<path id="build.path">
   <for list="${reference}" param="ref">
      <sequential>
         <path refid="@{ref}">
      </sequential>
   </for>
</path>
Result: failed, because "path" doesn't support the nested "for" element.

- Test 2:
<for list="${reference}" param="ref">
   <path id="build.path">
      <sequential>
         <path refid="@{ref}">
      </sequential>
   </path>
</for>
Result: only last value of "reference" is defined always, because the recent value of "reference" is always replaced by the next value of "reference".

Has anybody else an idea, "path" task with a loop definition?
--
View this message in context: http://www.nabble.com/for-task-inside-path-task-tp24405629p24405629.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: for task inside path task

Posted by Roland Brassous <r....@akka.eu>.
Hi

We use a property file named build.properties.
This file stores some properties.
    # /Sample line in the build.propertes/
    servlet.jar=build/lib/Tomcat5.0/servlet-api.jar
    jsp-api.jar=build/lib/Tomcat5.0/jsp-api.jar

In the main file (build.xml), we reference the build.properties
/    <!-- reference to the build.properties -->/
    <property file="${user.home}/build.properties" />

/    <!-- Sample usage of properties// -->/
        <pathelement location="${servlet.jar}"/>
        <pathelement location="${jsp-api.jar}"/>

Each team member can customize the build.properties file, in this case 
the build.xml is never changed.

++
Roland


kleinfisch a écrit :
> correct!!
>
>
> David Weintraub wrote:
>   
>> Just to understand what you're trying to do:
>>
>> You have various references to paths. There could be one or more of
>> these references. What you want is a combined path of all of these
>> references. Is that correct?
>>
>> On Thu, Jul 9, 2009 at 3:44 AM, kleinfisch<kl...@gmx.net> wrote:
>>     
>>> example:
>>> i have a property as following defined:
>>> <property name="reference" value="ref1,ref2,ref3"/>
>>> the count of value is dynamic.
>>> the question is: how can i define the refid inside path with for task:
>>> - Test 1:
>>> <path id="build.path">
>>>   <for list="${reference}" param="ref">
>>>      <sequential>
>>>         <path refid="@{ref}">
>>>      </sequential>
>>>   </for>
>>> </path>
>>> Result: failed, because "path" doesn't support the nested "for" element.
>>>
>>> - Test 2:
>>> <for list="${reference}" param="ref">
>>>   <path id="build.path">
>>>      <sequential>
>>>         <path refid="@{ref}">
>>>      </sequential>
>>>   </path>
>>> </for>
>>> Result: only last value of "reference" is defined always, because the
>>> recent
>>> value of "reference" is always replaced by the next value of "reference".
>>>
>>> Has anybody else an idea, "path" task with a loop definition?
>>> --
>>> View this message in context:
>>> http://www.nabble.com/for-task-inside-path-task-tp24405629p24405629.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
>>>
>>>
>>>       
>>
>> -- 
>> David Weintraub
>> qazwart@gmail.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>>
>>     
>
>   

-- 
Groupe AKKA Technologies 	*AKKA Informatique & Systèmes Sud
Roland BRASSOUS */Project Leader/
6 rue Roger Camboulives - BP 13633 - 31036 TOULOUSE Cedex 1
Mobile : 06.70.29.54.43
Tél : 05 34 61 92 78
Site : www.akka.eu
Email : r.brassous@akka.eu


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


Re: for task inside path task

Posted by kleinfisch <kl...@gmx.net>.
correct!!


David Weintraub wrote:
> 
> Just to understand what you're trying to do:
> 
> You have various references to paths. There could be one or more of
> these references. What you want is a combined path of all of these
> references. Is that correct?
> 
> On Thu, Jul 9, 2009 at 3:44 AM, kleinfisch<kl...@gmx.net> wrote:
>>
>> example:
>> i have a property as following defined:
>> <property name="reference" value="ref1,ref2,ref3"/>
>> the count of value is dynamic.
>> the question is: how can i define the refid inside path with for task:
>> - Test 1:
>> <path id="build.path">
>>   <for list="${reference}" param="ref">
>>      <sequential>
>>         <path refid="@{ref}">
>>      </sequential>
>>   </for>
>> </path>
>> Result: failed, because "path" doesn't support the nested "for" element.
>>
>> - Test 2:
>> <for list="${reference}" param="ref">
>>   <path id="build.path">
>>      <sequential>
>>         <path refid="@{ref}">
>>      </sequential>
>>   </path>
>> </for>
>> Result: only last value of "reference" is defined always, because the
>> recent
>> value of "reference" is always replaced by the next value of "reference".
>>
>> Has anybody else an idea, "path" task with a loop definition?
>> --
>> View this message in context:
>> http://www.nabble.com/for-task-inside-path-task-tp24405629p24405629.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
>>
>>
> 
> 
> 
> -- 
> David Weintraub
> qazwart@gmail.com
> 
> ---------------------------------------------------------------------
> 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/for-task-inside-path-task-tp24405629p24531190.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: for task inside path task

Posted by David Weintraub <qa...@gmail.com>.
Just to understand what you're trying to do:

You have various references to paths. There could be one or more of
these references. What you want is a combined path of all of these
references. Is that correct?

On Thu, Jul 9, 2009 at 3:44 AM, kleinfisch<kl...@gmx.net> wrote:
>
> example:
> i have a property as following defined:
> <property name="reference" value="ref1,ref2,ref3"/>
> the count of value is dynamic.
> the question is: how can i define the refid inside path with for task:
> - Test 1:
> <path id="build.path">
>   <for list="${reference}" param="ref">
>      <sequential>
>         <path refid="@{ref}">
>      </sequential>
>   </for>
> </path>
> Result: failed, because "path" doesn't support the nested "for" element.
>
> - Test 2:
> <for list="${reference}" param="ref">
>   <path id="build.path">
>      <sequential>
>         <path refid="@{ref}">
>      </sequential>
>   </path>
> </for>
> Result: only last value of "reference" is defined always, because the recent
> value of "reference" is always replaced by the next value of "reference".
>
> Has anybody else an idea, "path" task with a loop definition?
> --
> View this message in context: http://www.nabble.com/for-task-inside-path-task-tp24405629p24405629.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
>
>



-- 
David Weintraub
qazwart@gmail.com

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


Re: for task inside path task

Posted by kleinfisch <kl...@gmx.net>.
clever idea, but as testing the following "echo" is used for listing the
contents of build.path, and an error 
<!-- to list the contents of build.path(or build.path2 with
refid="build.path2") -->
<property name="classpath.contents" refid="build.path"/>
<echo>classpath.contents=${classpath.contents}</echo>

ERROR:
This data type contains a circular reference.

-- 
View this message in context: http://www.nabble.com/for-task-inside-path-task-tp24405629p24406623.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