forked from mono/aspnetwebstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Runtime.msbuild
88 lines (80 loc) · 5.47 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
86
87
88
<Project DefaultTargets="UnitTest" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- build.cmd sets /p:Desktop=true. The CI server does not; instead, it does an additional step with /p:Configuration=CodeAnalysis. -->
<Configuration Condition=" '$(Configuration)' == '' and '$(Desktop)' == 'true' ">CodeAnalysis</Configuration>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<CodeAnalysis Condition=" '$(CodeAnalysis)' == '' and '$(Configuration)' != 'Release' ">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>
<ExtensionsTestResultsDirectory>$(MSBuildThisFileDirectory)bin\Extensions\$(Configuration)\test\TestResults\</ExtensionsTestResultsDirectory>
<VS2012WindowsXamlInstallPath>$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v11.0</VS2012WindowsXamlInstallPath>
<!-- Check for the Windows XAML msbuild extensions to determine VS version to use, if both 2010 and 2012 are installed -->
<ConfigurationSuffix/>
<ConfigurationSuffix Condition="!Exists($(VS2012WindowsXamlInstallPath))">VS2010</ConfigurationSuffix>
<VisualStudioVersion Condition=" '$(ConfigurationSuffix)' == '' ">11.0</VisualStudioVersion>
<VisualStudioVersion Condition=" '$(ConfigurationSuffix)' == 'VS2010' ">10.0</VisualStudioVersion>
</PropertyGroup>
<ItemGroup>
<SolutionsToBuild Include="Runtime.sln">
<ReleaseRoot>.</ReleaseRoot>
<BuildInParallel>$(BuildInParallel)</BuildInParallel>
</SolutionsToBuild>
<SolutionsToBuild Include="Extensions.sln">
<ReleaseRoot>Extensions</ReleaseRoot>
<BuildInParallel>false</BuildInParallel>
</SolutionsToBuild>
</ItemGroup>
<Target Name="Integration" DependsOnTargets="Clean;Build;UnitTest" />
<Target Name="Clean">
<MSBuild
Projects="@(SolutionsToBuild)"
Targets="Clean"
Properties="Configuration=$(Configuration)$(ConfigurationSuffix);VisualStudioVersion=$(VisualStudioVersion)" />
<RemoveDir Directories="bin\%(SolutionsToBuild.ReleaseRoot)\$(Configuration)" />
</Target>
<Target Name="Prereq" DependsOnTargets="PreRestorePackages">
<MSBuild Projects="@(RestoreCsProjFiles)" Targets="RestorePackages" StopOnFirstFailure="true" />
<MSBuild Projects=".nuget\nuget.targets" Targets="RestoreBinaryDependencies" />
</Target>
<Target Name="PreRestorePackages">
<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" />
</Target>
<Target Name="RestorePackages" DependsOnTargets="PreRestorePackages">
<MSBuild Projects="@(RestoreCsProjFiles)" Targets="EnableRestore;RestorePackages" StopOnFirstFailure="true" />
<MSBuild Projects=".nuget\nuget.targets" Targets="EnableRestore;RestoreBinaryDependencies" />
</Target>
<Target Name="Build" DependsOnTargets="Prereq">
<!-- we need to batch the solution files since they both build Microsoft.TestCommon -->
<Error Condition=" '$(CodeAnalysis)' == 'true' and '$(Configuration)' == 'Release' " Text="Unable to run code analysis in Release configuration. Release assemblies do not include SuppressMessage attributes (so code analysis would always fail with the errors that are normally suppressed)." />
<MakeDir Directories="bin\%(SolutionsToBuild.ReleaseRoot)\$(Configuration)" />
<MSBuild
Projects="%(SolutionsToBuild.Identity)"
BuildInParallel="%(SolutionsToBuild.BuildInParallel)"
Targets="Build"
Properties="Configuration=$(Configuration)$(ConfigurationSuffix);CodeAnalysis=$(CodeAnalysis);StyleCopEnabled=$(StyleCopEnabled);VisualStudioVersion=$(VisualStudioVersion)" />
</Target>
<Target Name="UnitTest" DependsOnTargets="Build">
<ItemGroup>
<TestDLLsXunit Include="bin\$(Configuration)\test\*.Test.dll;bin\$(Configuration)\test\*.Test.*.dll" Exclude="**\SPA.Test.dll">
<ResultsDirectory>$(TestResultsDirectory)</ResultsDirectory>
</TestDLLsXunit>
<TestDLLsXunit Include="bin\Extensions\$(Configuration)\test\*.Test.dll">
<ResultsDirectory>$(ExtensionsTestResultsDirectory)</ResultsDirectory>
</TestDLLsXunit>
<XunitProject Include="tools\WebStack.xunit.targets">
<Properties>TestAssembly=%(TestDLLsXunit.FullPath);XmlPath=%(TestDLLsXunit.ResultsDirectory)%(TestDLLsXunit.FileName)-XunitResults.xml</Properties>
</XunitProject>
</ItemGroup>
<MakeDir Directories="%(TestDLLsXunit.ResultsDirectory)" />
<MSBuild Projects="@(XunitProject)" BuildInParallel="$(BuildInParallel)" Targets="Xunit" />
</Target>
</Project>