Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assign part of target to variable for reuse 1

Status
Not open for further replies.

tcmartin24

Programmer
Feb 8, 2006
2
US
Is there a way to assign part of a target's definition to a variable so it can be reused in other targets? Something like this (but this doesn't work):
--------------------------------------
<property name="mappings">
<otherMapping name="resource" value="com.blah.File"/>
</property>

<target name="myTarget">
<hibernatecfg blah="blah" foo="bar">
${mappings}
</hibernatecfg>
</target>
--------------------------------------
So the text defined in the property "mappings" gets placed where I have the '${mappings}' variable. Notice my use of the <property> element doesn't specify a 'value' attribute because I need the value to be possibly several lines containing quotes and things. Is there some element like 'property' that'll let me do this?

Thanks
 
Thanks Tim. I became more familiar with that task after posting this message. I ended up using the macrodef task to define all my common stuff and it lets me pass in variables and element place-holders.

Thanks for the response,
Terry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top