forked from microsoft/MIEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuildAndTest.proj
executable file
·60 lines (47 loc) · 2.07 KB
/
BuildAndTest.proj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0"
DefaultTargets="BuildAndTest"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="build\miengine.settings.targets" />
<UsingTask
AssemblyFile="src\packages\xunit.runners.2.0.0\tools\xunit.runner.msbuild.dll"
TaskName="Xunit.Runner.MSBuild.xunit" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)'=='' ">Debug</Configuration>
<OutDir Condition=" '$(OutDir)'=='' ">$(MSBuildThisFileDirectory)bin\$(Configuration)\</OutDir>
<SourceHome Condition=" '$(SourceHome)'=='' ">$(MSBuildThisFileDirectory)src\</SourceHome>
<ToolsHome Condition=" '$(ToolsHome)'=='' ">$(MSBuildThisFileDirectory)tools\</ToolsHome>
<!--Don't run unit tests for lab builds -->
<TargetsToRun>Build;Test</TargetsToRun>
<TargetsToRun Condition="'$(Lab)' == 'true'">Build</TargetsToRun>
</PropertyGroup>
<ItemGroup>
<Solution Include="$(SourceHome)*.sln">
<AdditionalProperties>Configuration=$(Configuration)</AdditionalProperties>
</Solution>
</ItemGroup>
<Target Name="Clean">
<MSBuild Targets="Clean"
Projects="@(Solution)" />
</Target>
<Target Name="Build">
<MSBuild Targets="Build"
Projects="src\prebuild\prebuild.csproj" />
<MSBuild Targets="Build"
Projects="@(Solution)" />
</Target>
<Target Name="Rebuild">
<MSBuild Targets="Rebuild"
Projects="src\prebuild\prebuild.csproj" />
<MSBuild Targets="Rebuild"
Projects="@(Solution)" />
</Target>
<Target Name="Test" Condition="'$(Configuration)' != 'Desktop.Debug' and '$(Configuration)' != 'Desktop.Release'">
<ItemGroup>
<TestAssemblies Include="bin\$(Configuration)\**\*UnitTests.dll"/>
</ItemGroup>
<Exec Command="$(NugetPackagesDirectory)\xunit.runner.console.2.0.0\tools\xunit.console.exe @(TestAssemblies, ' ') -xml "$(OutDir)TestResults.xml"" />
</Target>
<Target Name="BuildAndTest"
DependsOnTargets="$(TargetsToRun)" />
</Project>