1 / 8

Tools of the Trade

Tools of the Trade. using msbuild to automate packaging Nick Airdo Software Engineer Central Christian Church Email: nick.airdo@cccev.com Twitter: @ airdo Tweet using #RefreshCache. Monkey Tasks. Kill the monkey. Visual Studio Project. Unload Edit. the . csproj. < Project > .

dextra
Download Presentation

Tools of the Trade

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tools of the Trade using msbuild to automate packaging Nick Airdo Software Engineer Central Christian Church Email: nick.airdo@cccev.com Twitter: @airdo Tweet using #RefreshCache

  2. Monkey Tasks Kill the monkey

  3. Visual Studio Project Unload Edit

  4. the .csproj <Project> . . . <ImportProject="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" /> <PropertyGroup> <BuildDir>builds</BuildDir> </PropertyGroup> <TargetName="AfterBuild" DependsOnTargets="BuildPackageZip"> </Target> <!-- Clean old stuff --> <TargetName="DeleteFiles"> <ItemGroup> <OldFilesInclude="$(BuildDir)\tmp\**" /> </ItemGroup> <DeleteFiles="@(OldFiles)" /> </Target> Import Target Clean

  5. Continued… … <!-- Prepare the files to be zipped --> <TargetName="CopyFiles" DependsOnTargets="DeleteFiles"> <ItemGroup> <CopyFilesInclude="*.cs" Exclude="MetricsByZip.cs;ArenaFamilySplitter.cs" /> <CopyFilesInclude="$(OutputPath)Arena.Custom.Cccev.Accountability.dll" /> <CopyFilesInclude="$(OutputPath)Arena.Custom.Cccev.AgentWorkers.dll" /> </ItemGroup> <ItemGroup> <SqlFilesInclude="Helpers\SQL\*“ /> </ItemGroup> <MakeDirDirectories="$(BuildDir)\tmp" Condition="!Exists('$(BuildDir)\tmp')" /> <MakeDirDirectories="$(BuildDir)\tmp\required-SQL" Condition="!Exists('$(BuildDir)\tmp\required-SQL')" /> <CopySourceFiles="@(CopyFiles)" DestinationFolder="$(BuildDir)\tmp" /> <CopySourceFiles="@(SqlFiles)" DestinationFolder="$(BuildDir)\tmp\required-SQL" /> </Target> … Copy

  6. Continued… <!-- Create the package zip file --> <TargetName="BuildPackageZip" DependsOnTargets="CopyFiles“ Condition="'$(Configuration)' == 'Release'"> <ItemGroup> <ZipFilesInclude="$(BuildDir)\tmp\**" /> </ItemGroup> <VersionBuildType="Automatic" RevisionType="Automatic" Major="2009" Minor="1“> <OutputTaskParameter="Major" PropertyName="Major" /> <OutputTaskParameter="Minor" PropertyName="Minor" /> <OutputTaskParameter="Build" PropertyName="Build" /> <OutputTaskParameter="Revision" PropertyName="Revision" /> </Version> <ZipFiles="@(ZipFiles)" WorkingDirectory="$(BuildDir)\tmp\" ZipFileName="$(BuildDir)\Arena.Custom.Cccev.AgentWorkers-$(Major).$(Minor).$(Build).$(Revision).zip" ZipLevel="9" /> </Target> . . . </Project> Condition Version Zip

  7. command line msbuild Arena.Custom.Cccev.AgentWorkers.csproj /property:Configuration=Release

  8. Get Free Tasks MSBuild.Community.Taskshttp://msbuildtasks.tigris.org/ MSBuild Extension Packhttp://msbuildextensionpack.codeplex.com/

More Related