hamad32
hamad32

Reputation: 197

how to use excludesfile/includesfile in ant zip task

I need to specify a list of specific files to exclud but when I try something like excludesfile="file1, file2" I get an error executing the task saying:

C:\Users.....\Desktop\testProject\project.build.xml:49: Excludesfile C:\Users......\Desktop\testProject\file1, file2 not found.

Here is my code:

<target name="jar" depends="common.jar">
    <zip 
        destfile="${jar.build.dir}/some-jar.jar"
        basedir="${base.dir}"
        includes="src/**,gradle/**"
        excludesfile="file1,file2">
    </zip>
</target>

Upvotes: 0

Views: 722

Answers (1)

copeg
copeg

Reputation: 8348

excludesfile is used to specify a file containing a List of files to exclude in the zip process (each on a separate line). To specify the list as comma (or space) separated files, use the excludes Parameter. eg:

excludes="file1,file2"

Upvotes: 1

Related Questions