Directory.build.targets 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <Project>
  2. <!-- This props all need to be set in targets as they depend on the values set earlier -->
  3. <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.0'">
  4. <DefineConstants>$(DefineConstants);NO_ARRAY_EMPTY;NO_CODE_COVERAGE_ATTRIBUTE;CRIPPLED_REFLECTION</DefineConstants>
  5. </PropertyGroup>
  6. <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.4'">
  7. <DefineConstants>$(DefineConstants);NO_CODE_COVERAGE_ATTRIBUTE;CRIPPLED_REFLECTION</DefineConstants>
  8. </PropertyGroup>
  9. <PropertyGroup Condition="'$(TargetFramework)' == 'net45'">
  10. <DefineConstants>$(DefineConstants);NO_ARRAY_EMPTY;NO_TASK_FROMEXCEPTION</DefineConstants>
  11. </PropertyGroup>
  12. <PropertyGroup Condition="'$(TargetFramework)' == 'net46'">
  13. <DefineConstants>$(DefineConstants);USE_ASYNC_ITERATOR</DefineConstants>
  14. </PropertyGroup>
  15. <PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0' or '$(TargetFramework)' == 'netstandard2.1'">
  16. <!--
  17. NB: USE_ASYNC_ITERATOR relies on members in the framework only present in .NET Core 3.0 Preview 2 at the moment:
  18. error CS0518: Predefined type 'System.Runtime.CompilerServices.AsyncIteratorMethodBuilder' is not defined or imported
  19. error CS0656: Missing compiler required member 'System.Threading.Tasks.Sources.ManualResetValueTaskSourceCore`1.*
  20. -->
  21. <DefineConstants>$(DefineConstants);USE_ASYNC_ITERATOR;HAS_ASYNCENUMERABLE;HAS_ASYNCDISPOSABLE;BCL_HAS_CONFIGUREAWAIT</DefineConstants>
  22. </PropertyGroup>
  23. <PropertyGroup>
  24. <Product>$(AssemblyName) ($(TargetFramework))</Product>
  25. </PropertyGroup>
  26. <ItemGroup>
  27. <!-- Workaround https://github.com/dotnet/sdk/issues/2976 -->
  28. <PackageReference Update="Microsoft.NETCore.Platforms" PrivateAssets="All" />
  29. </ItemGroup>
  30. <PropertyGroup Condition="'$(IsTestProject)' == 'true'">
  31. <UseSourceLink>true</UseSourceLink>
  32. <CoverletOutputFormat>cobertura</CoverletOutputFormat>
  33. <Exclude>[xunit.*]*</Exclude>
  34. <CoverletOutput>$(MSBuildThisFileDirectory)coverlet/raw/$(AssemblyName)/$(TargetFramework)/</CoverletOutput>
  35. <CollectCoverage Condition="'$(TF_BUILD)' == 'true'">true</CollectCoverage>
  36. </PropertyGroup>
  37. </Project>