Directory.build.targets 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <Project>
  2. <!-- Workaround. Remove once we're on 3.1.300+
  3. https://github.com/dotnet/sourcelink/issues/572 -->
  4. <PropertyGroup>
  5. <TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
  6. </PropertyGroup>
  7. <ItemGroup>
  8. <EmbeddedFiles Include="$(GeneratedAssemblyInfoFile)"/>
  9. </ItemGroup>
  10. <!-- This props all need to be set in targets as they depend on the values set earlier -->
  11. <PropertyGroup>
  12. <Product>$(AssemblyName) ($(TargetFramework))</Product>
  13. </PropertyGroup>
  14. <PropertyGroup Condition="'$(TargetFramework)' == 'net46'">
  15. <DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;HAS_WINFORMS;HAS_DISPATCHER;PREFER_ASYNC;HAS_TPL46;DESKTOPCLR</DefineConstants>
  16. </PropertyGroup>
  17. <PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
  18. <TargetPlatformVersion>10.0.17763.0</TargetPlatformVersion>
  19. <TargetPlatformMinVersion>10.0.15063.0</TargetPlatformMinVersion>
  20. <DefineConstants>$(DefineConstants);NO_CODE_COVERAGE_ATTRIBUTE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;NO_SERIALIZABLE;CRIPPLED_REFLECTION;NO_THREAD;WINDOWS</DefineConstants>
  21. </PropertyGroup>
  22. <PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0.16299'">
  23. <DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;WINDOWS</DefineConstants>
  24. <TargetPlatformVersion>10.0.17763.0</TargetPlatformVersion>
  25. </PropertyGroup>
  26. <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.1'">
  27. <DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING</DefineConstants>
  28. </PropertyGroup>
  29. <PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
  30. <DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;HAS_WINFORMS;HAS_DISPATCHER;DESKTOPCLR</DefineConstants>
  31. </PropertyGroup>
  32. <ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp3.0'">
  33. <PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
  34. </ItemGroup>
  35. <Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
  36. <ItemGroup>
  37. <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition=" '$(SourceRevisionId)' != '' ">
  38. <_Parameter1>CommitHash</_Parameter1>
  39. <_Parameter2>$(SourceRevisionId)</_Parameter2>
  40. </AssemblyAttribute>
  41. </ItemGroup>
  42. </Target>
  43. </Project>