File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Ant, Maven and Other Build Tools and the fly likes Excluding a folder in a build file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Excluding a folder in a build file" Watch "Excluding a folder in a build file" New topic

Excluding a folder in a build file

Jeff Perry

Joined: Mar 03, 2010
Posts: 1
I am trying to make my builds complete faster. We have one folder on a number of projects that never changes, but is tremendously large. I want to exclude that folder "Workarea". Here is how I do it now:

<delete dir="${DeployLocation}" verbose="true" if="${directory::exists(DeployLocation)}" />
<mkdir dir="${DeployLocation}"/>
<copy todir="${DeployLocation}" flatten="True">
<include name="${ZipFileName}"/>
<unzip zipfile="${DeployLocation}/${ZipFileName}" todir="${DeployLocation}"/>
<delete file="${DeployLocation}/${ZipFileName}" verbose="true"/>
<delete file="${ZipFileName}" verbose="true" if="${file::exists(ZipFileName)}"/>

This deletes the entire directory then recreates it, copies the zip file with everything, unzips the file and deletes the zip file. I am going to exclude the "Workarea" folder from the zip file and want to leave it there. This way my builds will complete in 10 minutes rather than 30 minutes. I am just not sure how to change the first line of the code to delete everything other than the workarea folder.

Please help.
I agree. Here's the link:
subject: Excluding a folder in a build file
It's not a secret anymore!