Search This Blog

ANT: how to append some text to a file

  • To append plain text:
    <echo file="file.txt" append="true">Hello World</echo>
  • To append HTML or XML, you need escape it using CDATA:
    <echo file="file.txt" append="true">
    <![CDATA[
      <h1>Hello World</h1>
    ]]>
    </echo>

No comments:

Post a Comment