-
Notifications
You must be signed in to change notification settings - Fork 315
/
Runtime.msbuild
85 lines (76 loc) · 4.08 KB
/
Runtime.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
78
79
80
81
82
83
84
85
<Project DefaultTargets="UnitTest" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<!-- TODO: CodeAnalysis is off by default in VS11 because FxCop cannot load custom rules built against Dev10 -->
<CodeAnalysis Condition=" '$(CodeAnalysis)' == '' and '$(VS110COMNTOOLS)' == ''">true</CodeAnalysis>
<StyleCopEnabled Condition=" '$(StyleCopEnabled)' == '' ">true</StyleCopEnabled>
<BuildInParallel Condition=" '$(BuildInParallel)' == '' And $(MSBuildNodeCount) > 1 ">true</BuildInParallel>
<BuildInParallel Condition=" '$(BuildInParallel)' == '' ">false</BuildInParallel>
<TestResultsDirectory>$(MSBuildThisFileDirectory)bin\$(Configuration)\test\TestResults\</TestResultsDirectory>
</PropertyGroup>
<Target Name="Integration" DependsOnTargets="Clean;Build;UnitTest" />
<Target Name="Clean">
<MSBuild
Projects="Runtime.sln"
Targets="Clean"
Properties="Configuration=$(Configuration)" />
<RemoveDir Directories="bin\$(Configuration)" />
</Target>
<Target Name="Prereq">
<MSBuild
Projects="tools\WebStack.NuGet.targets"
Targets="VerifyPackages"
Properties="CompactMessage=false"
Condition=" '$(EnableNuGetPackageRestore)' != 'true' " />
<CallTarget Targets="RestorePackages" Condition=" '$(EnableNuGetPackageRestore)' == 'true' " />
</Target>
<Target Name="RestorePackages">
<!--
This can't build in parallel because of NuGet package restore race conditions.
When this is fixed in NuGet, we can remove the CSPROJ part of this target
(we will continue to need the NuGet install for StyleCop and FxCop tasks).
NOTE: These projects are hand selected to be the minimum # of CSPROJ files that
ensure we've restored every remote package. If another collision is found,
please review the project list as appropriate.
-->
<ItemGroup>
<RestoreCsProjFiles
Include="test\Microsoft.Web.Http.Data.Test\*.csproj;
src\System.Web.WebPages.Administration\*.csproj;
src\System.Web.WebPages.Deployment\*.csproj;
src\Microsoft.Web.WebPages.OAuth\*.csproj" />
</ItemGroup>
<Message Text="Restoring NuGet packages..." Importance="High" />
<!-- Download NuGet.exe -->
<MSBuild
Projects="tools\WebStack.NuGet.targets"
Targets="CheckPrerequisites" />
<!-- Restore the things the CSPROJ files need -->
<MSBuild
Projects="@(RestoreCsProjFiles)"
BuildInParallel="false"
Targets="RestorePackages" />
<!-- Hand restore packages with binaries that this MSBuild process needs -->
<MSBuild
Projects="tools\WebStack.NuGet.targets"
Targets="RestoreBinaryDependencies" />
</Target>
<Target Name="Build" DependsOnTargets="Prereq">
<MakeDir Directories="bin\$(Configuration)" />
<MSBuild
Projects="Runtime.sln"
BuildInParallel="$(BuildInParallel)"
Targets="Build"
Properties="Configuration=$(Configuration);CodeAnalysis=$(CodeAnalysis);StyleCopEnabled=$(StyleCopEnabled)" />
</Target>
<Target Name="UnitTest" DependsOnTargets="Build">
<ItemGroup>
<TestDLLsXunit Include="bin\$(Configuration)\test\*.Test.dll;bin\$(Configuration)\test\*.Test.*.dll" Exclude="**\SPA.Test.dll" />
<XunitProject Include="tools\WebStack.xunit.targets">
<Properties>TestAssembly=%(TestDLLsXunit.FullPath);XmlPath=$(TestResultsDirectory)%(TestDLLsXunit.FileName)-XunitResults.xml</Properties>
</XunitProject>
</ItemGroup>
<MakeDir Directories="$(TestResultsDirectory)" />
<MSBuild Projects="@(XunitProject)" BuildInParallel="$(BuildInParallel)" Targets="Xunit" />
</Target>
</Project>