forked from dotnet/corefx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdir.targets
90 lines (75 loc) · 4.82 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
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
89
90
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(TargetFrameworkVersion)' != '' and '$(TargetFrameworkProfile)' != ''">
<TargetingPortable>true</TargetingPortable>
</PropertyGroup>
<!-- Setup the default target for projects not already explicitly targeting portable -->
<PropertyGroup Condition="'$(TargetingPortable)' != 'true'">
<!-- Setting a default portable profile, although nothing should resolve from there as we want to use the pacakge refs -->
<TargetPlatformIdentifier>Portable</TargetPlatformIdentifier>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile Condition="'$(TargetFrameworkProfile)' == ''">Profile7</TargetFrameworkProfile>
<TargetFrameworkMonikerDisplayName>.NET Portable Subset</TargetFrameworkMonikerDisplayName>
<ImplicitlyExpandTargetFramework Condition="'$(ImplicitlyExpandTargetFramework)' == ''">false</ImplicitlyExpandTargetFramework>
<AssemblySearchPaths>
{HintPathFromItem};
$(OutDir);
{RawFileName};
</AssemblySearchPaths>
<!-- For our projects we don't want to resolve from the usual paths for now only hint paths and output directory
{CandidateAssemblyFiles};
$(ReferencePath);
{TargetFrameworkDirectory};
{Registry:$(FrameworkRegistryBase),$(TargetFrameworkVersion),$(AssemblyFoldersSuffix)$(AssemblyFoldersExConditions)};
-->
</PropertyGroup>
<!-- Need to add references to the mscorlib design-time facade for some old-style portable dependencies like xunit -->
<Target Name="AddDesignTimeFacadeReferences"
Condition="'$(TargetingPortable)' != 'true'"
BeforeTargets="ResolveReferences"
DependsOnTargets="GetReferenceAssemblyPaths"
>
<ItemGroup>
<PossibleTargetFrameworks Include="$(_TargetFrameworkDirectories)" />
<ReferencePath Include="%(PossibleTargetFrameworks.Identity)mscorlib.dll" />
</ItemGroup>
</Target>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<Import Project="$(ToolsDir)packageresolve.targets" Condition="Exists('$(ToolsDir)packageresolve.targets')" />
<Import Project="$(ToolsDir)sign.targets" Condition="Exists('$(ToolsDir)sign.targets')" />
<Import Project="$(ToolsDir)publishtest.targets" Condition="Exists('$(ToolsDir)publishtest.targets')" />
<PropertyGroup>
<IsTestProject Condition="'$(IsTestProject)'=='' And $([System.String]::new('$(MSBuildProjectName)').EndsWith('.Tests'))">True</IsTestProject>
<RunTestsForProject Condition="'$(RunTestsForProject)'=='' and '$(IsTestProject)'=='True'">True</RunTestsForProject>
<RunTestsForProject Condition="'$(SkipTests)'=='True'">False</RunTestsForProject>
<!-- Don't run unit tests as post-build in VS, use F5 on test project instead (see below). -->
<RunTestsForProject Condition="'$(BuildingInsideVisualStudio)' == 'True'">False</RunTestsForProject>
</PropertyGroup>
<!-- xUnit command line -->
<PropertyGroup>
<XunitHost>corerun.exe</XunitHost>
<XunitCommandLine>xunit.console.netcore.exe $(TargetFileName)</XunitCommandLine>
<XunitOptions>$(XunitOptions) -notrait category=outerloop</XunitOptions>
<XunitOptions>$(XunitOptions) -notrait category=failing</XunitOptions>
</PropertyGroup>
<!-- In VS (2015 Preview or later currently required): Debug to run unit tests on CoreCLR. -->
<PropertyGroup Condition="'$(IsTestProject)'=='True'">
<DebugTestFrameworkFolder>aspnetcore50</DebugTestFrameworkFolder>
<StartWorkingDirectory Condition="'$(StartWorkingDirectory)' == ''">$(TestPath)$(DebugTestFrameworkFolder)</StartWorkingDirectory>
<StartAction Condition="'$(StartAction)' == ''">Program</StartAction>
<StartProgram Condition="'$(StartProgram)' == ''">$(StartWorkingDirectory)\$(XunitHost)</StartProgram>
<StartArguments Condition="'$(StartArguments)' == ''">$(XunitCommandLine) $(XunitOptions)</StartArguments>
<DebugEngines>{2E36F1D4-B23C-435D-AB41-18E608940038}</DebugEngines>
</PropertyGroup>
<!-- On command line: run unit tests on CoreCLR as post-build step. -->
<Target Name="RunTestsForProject"
AfterTargets="PrepareForRun"
Condition="'$(RunTestsForProject)'=='True'">
<Exec Command="$(XunitHost) $(XunitCommandLine) $(XunitOptions)"
WorkingDirectory="$(TestPath)%(TestTargetFramework.Folder)"
ContinueOnError="True">
<Output PropertyName="TestRunExitCode" TaskParameter="ExitCode" />
</Exec>
<Error Condition="'$(TestRunExitCode)' != '0'" Text="One or more tests failed while running tests from '$(MSBuildProjectName)' please check log for details!" />
</Target>
</Project>