forked from OData/WebApi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WebApiOData.E2E.msbuild
77 lines (64 loc) · 3.57 KB
/
WebApiOData.E2E.msbuild
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<Project DefaultTargets="E2ETest" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="tools/WebStack.tasks.targets"/>
<!-- Common Properties -->
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Configuration Condition=" '$(Configuration)' == '' and '$(Desktop)' == 'true' ">CodeAnalysis</Configuration>
<CodeAnalysis Condition=" '$(CodeAnalysis)' == '' and '$(Configuration)' != 'Release' ">true</CodeAnalysis>
<OutputPath>$(MSBuildThisFileDirectory)bin\$(Configuration)\E2ETest\</OutputPath>
<TestResultsDirectory>$(OutputPath)\TestResults\</TestResultsDirectory>
<StyleCopEnabled Condition=" '$(StyleCopEnabled)' == '' ">true</StyleCopEnabled>
<BuildInParallel Condition=" '$(BuildInParallel)' == '' And $(MSBuildNodeCount) > 1 ">true</BuildInParallel>
<BuildInParallel Condition=" '$(BuildInParallel)' == '' ">false</BuildInParallel>
<NuGetExeFile>$(MSBuildThisFileDirectory)sln\.nuget\NuGet.exe</NuGetExeFile>
</PropertyGroup>
<UsingTask AssemblyFile=".\sln\packages\xunit.runner.msbuild.2.3.1\build\net452\xunit.runner.msbuild.net452.dll" TaskName="Xunit.Runner.MSBuild.xunit"/>
<ItemGroup>
<SolutionsToBuild Include=".\sln\WebApiOData.E2E.sln">
<BuildInParallel>$(BuildInParallel)</BuildInParallel>
</SolutionsToBuild>
</ItemGroup>
<!-- Test assemblies -->
<ItemGroup>
<TestAssembiles Include="$(OutputPath)Microsoft.Test.E2E.AspNet.OData.dll" />
</ItemGroup>
<Target Name="DownloadNuGet">
<RemoveDir Directories="$(OutputPath)" />
<DownloadNuGet OutputFileName="$(NuGetExeFile)" MinimumVersion="2.7.0" />
</Target>
<Target Name="RestorePackages" DependsOnTargets="DownloadNuGet">
<Message Text="Restoring NuGet packages..." Importance="High" />
<Exec Command='"$(NuGetExeFile)" restore "%(SolutionsToBuild.Identity)" -PackagesDirectory sln\packages -NonInteractive -Verbosity quiet -ConfigFile "$(MsBuildThisFileDirectory)sln\.nuget\NuGet.Config"' />
</Target>
<Target Name="Build" DependsOnTargets="RestorePackages">
<PropertyGroup>
<RunCodeAnalysis>false</RunCodeAnalysis>
</PropertyGroup>
<Message Text="{Build Test}" Importance="High" />
<Message Text=" Configuration $(Configuration)" Importance="High" />
<Message Text="RunCodeAnalysis $(RunCodeAnalysis)" Importance="High"/>
<MakeDir Directories="$(OutputPath)" />
<MSBuild
Projects="@(SolutionsToBuild)"
BuildInParallel="%(SolutionsToBuild.BuildInParallel)"
Targets="Build"
Condition=" '%(SolutionsToBuild.Portable)' != 'true' or '$(BuildPortable)' == 'true' "
Properties="Configuration=$(Configuration);CodeAnalysis=$(CodeAnalysis);StyleCopEnabled=$(StyleCopEnabled);VisualStudioVersion=$(VisualStudioVersion)" />
<Message Text="{End of Build Test}" Importance="High" />
<Message Text="" Importance="High" />
</Target>
<Target Name="RunTests" DependsOnTargets="Build">
<RemoveDir Directories="$(TestResultsDirectory)" />
<MakeDir Directories="$(TestResultsDirectory)" />
<Message Text="{Running Test}" Importance="High" />
<xunit Assemblies="@(TestAssembiles)" Xml="$(TestResultsDirectory)\$(ResultFileName)"/>
<Message Text="{End of Running Test}" Importance="High" />
<Message Text="" Importance="High" />
</Target>
<Target Name="E2ETest">
<CallTarget Targets="RunTests;PrintTestRunSummary" RunEachTargetSeparately="True" />
</Target>
<Target Name="PrintTestRunSummary">
<PrintTestRunSummary TestResultsDirectory="$(TestResultsDirectory)" />
</Target>
</Project>