I can zip an explicit list of folders like this:
<ItemGroup>
<Folder Include="Foo\**\*.*"><Name>Foo</Name></Folder>
<Folder Include="Bar\**\*.*"><Name>Bar</Name></Folder>
</ItemGroup>
<Zip
ZipFileName="%(Folder.Name).zip"
WorkingDirectory="%(Folder.Name)\"
Files="@(Folder)" />
This creates two zip files Foo.zip
and Bar.zip
, one for each folder Foo\
and Bar\
.
How can I do this for all existing folders? (Without listing each folder explicitly. When a new folder New\
is created, a zip file New.zip
should be created automatically without changing the MSBuild file.)
(I'm using the Zip task from the MSBuild.Community.Tasks)