We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Could be interesting and useful to have something along these lines:
<!-- defines the Zip task --> <UsingTask TaskName="Zip" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> <ParameterGroup> <InputFileNames ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" /> <OutputFileName ParameterType="System.String" Required="true" /> <OverwriteExistingFile ParameterType="System.Boolean" Required="false" /> </ParameterGroup> <Task> <Reference Include="System.IO.Compression" /> <Using Namespace="System.IO.Compression" /> <Code Type="Fragment" Language="cs"> <![CDATA[ const int BufferSize = 64 * 1024; var buffer = new byte[BufferSize]; var fileMode = OverwriteExistingFile ? FileMode.Create : FileMode.CreateNew; using (var outputFileStream = new FileStream(OutputFileName, fileMode)) { using (var archive = new ZipArchive(outputFileStream, ZipArchiveMode.Create)) { foreach (var inputFileName in InputFileNames.Select(f => f.ItemSpec)) { var archiveEntry = archive.CreateEntry(Path.GetFileName(inputFileName)); using (var fs = new FileStream(inputFileName, FileMode.Open)) { using (var zipStream = archiveEntry.Open()) { int bytesRead = -1; while ((bytesRead = fs.Read(buffer, 0, BufferSize)) > 0) { zipStream.Write(buffer, 0, bytesRead); } } } } } } ]]> </Code> </Task> </UsingTask>
à la msbuild
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Could be interesting and useful to have something along these lines:
à la msbuild
The text was updated successfully, but these errors were encountered: