Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
89 lines (80 sloc) 5.47 KB
<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) &gt; 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>