forked from dotnet/msbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dir.targets
38 lines (34 loc) · 2.33 KB
/
dir.targets
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
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="EnsurePrerequisitesCopied"
BeforeTargets="Build"
Condition="'$(IsTestProject)' == 'true'">
<MSBuild Projects="$(SourceDir)CopyTestPrerequisites.proj"
Targets="CopyPrerequisites"
BuildInParallel="true" />
</Target>
<Target Name="Test"
DependsOnTargets="Build;EnsurePrerequisitesCopied"
Condition="'$(IsTestProject)' == 'true'">
<!-- Exec the console runner instead of using the MSBuild runner,
because our tests have dependencies on being run as x86. -->
<!-- Noshadow because our assemblies do not pass the checks for it
(due to open source signing). -->
<!-- No parallel execution because most of our tests do bad things
with state. They were passing because MSTest was serial. -->
<Message Importance="High" Text="xunit -> %(MainAssembly.Filename)..." />
<!-- Exec 32-bit console runner -->
<Exec Command="$(PackagesDir)\xunit.runner.console.$(XunitVersion)\tools\xunit.console.x86.exe @(MainAssembly, ' ') -noshadow -parallel none -xml %(MainAssembly.FullPath)_TestResults.xml -html %(MainAssembly.FullPath)_TestResults.html > %(MainAssembly.FullPath)_stdout.txt"
Condition="'$(PlatformTarget)'!='x64'" />
<!-- Building 64-bit only, use x64 console runner -->
<Exec Command="$(PackagesDir)\xunit.runner.console.$(XunitVersion)\tools\xunit.console.exe @(MainAssembly, ' ') -noshadow -parallel none -xml %(MainAssembly.FullPath)_TestResults.xml -html %(MainAssembly.FullPath)_TestResults.html > %(MainAssembly.FullPath)_stdout.txt"
Condition="'$(PlatformTarget)'=='x64'" />
</Target>
<!-- See https://github.com/Microsoft/msbuild/issues/224 -->
<Target Name="EnsureSDKTargetPresent"
BeforeTargets="_RestoreBuildToolsPackagesConfig" >
<Error Condition="!Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.targets\ImportAfter\Microsoft.NuGet.ImportAfter.targets')"
Text="MSBuild depends on the 'Tools and Windows SDK' Visual Studio plugin. Please install it. Reference: https://github.com/Microsoft/msbuild/wiki/Building+Testing+and+Debugging" />
</Target>
<Import Project="$(NuGetConfigDir)\packageLoad.targets" />
</Project>