12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <Project>
- <!-- This props all need to be set in targets as they depend on the values set earlier -->
-
- <PropertyGroup>
- <Product>$(AssemblyName) ($(TargetFramework))</Product>
- </PropertyGroup>
-
- <PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
- <DefineConstants>$(DefineConstants);HAS_WINFORMS;HAS_WPF;HAS_WINRT;HAS_DISPATCHER;HAS_REMOTING;DESKTOPCLR;NO_NULLABLE_ATTRIBUTES</DefineConstants>
- </PropertyGroup>
- <PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0.18362'">
- <DefineConstants>$(DefineConstants);HAS_WINRT;WINDOWS;HAS_OS_XAML;LEGACY_WINRT;NO_NULLABLE_ATTRIBUTES</DefineConstants>
- </PropertyGroup>
- <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
- <DefineConstants>$(DefineConstants);HAS_WINRT;NO_NULLABLE_ATTRIBUTES</DefineConstants>
- </PropertyGroup>
- <PropertyGroup Condition="$(TargetFramework.StartsWith('net6.0')) or $(TargetFramework.StartsWith('net7.0')) or $(TargetFramework.StartsWith('net8.0'))">
- <DefineConstants>$(DefineConstants);HAS_TRIMMABILITY_ATTRIBUTES</DefineConstants>
- </PropertyGroup>
- <PropertyGroup Condition="$(TargetFramework.StartsWith('net6.0-windows')) or $(TargetFramework.StartsWith('net8.0-windows')) or $(TargetFramework.StartsWith('net9.0-windows'))">
- <DefineConstants>$(DefineConstants);HAS_WINRT;HAS_WINFORMS;HAS_WPF;HAS_DISPATCHER;DESKTOPCLR;WINDOWS;CSWINRT</DefineConstants>
- </PropertyGroup>
- <ItemGroup Condition="('$(TargetFramework)' == 'net472' or '$(TargetFramework)' == 'uap10.0.18362' or '$(TargetFramework)' == 'netstandard2.0') and $(IsPackable)">
- <PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
- </ItemGroup>
- <ItemGroup Condition="'$(TargetFramework)'=='uap10.0.18362'">
- <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"
- Version="6.2.14" />
- </ItemGroup>
- <PropertyGroup Condition="$(TargetFramework.StartsWith('net6.0-windows')) or $(TargetFramework.StartsWith('net8.0-windows')) or $(TargetFramework.StartsWith('net9.0-windows'))">
- <!--
- In the 9.0.100-rc.2.24474.11 SDK, the build tools attempt to perform code generation for a whole load of our types to support WinRT interop.
- It's looking like it does this for any public type that implements IDisposable!
- It's possible that this is a bug in the SDK, but it's also possible that this will be resolved as by design.
- For the .NET 9.0 RC2 SDK at least, we need to opt out the CsWinRT AOT optimizer.
- We need to check whether this is definitely OK. I think this is only meant for types that are intended to be used from WinRT,
- which isn't the case here, but we need to verify this.
- -->
- <CsWinRTAotOptimizerEnabled>false</CsWinRTAotOptimizerEnabled>
- </PropertyGroup>
- <Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
- <ItemGroup>
- <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition=" '$(SourceRevisionId)' != '' ">
- <_Parameter1>CommitHash</_Parameter1>
- <_Parameter2>$(SourceRevisionId)</_Parameter2>
- </AssemblyAttribute>
- </ItemGroup>
- </Target>
- <!-- Remove once coverlet supports this built-in -->
- <Target Name="CoverletGetPathMap"
- DependsOnTargets="InitializeSourceRootMappedPaths"
- Returns="@(_LocalTopLevelSourceRoot)"
- Condition="'$(DeterministicSourcePaths)' == 'true'">
- <ItemGroup>
- <_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/>
- </ItemGroup>
- </Target>
- </Project>
|