Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (43 sloc) 2.35 KB
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Full" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask AssemblyFile="$(ProjectRoot)\packages\xunit.runner.msbuild.2.3.1\build\net452\xunit.runner.msbuild.net452.dll" TaskName="Xunit.Runner.MSBuild.xunit"/>
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<Platform Condition="'$(Platform)' == ''">x64</Platform>
<ProjectRoot>$(MSBuildProjectDirectory)</ProjectRoot>
<SourcesRoot>$(ProjectRoot)\src</SourcesRoot>
<TestsRoot>$(ProjectRoot)\test</TestsRoot>
<ToolsRoot>$(ProjectRoot)\tools</ToolsRoot>
<Solution>$(ProjectRoot)\HelloWorld.sln</Solution>
<BuildOutputRoot>$(ProjectRoot)\output</BuildOutputRoot>
<!-- Do not remove this property or rename it. The MSBuild Community Tasks depend on its existence. -->
<MSBuildCommunityTasksPath Condition="'$(MSBuildCommunityTasksPath)' == ''">$(ToolsRoot)\msbuild</MSBuildCommunityTasksPath>
</PropertyGroup>
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets" />
<!-- RestorePackages has to happen before everything else. Otherwise the xunit msbuild runner seems unable to
pick up and copy xunit.execution.desktop.dll and the first build (only the first) after the restore fails. -->
<Target Name="Full" DependsOnTargets="RestorePackages;Clean;Build;RunUnitTests"/>
<Target Name="Clean">
<ItemGroup>
<DirsToClean Include="$(BuildOutputRoot)"/>
</ItemGroup>
<MSBuild Projects="$(Solution)" Targets="Clean" Properties="Configuration=$(Configuration)"/>
<RemoveDir Directories="@(DirsToClean)" ContinueOnError="true" />
</Target>
<Target Name="RestorePackages">
<ItemGroup>
<Solution Include="$(Solution)" />
</ItemGroup>
<Exec Command="&quot;$(ToolsRoot)\NuGet\NuGet.exe&quot; restore &quot;%(Solution.Identity)&quot;" />
</Target>
<Target Name="Build" DependsOnTargets="RestorePackages">
<MSBuild Projects="$(Solution)" Targets="Rebuild" Properties="Configuration=$(Configuration)"
ContinueOnError="false" />
</Target>
<Target Name="RunUnitTests">
<ItemGroup>
<TestAssemblies Include="$(TestsRoot)\**\bin\$(Configuration)\HelloWorld.Tests.dll" />
</ItemGroup>
<xunit Assemblies="@(TestAssemblies)" />
</Target>
</Project>