I have a script that create a tar file using the ant tar task, then another script appends to the tar file but nothing gets appended to the file and I get a message saying "nothing to do <archiveName> is up to date". Here is an example of a script that exhibit the problem. <project default="name"> <target name="name" description="--> description"> <tar destfile="d:/tmp/testOutputFormat/f.tar" > <tarfileset file="d:/tmp/productBuild.zip" fullpath="foo/productBuild.zip" /> </tar> <tar destfile="d:/tmp/testOutputFormat/f.tar" > <tarfileset file="d:/tmp/test.psf" fullpath="foo/test.psf" /> </tar> </target> </project>
Please note the tar task creates a tar file, it does not append to an existing tar file. The existing tar file is replaced instead. As with all archive tasks in ant, the destination archive is not updated if it is known to be newer than all the resources to be included in the archive. probably the following is what you try to achieve: <project default="name"> <target name="name" description="--> description"> <tar destfile="d:/tmp/testOutputFormat/f.tar" > <tarfileset file="d:/tmp/productBuild.zip" fullpath="foo/productBuild.zip" /> <tarfileset file="d:/tmp/test.psf" fullpath="foo/test.psf" /> </tar> </target> </project> If you really want to produce two diffent tar files with the same name, you will have to remove or rename the first tar file before trying to create the second one.
It seems to me that your 1st and 3rd sentences are contradicting each others. If the 3rd one is true, then the tar task has a bug since it does not comply to the behaviour described, which is the point of my bug. If the first one is true, then your third sentence is a lie :) I think that if you are striving for consistency, then I should be able to append to a Tar like I can do it to a zip with the zip task. This could be done by adding an "append" parameter to the task. As for the workaround, it does not work in my case since the appendage to the zip file is done in a separate build script.
Added clarifiation to tar manual page, changing this to an enchancement request.
Setting mode="update" in the compress antlib's tar task should do what is requested.