Msbuild Archive Files Unique Zip file Name



this Explains how to use Msbuild to zip some log files. the zipfilename is generated from date time information, hence unique. 


<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets ="ZipLogs">


<Import Project="c:\sdc\Microsoft.Sdc.Common.Tasks" />


<PropertyGroup >


<MsgFailed>Failed Email for </MsgFailed>


<BuildLogZip>buildlogs.zip </BuildLogZip>


</PropertyGroup>


<Target Name="ZipLogs" >


<Time.GetTime Format="yyyyMMMdd-hh-mm" >


<Output TaskParameter="Time" PropertyName="ResultsItem" />


</Time.GetTime>


<Message Text="$(ResultsItem)" ></Message>


<Zip.AddFile


pathToZipFile="$(ResultsItem)$(BuildLogZip)"


pathToFile="Summary1.log" />


<Zip.AddFile


pathToZipFile="$(ResultsItem)$(BuildLogZip)"


pathToFile="Build.Log" />



</Target>


</Project>

Comments (1)
  1. kiquenet says:

    Mister, how can I zip a allcomplete folder ?? thanks

Comments are closed.

Skip to main content