user3173128
user3173128

Reputation: 11

Ant Dynamic parmeter name

i have tried to find an answer reading some ant-contib posts but couldn't get a good one. on my ant build.xml file i have a dynamic paramter name which changes each build. the parameter name includes version of components for example :

<componentX>.<ComponentVersion>=y

how can i access the value of this parameter in my build.xml file ?

i have tried to read the parameter using this :

${componentX.${ComponentVersion}} but it does not work.

thanks

Upvotes: 1

Views: 708

Answers (1)

user3139488
user3139488

Reputation:

If it is normal ant properties & is set to some value & if you want to get values of concatenated result, then below way would work:

<property name="componentX" value="foo"/>
<property name="ComponentVersion" value="bar"/>

Then outputting like below :

<echo message="${componentX}.${ComponentVersion}"/> <!-- would print foo.bar -->

OR storing in new property like for later use:

<property name="concat.one" value="${componentX}.${ComponentVersion}"/>

Upvotes: 1

Related Questions