Search code examples
jenkinsantfileset

How to exclude all sub-folders in the directory using fileset?


I have an ANTScript like:

<fileset dir="${sqlDirectory}" >
    <include name="**/*.sql"/>
    <exclude name="**/back_out/**"/>
</fileset>

I am trying to exclude all sub-folders in the directory. The above code excludes only back_out subfolder.

Is it possible to exclude any sub-folders inside the directory?


Solution

  • Here is the solution which I have found:

    <fileset dir="${sqlDirectory}" >
        <include name="**/*.sql"/>
        <exclude name="*/**/*" />
    </fileset>