Directory.build.targets 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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>
  15. <DefineConstants>$(DefineConstants);HAS_WINRT</DefineConstants>
  16. </PropertyGroup>
  17. <PropertyGroup Condition="'$(TargetFramework)' == 'net46'">
  18. <DefineConstants>$(DefineConstants);HAS_WINFORMS;HAS_DISPATCHER;HAS_REMOTING;DESKTOPCLR</DefineConstants>
  19. </PropertyGroup>
  20. <PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
  21. <TargetPlatformVersion>10.0.17763.0</TargetPlatformVersion>
  22. <TargetPlatformMinVersion>10.0.15063.0</TargetPlatformMinVersion>
  23. <DefineConstants>$(DefineConstants);NO_CODE_COVERAGE_ATTRIBUTE;NO_SERIALIZABLE;CRIPPLED_REFLECTION;NO_THREAD;NO_TRACE;WINDOWS</DefineConstants>
  24. </PropertyGroup>
  25. <PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0.16299'">
  26. <DefineConstants>$(DefineConstants);WINDOWS</DefineConstants>
  27. <TargetPlatformVersion>10.0.17763.0</TargetPlatformVersion>
  28. </PropertyGroup>
  29. <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.1'">
  30. <DefineConstants>$(DefineConstants)</DefineConstants>
  31. </PropertyGroup>
  32. <PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
  33. <DefineConstants>$(DefineConstants);HAS_WINFORMS;HAS_DISPATCHER;DESKTOPCLR</DefineConstants>
  34. </PropertyGroup>
  35. <ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp3.0'">
  36. <PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
  37. </ItemGroup>
  38. <Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
  39. <ItemGroup>
  40. <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition=" '$(SourceRevisionId)' != '' ">
  41. <_Parameter1>CommitHash</_Parameter1>
  42. <_Parameter2>$(SourceRevisionId)</_Parameter2>
  43. </AssemblyAttribute>
  44. </ItemGroup>
  45. </Target>
  46. </Project>