Append

Task available for testing only.
It has to be improved and may change.

Description

Task to append content to file.
If file not exists, it is created.
File inner text is preprocessed.

Append task parameters

Attribute Description Value Required
file the file to read content from yes, if content is undefined
content the content yes, if file is undefined
tofile the file to append content to yes

Examples


<project name="append task"> 

  <taskdef name="append" 
     classname="net.sourceforge.ant4x.taskdefs.filesystem.AppendTask" 
     classpath="PATH/TO/ant4x.jar"/> 

  <target name="append"> 
    <!-- append content attribute -->
    <append content="MY CONTENT" tofile="/path/to/file" />
    
    <!-- append content file -->
    <append file="/read/from/file" tofile="/path/to/file" />
    
    <!-- append text -->
    <append tofile="/path/to/file">Hello, World!</append>
    
    <!-- preprocess and append text -->
    <!-- // TODO db.name => db_name !!! -->
    <property name="who" value="World"/>
    <append tofile="/path/to/file">Hello, ${who}!</append>
    
  </target> 

                    </project>