Freigeben über


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="https://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

  • Anonymous
    July 19, 2010
    Mister, how can I zip a allcomplete folder ?? thanks