Skip to content

Instantly share code, notes, and snippets.

@JasonCozens
Created March 4, 2011 11:08
Show Gist options
  • Save JasonCozens/854473 to your computer and use it in GitHub Desktop.
Save JasonCozens/854473 to your computer and use it in GitHub Desktop.
MSBuild - Target batches and DependsOnTargets
<?xml version="1.0" encoding="utf-8"?>
<Project
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion="4.0"
>
<ItemGroup>
<Binary Include="SrcDir/assembly01.txt" >
<Continuous>true</Continuous>
</Binary>
<Binary Include="SrcDir/assembly02.txt" >
<Continuous>true</Continuous>
<Nightly>true</Nightly>
</Binary>
<Binary Include="SrcDir/assembly03.txt" >
<Nightly>true</Nightly>
</Binary>
</ItemGroup>
<Target Name="Continuous"
DependsOnTargets="
DefineContinuousTests;
RunTests" >
</Target>
<Target Name="Nightly"
DependsOnTargets="
DefineNightlyTests;
RunTests" >
</Target>
<Target Name="DefineContinuousTests" >
<ItemGroup>
<Binary Condition="%(Binary.Continuous) == ''" Remove="%(Binary.Identity)" />
</ItemGroup>
</Target>
<Target Name="DefineNightlyTests" >
<ItemGroup>
<Binary Condition="%(Binary.Nightly) == ''" Remove="%(Binary.Identity)" />
</ItemGroup>
</Target>
<Target Name="RunTests"
Outputs="%(Binary.Identity)">
<Message Text="%(Binary.Identity)" />
</Target>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment