Malcolm
Malcolm

Reputation: 1807

Command which gives to create a zip folder to desired destination in msbuild

Want a command which gives to create a zip folder to desired destination in msbuild. PLease Help its urgent..

For more clarification of my question :

I have to include this ZIP task in to my build, where ever the developer pulls my code and builds it , how can i include these task into his machine , is there any other way ? is there a way that we can include the Community dll and refer in the msbuild.

THANKS IN ADVANCE ..:)

Upvotes: 1

Views: 299

Answers (2)

Julien Hoarau
Julien Hoarau

Reputation: 50000

Use the Zip task from MSBuild Community Task.

In your project file, add (and adapt) the following code snippet:

<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>

<PropertyGroup>
  <FolderToZip>C:\Source_folder<FolderToZip>
  <DesiredDestination>C:\Destination_Folder</DesiredDestination>
</PropertyGroup>

<ItemGroup>
  <ZipFiles Include="$(FolderToZip)\**\*.*"/>
</ItemGroup>

<Target Name="Zip">
  <Zip Files="@(ZipFiles)" 
    ZipFileName="$(DesiredDestination)\Archive.zip" />
</Target>

Upvotes: 1

Cheeso
Cheeso

Reputation: 192657

THERE'S AN MSBUILD COMMUNITY TASKS PROJECT THAT INCLUDES A ZIP CAPABILITY. http://www.bing.com/search?q=msbuild+community+zip&form=QBRE&qs=n&sk

Upvotes: 1

Related Questions