ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject Substituting the value according to the property name
Date Tue, 14 Feb 2006 10:14:26 GMT

We are replacing the occurrence of a string with another value by
reading a predefined property file as given below.

<property file="${rootdir}/"/>

<target name="editversion">
    <delete file="ems.iap_xml"/>
    <copy file="emsMaster.iap_xml" tofile="ems.iap_xml"/>
    <replace file="ems.iap_xml" token="$$PRODUCT_VERSIONMAJOR$$"

The above file i.e. ems.iap_xml is getting replaced perfectly with the
defined values. 

For example the token $PRODUCT_VERSIONMAJOR$ has been replaced with '1'
after running the above script.(as defined in file)

However, if the user made some changes for the file emsMaster.iap_xml,
the requirement is to bring back the old strings(values) for those
property names. So the script which has been used for replacing back is
as below.

<target name="savepackage" depends="setupedit">
    <delete file="emsMaster.iap_xml"/>
    <copy file="ems.iap_xml" tofile="emsMaster.iap_xml">
	<replace file="emsMaster.iap_xml" token="${ems.versionmajor}"

However, with this script iam facing the problem that what ever the
property values are '1' in the emsMaster.iap_xml it is getting replaced

For example the emsMaster.iap_xml file contains the following entries :

<property name="productVersionMajor">
<property name="imageOption">

In the above script, the requirement is to replace the value of 1 for
the ProductVersionMajor property to $PRODUCT_VERSIONMAJOR$
but not to the imageOption property. How can we achieve this one?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message