0

I want to exclude some format files like PDB, XML and BMP files in my zip package.

Please help me on this http://cakebuild.net/api/Cake.Common.IO/ZipAliases/B6C83EAE.

vijay
  • 701
  • 2
  • 12
  • 26

2 Answers2

2

Note the built in Zip aliases will only create a standard Zip file not 7zip, if it's only assemblies you want to include in your archive you can use the Zip(DirectoryPath rootPath, FilePath outputPath, string pattern) overload.

Example usage:

 Zip("./", "dllfiles.zip", "./*.dll");

If you have several different file types, then I would recommend you create a directory with the artifacts you want to archive and then just zip that directory.

devlead
  • 4,935
  • 15
  • 36
1

Another way is to use linq in the cakebuild, script. Something along these lines:

var ignoredExts = new string[] { ".bmp", ".xml", ".pdb" };
var files = GetFiles("./bin/Release/*.*")
    .Where(f => !ignoredExts.Contains(f.GetExtension().ToLower()));
Zip("./", "cakeassemblies.zip", files);
redsolo
  • 528
  • 6
  • 13