MSBuild tasks si Poor man backup
Va rog sa folositi acest URL NOU
de la
http://serviciipeweb.ro/iafblog/
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:
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
The custom MSBuild task cookbook - B# .NET Blog
http://bartdesmet.net/blogs/bart/archive/2008/02/15/the-custom-msbuild-task-cookbook.aspx
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
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/
Sedodream MSBuild Project - Home
http://www.codeplex.com/Sedodream
Post page: http://serviciipeweb.ro/iafblog/2008/07/16/MSBuild+Tasks+Si+Poor+Man+Backup.aspxLa 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:
Coding Cockerel code samples - Release: Automating the build with MSBuild
http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=codingcockerel&ReleaseId=12739
http://www.code
Download details: Microsoft® Visual Studio Team System 2008 Database Edition Power Tools
http://www.micr
Peli's Farm - TaskSchema, a XSD schema generator for MsBuild tasks
http://blog.dot
MSBuild Tasks for BizTalk Continuous Integration
http://geekswit
The custom MSBuild task cookbook - B# .NET Blog
http://bartdesm
How to create a YUI Compressor MSBuild Task - Nick Berardi's Coder Journal
http://www.code
CodeProject: Custom MSBuild Tasks: Automated Report and DB Deployment. Free source code and
http://www.code
Custom MSBuild Tasks: Automated Report and DB Deployment
How to Write a Custom MSBuild Task : Keyvan Nayyeri
http://nayyeri.
Brennan's Blog » Blog Archive » SubSonic and Automation with MSBuild
http://brennan.
http://www.code
Weblog post by 'admin' on 'MSBuild tasks si Poor man backup'
Categories:programare;MSBuild
0 Comments:
Trimiteți un comentariu
<< Home