Skip to content

Instantly share code, notes, and snippets.

@RhysC
Created December 15, 2010 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RhysC/742251 to your computer and use it in GitHub Desktop.
Save RhysC/742251 to your computer and use it in GitHub Desktop.
Dummy MSBuild "CheckIn Dance" File
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="CheckinDance" ToolsVersion="3.5" >
<UsingTask TaskName="MSBuild.Community.Tasks.NUnit" AssemblyFile="..\Tools\MSBuildCommunityTasks\MSBuild.Community.Tasks.dll" />
<PropertyGroup>
<SolutionFile>.\MySoln.sln</SolutionFile>
<UiTestSln>.\MySoln.UI.Tests.sln</UiTestSln>
<OutputPath Condition="'$(OutputPath)' == ''">.\Bin\</OutputPath>
<NUnitPath>..\Tools\NUnit-2.5.2\</NUnitPath>
<StatLightPath>..\Tools\StatLight\StatLight.exe</StatLightPath>
<CR>%0D</CR>
<LF>%0A</LF>
<NL>$(CR)$(LF)</NL>
</PropertyGroup>
<Target Name="CheckinDance">
<CallTarget Targets="GetLatest" />
<CallTarget Targets="AllTests"/>
<CallTarget Targets="CommitChanges"/>
</Target>
<!-- SVN Tasks -->
<Target Name="GetLatest">
<Message Text="$(NL)Begining GetLatest..."/>
<Exec Command='TortoiseProc.exe /command:update /path:"..\\" /closeonend:2' ContinueOnError='true'>
<Output TaskParameter="ExitCode" PropertyName="ExitCode"/>
</Exec>
<Message Text='****ExitCode = $(ExitCode)'/>
<Error Text="CommitChanges failed" Condition="'$(ExitCode)' != 0" />
<Message Text='Finished Getting Latest from SVN'/>
</Target>
<Target Name="CommitChanges" >
<Message Text="$(NL)Begining CommitChanges..."/>
<Exec Command='TortoiseProc.exe /command:commit /path:"..\\" /closeonend:0'>
<Output TaskParameter="ExitCode" PropertyName="ExitCode"/>
</Exec>
<Error Text="CommitChanges failed" Condition="'$(ExitCode)' != 0" />
<Message Text='Finished Committing to SVN'/>
</Target>
<!-- Build Tasks -->
<Target Name="Clean">
<MSBuild Targets="Clean" Projects="$(SolutionFile)"/>
</Target>
<Target Name="Build" DependsOnTargets="Clean;" >
<MSBuild Targets="Build"
Projects="$(SolutionFile)"
Properties="Configuration=Debug;"
StopOnFirstFailure="true"
ContinueOnError="false" />
</Target>
<Target Name="PatchDatabase" DependsOnTargets="Build">
<Message Text="$(NL)Patching the databases" />
<ItemGroup>
<DatabaseProjects Include=".\MySoln.Database\MySoln.Database.dbproj" />
</ItemGroup>
<Message Text="Patching the databases"/>
<MSBuild Targets="Deploy"
Projects="@(DatabaseProjects)"
Properties="Configuration=Debug;"
StopOnFirstFailure="true"
ContinueOnError="false" />
</Target>
<!-- Tests -->
<Target Name="AllTests" DependsOnTargets="SilverLightTests;UnitTests;IntegrationTests" >
<Message Text="$(NL)********* Tests completed *********" />
</Target>
<Target Name="UnitTests" DependsOnTargets="Build">
<ItemGroup>
<UnitTestAssemblies Include=".\$(OutputPath)MySoln.Client.Tests.dll" />
<UnitTestAssemblies Include=".\$(OutputPath)MySoln.Server.Tests.dll" />
</ItemGroup>
<NUnit Assemblies="@(UnitTestAssemblies)" ToolPath="$(NUnitPath)" />
</Target>
<Target Name="SilverLightTests" DependsOnTargets="Build;" >
<MSBuild Targets="Rebuild" Projects="$(UiTestSln)" Properties="Configuration=Debug;" />
<Exec Command="&quot;$(StatLightPath)&quot; -x=&quot;Bin\Silverlight\MySoln.Client.Tests.xap&quot;" />
</Target>
<Target Name="IntegrationTests" DependsOnTargets="Build;PatchDatabase" >
<ItemGroup>
<IntegrationTestAssemblies Include=".\$(OutputPath)MySoln.Tests.Database.dll" />
<IntegrationTestAssemblies Include=".\$(OutputPath)MySoln.Tests.Messaging.dll" />
</ItemGroup>
<NUnit Assemblies="@(IntegrationTestAssemblies)" ToolPath="$(NUnitPath)" />
</Target>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment