MSBuild tasks si Poor man backup

M-am tot uitat in ultimul timp la MSBUILD
Interesant si extensibil…
Din fericire , exista o sumedenie de taskuri msbuild cu care poti face (aproape) tot ceea ce vrei

Ceea ce vroiam sa fac era doar o zip-uire a solutiei la fiecare compilare.

La http://msbuildtasks.tigris.org/ am gasit (printre multe altele)  task-uri de zip-uit, ca si task de obtinut data si timpul

Asa ca solutia a fost sa le combin … si am reusit sa introduc in proiect asa ceva:

<Target Name=”AfterBuild”>
        <Time Format=”yyyyMMdd_HHmmss”>
            <Output TaskParameter=”FormattedTime” PropertyName=”FormattedTime”  />
        </Time>
        <ItemGroup>
            <ZipFiles Include=”$(SolutionDir)**\*.*” Exclude=”$(SolutionName)*.zip” />
        </ItemGroup>

        <Zip Files=”@(ZipFiles)” ZipFileName=”$(SolutionName)_$(FormattedTime).zip”  />
        <MakeDir Directories=”$(SolutionDir)..\Zips”  ></MakeDir>
        <Move SourceFiles=”$(SolutionName)_$(FormattedTime).zip” DestinationFolder=”$(SolutionDir)..\Zips”></Move>

    </Target>

Practic, daca aveti o structura in care solutia(.sln) este intr-un folder , iar celelalte proiecte sunt in sub-folder-e dedesubtul solutiei, adaugati in care proiect vreti codul de mai sus si va aparea , dupa fiecare compilare, un folder zips cu solutia si subfolder-ele zip-uite…

Incerc sa fac o enumerare rapida de task-uri MSBuild, in ideea ca poate cautati ceva si nu vreti sa reinventati roata:
   

MSBuild Windows PE Tasks – Home
http://www.codeplex.com/msbuildwinpe

MSBuild Extras – Toolkit for .NET 1.1 “MSBee” – Home

http://www.codeplex.com/MSBee

Coding Cockerel code samples – Release: Automating the build with MSBuild
http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=codingcockerel&ReleaseId=12739


Download details: Microsoft® Visual Studio Team System 2008 Database Edition Power Tools

http://www.microsoft.com/downloads/details.aspx?FamilyID=73BA5038-8E37-4C8E-812B-DB14EDE2C354&displaylang=en


Peli’s Farm – TaskSchema, a XSD schema generator for MsBuild tasks

http://blog.dotnetwiki.org/TaskSchemaAXSDSchemaGeneratorForMsBuildTasks.aspx


MSBuild Tasks for BizTalk Continuous Integration

http://geekswithblogs.net/paulp/archive/2008/06/09/122746.aspx


CreateGuid MSBuild Task « Grant Holliday

http://ozgrant.com/2008/04/04/createguid-msbuild-task/


How to create a YUI Compressor MSBuild Task – Nick Berardi’s Coder Journal

http://www.coderjournal.com/2008/05/how-to-create-a-yui-compressor-msbuild-task/


CodeProject: Custom MSBuild Tasks: Automated Report and DB Deployment. Free source code and

http://www.codeproject.com/KB/reporting-services/CustomMSBuildTask_RS.aspx

Custom MSBuild Tasks: Automated Report and DB Deployment

SDC Tasks Library – Home
http://www.codeplex.com/sdctasks


How to Write a Custom MSBuild Task : Keyvan Nayyeri

http://nayyeri.net/blog/how-to-write-a-custom-msbuild-task/


Brennan’s Blog » Blog Archive » SubSonic and Automation with MSBuild

http://brennan.offwhite.net/blog/2007/06/10/subsonic-and-automation-with-msbuild/


msbuildtasks.tigris.org

http://msbuildtasks.tigris.org/


Sedodream MSBuild Project – Home
http://www.codeplex.com/Sedodream

Leave a Reply

Your email address will not be published. Required fields are marked *