You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by NR031 <na...@cognizant.com> on 2009/03/24 11:21:14 UTC

How to combine the values of 2 property files and putting into another property name

Hi,

  I have created 2 property files:

test1.properties :
Project1-URL=http://localhost:9080/dummyURL1
Project2-URL=http://localhost:9080/dummyURL2

test2.properties :
name1=Project1
name2=Project2

and the ant target is :

<target name="nestfile">
    <property file="test1.properties"/>
    <property file="test2.properties"/>
    <property name="project-URL" value="${${name1}-URL}">
    <echo>For Below tag I should get the
http://localhost:9080/dummyURL1</echo>
    <echo>${project-URL}</echo>
</target>


       when I run the above target I should get the
http://localhost:9080/dummyURL1 in the command line, but currently I am
getting the error. What is the sysntax for doing this?

Please help me out.

Thanks in advance,
-- 
View this message in context: http://www.nabble.com/How-to-combine-the-values-of-2-property-files-and-putting-into-another-property-name-tp22677473p22677473.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: How to combine the values of 2 property files and putting into another property name

Posted by Gilbert Rebhan <an...@schillbaer.de>.
Gilbert Rebhan schrieb:
> Gilbert Rebhan schrieb:
>> David Weintraub schrieb:
>>> On Tue, Mar 24, 2009 at 6:21 AM, NR031 <na...@cognizant.com> wrote:
>>>>    <property name="project-URL" value="${${name1}-URL}">
>>> That doesn't work. See:
>>> http://ant.apache.org/faq.html#propertyvalue-as-name-for-property
>> [...]
>>
>> you may try the <var> task from antcontrib,
>> i believe the variable task from antelope will work too.
>>
>> see=
>> http://marc.info/?l=ant-user&m=121318477419672&w=2
> 
> P.S. :
> 
> there's also a solution from the ant faq you might consider
> if you don't already use antcontrib | antelope, see =
> 
> http://ant.apache.org/faq.html#propertyvalue-as-name-for-property

P.S. again ;-)

finally with <script language="ruby|groovy|javascript|beanshell ...>
you push the boundary of 'normal' task usage, as you have all
the features of a real scripting language at your fingertips and
full access to the ant api.


Regards,Gilbert



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


Re: How to combine the values of 2 property files and putting into another property name

Posted by Gilbert Rebhan <an...@schillbaer.de>.
Gilbert Rebhan schrieb:
> David Weintraub schrieb:
>> On Tue, Mar 24, 2009 at 6:21 AM, NR031 <na...@cognizant.com> wrote:
>>>    <property name="project-URL" value="${${name1}-URL}">
>> That doesn't work. See:
>> http://ant.apache.org/faq.html#propertyvalue-as-name-for-property
> [...]
> 
> you may try the <var> task from antcontrib,
> i believe the variable task from antelope will work too.
> 
> see=
> http://marc.info/?l=ant-user&m=121318477419672&w=2

P.S. :

there's also a solution from the ant faq you might consider
if you don't already use antcontrib | antelope, see =

http://ant.apache.org/faq.html#propertyvalue-as-name-for-property


Regards,Gilbert



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


Re: How to combine the values of 2 property files and putting into another property name

Posted by Gilbert Rebhan <an...@schillbaer.de>.
David Weintraub schrieb:
> On Tue, Mar 24, 2009 at 6:21 AM, NR031 <na...@cognizant.com> wrote:
>>    <property name="project-URL" value="${${name1}-URL}">
> 
> That doesn't work. See:
> http://ant.apache.org/faq.html#propertyvalue-as-name-for-property
[...]

you may try the <var> task from antcontrib,
i believe the variable task from antelope will work too.

see=
http://marc.info/?l=ant-user&m=121318477419672&w=2


Regards,Gilbert




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


Re: How to combine the values of 2 property files and putting into another property name

Posted by David Weintraub <qa...@gmail.com>.
On Tue, Mar 24, 2009 at 6:21 AM, NR031 <na...@cognizant.com> wrote:
>    <property name="project-URL" value="${${name1}-URL}">

That doesn't work. See:
http://ant.apache.org/faq.html#propertyvalue-as-name-for-property


On Tue, Mar 24, 2009 at 6:21 AM, NR031 <na...@cognizant.com> wrote:
>
> Hi,
>
>  I have created 2 property files:
>
> test1.properties :
> Project1-URL=http://localhost:9080/dummyURL1
> Project2-URL=http://localhost:9080/dummyURL2
>
> test2.properties :
> name1=Project1
> name2=Project2
>
> and the ant target is :
>
> <target name="nestfile">
>    <property file="test1.properties"/>
>    <property file="test2.properties"/>
>    <property name="project-URL" value="${${name1}-URL}">
>    <echo>For Below tag I should get the
> http://localhost:9080/dummyURL1</echo>
>    <echo>${project-URL}</echo>
> </target>
>
>
>       when I run the above target I should get the
> http://localhost:9080/dummyURL1 in the command line, but currently I am
> getting the error. What is the sysntax for doing this?
>
> Please help me out.
>
> Thanks in advance,
> --
> View this message in context: http://www.nabble.com/How-to-combine-the-values-of-2-property-files-and-putting-into-another-property-name-tp22677473p22677473.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