Q:

How do I append a line to a file unzipped by Ant?

I have a default log4j properties file to which I want to append an application specific configuration. The file is contained (with other files) within a .zip file. I use Ant to unzip the contents of the zip (including the log4j properties). I want to append the line when the unzip happens. Is this possible?
<unzip dest="some.dest">
    <fileset refid="some.fileset" />
    <!-- Append a line to 'log4j.properties` file -->
</unzip>

Maybe the solution is just to echo after I've unzipped.

A:

You can use the Ant "echo" task with the "append" flag:
<echo file="log4j.properties" append="true">${line.separator}</echo>

Echo task doc here for further reference:
http://ant.apache.org/manual/Tasks/echo.html

