You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by paul collins <pa...@gmail.com> on 2009/09/25 10:51:40 UTC

Replace value of a parameter

I want to pass a parameter value from one property file to another one, they
both have the same name so for example I have file A with the parameter
build=0999

and other file B with a number of paramters but the one I want to replace is
build
build=0998

So how do do I take the value of build in file A and replace the value of
build in file B.
The values are changing constantly so the values are wildcard

Thanks

Re: Replace value of a parameter

Posted by paul collins <pa...@gmail.com>.
That wokred so ignore my question on defining the file outside the target.
What I do notice is that the original file B had a number of lines in it
which were comments for example see below, is ther any way of keeping these
comments in the file?
###############################################################################
#   Edit this file before doing a release.
#   When finished changes, simply save and close to resume build process


On Fri, Sep 25, 2009 at 10:35 AM, paul collins <
paul.pcollins.collins@gmail.com> wrote:

> I have not tried this yet but how come property file A is defined out side
> the target something should not be inside it?
>
>
>
> On Fri, Sep 25, 2009 at 10:13 AM, Francis GALIEGUE <fg...@one2team.com>wrote:
>
>>  On Fri, Sep 25, 2009 at 10:51, paul collins
>> <pa...@gmail.com> wrote:
>> > I want to pass a parameter value from one property file to another one,
>> they
>> > both have the same name so for example I have file A with the parameter
>> > build=0999
>> >
>> > and other file B with a number of paramters but the one I want to
>> replace is
>> > build
>> > build=0998
>> >
>> > So how do do I take the value of build in file A and replace the value
>> of
>> > build in file B.
>> > The values are changing constantly so the values are wildcard
>> >
>> > Thanks
>> >
>>
>> <property file="A"/>
>>
>> <target name="something">
>>    <propertyfile file="B">
>>        <entry key="build" value="${build}" operation="="/>
>>    </propertyfile>
>> </target>
>>
>> Note that operation="=" is the default.
>>
>>
>>
>> --
>>
>> Francis Galiegue
>> ONE2TEAM
>> Ingénieur système
>> Mob : +33 (0) 683 877 875
>> Tel : +33 (0) 178 945 552
>> fge@one2team.com
>> 40 avenue Raymond Poincaré
>> 75116 Paris
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>

Re: Replace value of a parameter

Posted by paul collins <pa...@gmail.com>.
I have not tried this yet but how come property file A is defined out side
the target something should not be inside it?



On Fri, Sep 25, 2009 at 10:13 AM, Francis GALIEGUE <fg...@one2team.com> wrote:

>  On Fri, Sep 25, 2009 at 10:51, paul collins
> <pa...@gmail.com> wrote:
> > I want to pass a parameter value from one property file to another one,
> they
> > both have the same name so for example I have file A with the parameter
> > build=0999
> >
> > and other file B with a number of paramters but the one I want to replace
> is
> > build
> > build=0998
> >
> > So how do do I take the value of build in file A and replace the value of
> > build in file B.
> > The values are changing constantly so the values are wildcard
> >
> > Thanks
> >
>
> <property file="A"/>
>
> <target name="something">
>    <propertyfile file="B">
>        <entry key="build" value="${build}" operation="="/>
>    </propertyfile>
> </target>
>
> Note that operation="=" is the default.
>
>
>
> --
>
> Francis Galiegue
> ONE2TEAM
> Ingénieur système
> Mob : +33 (0) 683 877 875
> Tel : +33 (0) 178 945 552
> fge@one2team.com
> 40 avenue Raymond Poincaré
> 75116 Paris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Re: Replace value of a parameter

Posted by Francis GALIEGUE <fg...@one2team.com>.
On Fri, Sep 25, 2009 at 10:51, paul collins
<pa...@gmail.com> wrote:
> I want to pass a parameter value from one property file to another one, they
> both have the same name so for example I have file A with the parameter
> build=0999
>
> and other file B with a number of paramters but the one I want to replace is
> build
> build=0998
>
> So how do do I take the value of build in file A and replace the value of
> build in file B.
> The values are changing constantly so the values are wildcard
>
> Thanks
>

<property file="A"/>

<target name="something">
    <propertyfile file="B">
        <entry key="build" value="${build}" operation="="/>
    </propertyfile>
</target>

Note that operation="=" is the default.



-- 

Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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