Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to exclude directories from a phing copy task

Tags:

task

phing

i have installed Phing 2.4.7.1 on Windows 7 and use the cygwin bash shell

I created a Phing task to copy files to a local directory and compress files, but I try to exclude certain directories without success. copy entire directory

the task is as follows:

<copy todir="${builddir}" includeemptydirs="true" >
    <fileset dir="." defaultexcludes="true">                
         <exclude name="cache/*" />
         <exclude name="build.*" />
         <exclude name="log/*" />
         <exclude name=".git" />
         <exclude name="/data/*" />
         <exclude name="/nbproject" />
         <exclude name="*~" />
    </fileset>
</copy>
like image 268
rkmax Avatar asked Sep 09 '11 15:09

rkmax


2 Answers

Use two * for the subfiles:

<exclude name="cache/**"/>
like image 101
cweiske Avatar answered Oct 11 '22 04:10

cweiske


Well I don't know if it is not just tag for human reading but something like this worked for me:

<fileset dir=".">                           
    <patternset>
        <include name="**/*.*" />
        <exclude name="dist/**" />
    </patternset>
</fileset>
like image 36
slony Avatar answered Oct 11 '22 02:10

slony