Directory.Build.targets 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the MIT license. See License.txt in the project root for full license information. -->
  3. <Project>
  4. <ItemGroup>
  5. <SupportedPlatform Remove="Android" />
  6. <SupportedPlatform Remove="iOS" />
  7. </ItemGroup>
  8. <ItemGroup>
  9. <!--
  10. The System.Threading.Tasks global import interferes with Microsoft.Build.Utilities.Task that is used extensively
  11. in this repository. Remove it to avoid the conflict.
  12. -->
  13. <Import Remove="System.Threading.Tasks" />
  14. </ItemGroup>
  15. <ItemGroup Condition="'$(IsTestProject)' == 'true' AND '$(OutputType)' == 'Exe' AND '$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
  16. <PackageReference Include="xunit.console" Private="true" />
  17. <!-- These files are both included via a .props file in xunit.runner.visualstudio, as well as
  18. via package dependencies of xunit.console. To prevent warnings about duplicate files
  19. from Pack, don't copy the ones from the .props file to the output directory. -->
  20. <None Update="@(None)">
  21. <CopyToOutputDirectory Condition="'%(Filename)' == 'xunit.runner.utility.netcoreapp10'">false</CopyToOutputDirectory>
  22. <CopyToOutputDirectory Condition="'%(Filename)' == 'xunit.runner.reporters.netcoreapp10'">false</CopyToOutputDirectory>
  23. </None>
  24. <!-- These files are included by the Microsoft.TestPlatform.TestHost package, but we don't want them in the .NET Tool NuGet package
  25. (by default they would go in the content and contentFiles folders, generating NU5100 warnings. -->
  26. <Content Update="@(Content)">
  27. <Pack Condition="$([System.IO.Path]::GetFileName('%(Identity)')) == 'testhost.exe'">false</Pack>
  28. <Pack Condition="$([System.IO.Path]::GetFileName('%(Identity)')) == 'testhost.dll'">false</Pack>
  29. </Content>
  30. </ItemGroup>
  31. <Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
  32. <!-- Optionally override arcade's test target with one which will run the tests as tools.
  33. Conditionally overriding a target requires a conditional import of another (.targets)
  34. file. -->
  35. <Import Project="OverrideTest.targets"
  36. Condition="'$(RunTestsAsTool)' == 'true' And '$(CanRunTestAsTool)' == 'true'"/>
  37. <!-- Update KnownFrameworkReferences to target the right version of the runtime -->
  38. <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'
  39. and $(MicrosoftNETCoreAppRefPackageVersion.StartsWith('$(_TargetFrameworkVersionWithoutV)'))
  40. and '$(MSBuildProjectName)' != 'toolset-tasks'">
  41. <FrameworkReference
  42. Update="Microsoft.NETCore.App"
  43. TargetingPackVersion="$(MicrosoftNETCoreAppRefPackageVersion)"
  44. RuntimeFrameworkVersion="$(MicrosoftNETCoreAppRuntimePackageVersion)" />
  45. </ItemGroup>
  46. <ItemGroup Condition="$(MicrosoftAspNetCoreAppRefPackageVersion.StartsWith('$(_TargetFrameworkVersionWithoutV)'))">
  47. <KnownFrameworkReference Update="Microsoft.AspNetCore.App">
  48. <LatestRuntimeFrameworkVersion>$(MicrosoftAspNetCoreAppRefPackageVersion)</LatestRuntimeFrameworkVersion>
  49. <RuntimePackRuntimeIdentifiers>${SupportedRuntimeIdentifiers}</RuntimePackRuntimeIdentifiers>
  50. <TargetingPackVersion>$(MicrosoftAspNetCoreAppRefPackageVersion)</TargetingPackVersion>
  51. <DefaultRuntimeFrameworkVersion>$(MicrosoftAspNetCoreAppRefPackageVersion)</DefaultRuntimeFrameworkVersion>
  52. </KnownFrameworkReference>
  53. </ItemGroup>
  54. </Project>