I need to package results of the build to the ZIP file. Options:
- Zip task from MSBuild Community Tasks Project
- 7z.exe or something else in source control
- Custom task
- Code task
The MSBuild Community Tasks Zip task requires tasks lib to be included before build. This actually means that you cannot download it from build script. They have Nuget Package, but if you use package restore you are out of lack.
Second option is to use one of the zip compression tools. Main problem that you need this exe. So if you do not want it in your source control, you need to download it. You can try chocolatey, but I decided that this is too complicated for me.
Custom task. I think this is joke.
Code task. With UsingTask element you can just code your task with C# directly in MsBuild file. In most case this sounds like an overkill, but anyway I will go with this option.
Zip Task Implementation
You need something to make a zip. You can actually use any library , but I will use one that is shipped with .NET 4.5.
Important, you should have .NET 4.5 installed to make this work.
The following gist is actual implementation.
And it works . Mission complete.