| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <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('net8.0')) or $(TargetFramework.StartsWith('net9.0'))">
- <DefineConstants>$(DefineConstants);HAS_TRIMMABILITY_ATTRIBUTES</DefineConstants>
- </PropertyGroup>
- <PropertyGroup Condition="$(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>
- <!-- Ensure correct resx file handling -->
- <ItemGroup>
- <!-- Runs code generator to produce strongly-typed resx wrapper type. -->
- <EmbeddedResource Update="**\*.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <CustomToolNamespace>System.Reactive</CustomToolNamespace>
- <LastGenOutput>$([System.IO.Path]::GetFileNameWithoutExtension('%(Filename)')).Designer.cs</LastGenOutput>
- </EmbeddedResource>
- <!-- Gets the correct grouping in VS -->
- <Compile Update="@(EmbeddedResource -> '%(LastGenOutput)')">
- <DependentUpon>$([System.IO.Path]::GetFileNameWithoutExtension('$([System.IO.Path]::GetFileNameWithoutExtension('%(Identity)'))')).resx</DependentUpon>
- <DesignTime>True</DesignTime>
- <AutoGen>True</AutoGen>
- </Compile>
- </ItemGroup>
- <PropertyGroup Condition="$(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>
|