Default Excludes a la nAnt

Hi,

Is there a way for me to specify default excludes ( or define it for multiple ItemGroups ) This is so that files like .svn for subversion, _vti*  etc are ignored during processing of lists (especially copy ).

Alternatively is it possible for me to give a set of wild cards in the exclude attribute of Item Group

Thanks,
Hari 


Answer this question

Default Excludes a la nAnt

  • Sundaywork

    The only recognized attribute on ItemGroup is Condition so you can't "exclude" at the ItemGroup level.  So is the idea that you don't want them to appear at all in your item lists -or- you just don't want to perform certain operations on those files   Keep in mind that it is probably more common to just specify the files you need either with a list of full filenames or perhaps by extension (*.c, *.cpp, *.h, *.cs, *.vb, *.resx, etc).  In this scenario you just leave out the files and/or  extensions that you don't want (.svn).  In the case of HTML files you could do this:

    <ItemGroup>
      <Html Include="**\*.html" Exclude="_vti*.html" />

    <!-- or -->

      <Html Include="a.html;b.html;c.html;fold1\d.html;fold2\e.html"/>
    </ItemGroup>

    to scoop up all HTML files under the project dir but exclude those that start with _vti or just explicitly specify the files you want (leaving out the one you don't want).

  • Default Excludes a la nAnt