ant - Trying to write new properties to a file without a new line for each one -
i using ant propertyfile task in fashion goal of writing out properties file:
<propertyfile file="${file}"> <entry key="${candidate.property}" value="${candidate.value}"/> </propertyfile> the problem writes out successive properties line breaks between them.
there no line breaks in candidate value. problem line breaks appear between properties, so:
first.prop=a second.prop=b third.prop=c i expect there no way around in ant, please correct me if i'm wrong. there standard approach problem?
my default guess should define own ant task in java this.
i've spent several hours today trying want do. here's how solved problem in properties file.
<target name="set-property" depends="apply-existing-value"> <property name="value.to.write" value="${value}"/> <echo file="${file}" append="true">${name}=${value}${line.separator}</echo> </target> forget propertyfile , use echo instead. substitute key , value have ${name} , ${value}. ${line.separator} puts next property on new line no line feed!
Comments
Post a Comment