Skip to content

Instantly share code, notes, and snippets.

@b-spoked
Created September 16, 2010 10:04
<?xml version="1.0" encoding="utf-8"?>
<Project
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion="2.0">
<!--
We are not using the standard compilation and hooking into the AfterCompile
target and then using the specified list of targets to clean, build and then
copy the build output.
-->
<Target Name="AfterCompile">
<CallTarget Targets="MyBuild" />
</Target>
<Target Name="MyBuild">
<CallTarget Targets="CleanBin" />
<CallTarget Targets="Build" />
<CallTarget Targets="CopyToManagedBinaries" />
</Target>
<!--
Clean
-->
<ItemGroup>
<SolutionBinFiles Include="$(SolutionRoot)\Bin\**\*.*"/>
</ItemGroup>
<Target Name="CleanBin" >
<Delete Files="@(SolutionBinFiles)"/>
</Target>
<!--
Compile - we are calling out to the .NET 4 version of msbuild from either an ealier instance of
Team Foundation Server
-->
<PropertyGroup>
<SolutionFileName>$(SolutionRoot)\YourSolution.sln</SolutionFileName>
<MSBuild4>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe</MSBuild4>
<BuildTarget>/t:Rebuild</BuildTarget>
</PropertyGroup>
<Target Name="Build">
<Exec ContinueOnError="false"
IgnoreExitCode="false"
Command="$(MSBuild4Path) $(SolutionFileName) $(BuildTarget)">
</Exec>
</Target>
<!--
Copy build outout to managed binaries
-->
<Target Name="CopyToManagedBinaries" >
<Exec ContinueOnError="false"
IgnoreExitCode="false"
Command='"Powershell" "$(MyScriptsDirectory)CopyToManagedBinaries.ps1" -managedBinariesPath $(DropLocation)\$(SolutionName)\$(AssemblyVersion)' />
</Target>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment