Creating a tar with Ant and the "includesfile" parameter
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Tricia_Ball
Posted On:   Monday, March 14, 2005 01:00 PM

I have an Ant script which is sitting on a remote server whose purpose is to create a tar. The file names to be tarred are manually listed in a file that will be uploaded to that server, and the name of that file will be listed in the "includesfile" parameter of the Ant tar task. There is an Ant script on my local machine which manages all of this. Occasionally the file containing the file names will be blank because nothing needs to be tarred, and I have learned the hard way, that if this is the case, all files in the base directory get tarred, and then later un-tarred, which can cause some problems. As far as I can tell, the "excludes" parameter of the tar tag trumps the "includesfile" parameter, so I can't exclude everything   More>>


I have an Ant script which is sitting on a remote server whose purpose is to create a tar. The file names to be tarred are manually listed in a file that will be uploaded to that server, and the name of that file will be listed in the "includesfile" parameter of the Ant tar task. There is an Ant script on my local machine which manages all of this. Occasionally the file containing the file names will be blank because nothing needs to be tarred, and I have learned the hard way, that if this is the case, all files in the base directory get tarred, and then later un-tarred, which can cause some problems. As far as I can tell, the "excludes" parameter of the tar tag trumps the "includesfile" parameter, so I can't exclude everything except what is in the given file. Is there a "clean" way to handle the blank includesfile situation?



Thanks so much for your input!

Java Trish

   <<Less

Re: Creating a tar with Ant and the "includesfile" parameter

Posted By:   Roseanne_Zhang  
Posted On:   Friday, March 18, 2005 08:33 PM

Write a small ant task to check the file, if empty, delete it, and make your tar conditional depends the file exists or not.

Just a suggestion, you have many ways to do it.
About | Sitemap | Contact