Directory.build.targets 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <Project>
  2. <!-- This props all need to be set in targets as they depend on the values set earlier -->
  3. <PropertyGroup>
  4. <Product>$(AssemblyName) ($(TargetFramework))</Product>
  5. </PropertyGroup>
  6. <PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
  7. <DefineConstants>$(DefineConstants);HAS_WINFORMS;HAS_WPF;HAS_WINRT;HAS_DISPATCHER;HAS_REMOTING;DESKTOPCLR;NO_NULLABLE_ATTRIBUTES</DefineConstants>
  8. </PropertyGroup>
  9. <PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
  10. <TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
  11. <TargetPlatformMinVersion>10.0.15063.0</TargetPlatformMinVersion>
  12. <DefineConstants>$(DefineConstants);HAS_WINRT;NO_CODE_COVERAGE_ATTRIBUTE;NO_SERIALIZABLE;CRIPPLED_REFLECTION;NO_THREAD;NO_TRACE;WINDOWS;NO_NULLABLE_ATTRIBUTES</DefineConstants>
  13. </PropertyGroup>
  14. <PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0.16299'">
  15. <DefineConstants>$(DefineConstants);HAS_WINRT;WINDOWS;HAS_OS_XAML;LEGACY_WINRT;NO_NULLABLE_ATTRIBUTES</DefineConstants>
  16. <TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
  17. </PropertyGroup>
  18. <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.1'">
  19. <DefineConstants>$(DefineConstants);HAS_WINRT;NO_NULLABLE_ATTRIBUTES</DefineConstants>
  20. </PropertyGroup>
  21. <PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
  22. <DefineConstants>$(DefineConstants);HAS_WINRT;HAS_WINFORMS;HAS_WPF;HAS_DISPATCHER;DESKTOPCLR</DefineConstants>
  23. </PropertyGroup>
  24. <PropertyGroup Condition="$(TargetFramework.StartsWith('net5.0-windows'))">
  25. <DefineConstants>$(DefineConstants);HAS_WINRT;HAS_WINFORMS;HAS_WPF;HAS_DISPATCHER;DESKTOPCLR;WINDOWS;CSWINRT</DefineConstants>
  26. </PropertyGroup>
  27. <ItemGroup Condition="'$(TargetFramework)' == 'net472' or '$(TargetFramework)' == 'uap10.0' or '$(TargetFramework)' == 'uap10.0.16299' or '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.1'">
  28. <PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
  29. </ItemGroup>
  30. <Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
  31. <ItemGroup>
  32. <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition=" '$(SourceRevisionId)' != '' ">
  33. <_Parameter1>CommitHash</_Parameter1>
  34. <_Parameter2>$(SourceRevisionId)</_Parameter2>
  35. </AssemblyAttribute>
  36. </ItemGroup>
  37. </Target>
  38. <!-- Remove once coverlet supports this built-in -->
  39. <Target Name="CoverletGetPathMap"
  40. DependsOnTargets="InitializeSourceRootMappedPaths"
  41. Returns="@(_LocalTopLevelSourceRoot)"
  42. Condition="'$(DeterministicSourcePaths)' == 'true'">
  43. <ItemGroup>
  44. <_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/>
  45. </ItemGroup>
  46. </Target>
  47. </Project>