New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a task to zip / unzip files #1781
Comments
There is a reaoson why the task is in the file called "common.tasks": https://github.com/moozzyk/MSBuild-Tasks/blob/master/common.tasks |
Setting this up-for-grabs. This is something we would accept but not prioritizing right now. |
I'll have a look at this over the next few days. |
Has this already been done and merged? |
FYI - we needed zip/unzip tasks to build ASP.NET Core so we wrote our own tasks. They're good enough for us. They need more thorough testing, but you might be able to use these as a springboard for an official MSbuild version. https://github.com/aspnet/BuildTools/blob/dev/src/Internal.AspNetCore.BuildTools.Tasks/UnzipArchive.cs |
Thanks @natemcmaster I'm going to hold off looking at this until I get more familiar with the code base and just keep chipping away at little things. |
`ZipDirectory` task zips up a whole directory. It will fail if the destination file already exists. Zipping individual files is a lot harder because you have to calculated a base path for all files and make zip entries relative to that. The code in the CLR that does this is very efficient by reusing string buffers and I didn't want to have to replicate the code. So for now there's only `ZipDirectory` instead of a more generic `Zip`. `Unzip` unzips files from an archive to a directory. * Defaults to skip unzipping files that are already up-to-date * Logs every file that was unzipped * Supports cancellation * Supports overwriting read-only files * Supports unzipping multiple files to the same directory Fixes #1781
Awesome, thanks @jeffkl ! |
MSBuild from VS2022 only remains |
Producing zip archives is a very common build step. Would be nice to have a built-in msbuild task that does this.
The text was updated successfully, but these errors were encountered: