开发者

How to write a variable in to file in ant?

开发者 https://www.devze.com 2023-02-04 19:19 出处:网络
i have a variable abc and had the value this is ant script. This abc variable 开发者_Go百科will keep on changing.

i have a variable abc and had the value this is ant script. This abc variable 开发者_Go百科will keep on changing.

Using ANT script, how can i write the value out to the file?


The echo task in ANT is able to write to files

<echo file="output.txt" append="true">
   abc=${abc}
</echo>


Use propertyfile task. An example taken from ant manual:

<propertyfile file="my.properties">
  <entry  key="abc" value="${abc}"/>
</propertyfile>

This may be better than echo as it updates the properties file with a given value, while echo appends to or overwrites the whole file.

0

精彩评论

暂无评论...
验证码 换一张
取 消