System.Linq.Async.Tests.csproj 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <Project Sdk="Microsoft.NET.Sdk">
  2. <PropertyGroup>
  3. <TargetFrameworks>net48;net10.0;net8.0</TargetFrameworks>
  4. <!--
  5. CA1510: Use ArgumentNullException.ThrowIfNull - not available on .NET 4.8
  6. CA1861: Extract constant arrays to 'static readonly' fields. With these tests we generally prioritize readability over performance.
  7. -->
  8. <NoWarn>$(NoWarn);CS0618;CS8603;CS8625;CA1510;CA1822;CA1861</NoWarn>
  9. </PropertyGroup>
  10. <ItemGroup>
  11. <Content Include="xunit.runner.json">
  12. <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  13. </Content>
  14. </ItemGroup>
  15. <ItemGroup>
  16. <None Include="System\Linq\Operators\Average.Generated.cs">
  17. <DesignTime>True</DesignTime>
  18. <AutoGen>True</AutoGen>
  19. <DependentUpon>Average.Generated.tt</DependentUpon>
  20. </None>
  21. <None Include="System\Linq\Operators\GroupBy.Generated.cs">
  22. <DesignTime>True</DesignTime>
  23. <AutoGen>True</AutoGen>
  24. <DependentUpon>GroupBy.Generated.tt</DependentUpon>
  25. </None>
  26. <None Include="System\Linq\Operators\MinMax.Generated.cs">
  27. <DesignTime>True</DesignTime>
  28. <AutoGen>True</AutoGen>
  29. <DependentUpon>MinMax.Generated.tt</DependentUpon>
  30. </None>
  31. <None Include="System\Linq\Operators\OrderBy.Generated.cs">
  32. <DesignTime>True</DesignTime>
  33. <AutoGen>True</AutoGen>
  34. <DependentUpon>OrderBy.Generated.tt</DependentUpon>
  35. </None>
  36. </ItemGroup>
  37. <ItemGroup>
  38. <!--
  39. System.Linq.Async brings in a transitive dependency on System.Interactive.Async, because in normal use,
  40. the methods in System.Linq.Async that are not in System.Linq.AsyncEnumerable are now used via their new
  41. home in System.Interactive.Async. However, there's a complication: for binary compatibility we retain these
  42. methods in the System.Linq.Async runtime assemblies (lib), removing them from the ref assemblies so that
  43. they are invisible at compile time. However, that trick works only for references via the NuGet package; this
  44. test project has a direct project reference to System.Linq.Async meaning that it can see all the methods that
  45. are deliberately hidden at compile time in normal use. This particular test project actually wants to test
  46. those hidden methods (because we still need to ensure that code relying on the binary compatibility will work).
  47. So we set an alias on System.Interactive.Async to avoid picking up its extension methods unless we explicitly want to.
  48. -->
  49. <ProjectReference Include="..\System.Interactive.Async\System.Interactive.Async.csproj">
  50. <Aliases>SystemInteractiveAsync</Aliases>
  51. </ProjectReference>
  52. <ProjectReference Include="..\System.Linq.Async\System.Linq.Async.csproj" />
  53. </ItemGroup>
  54. <!--
  55. Since this tests the legacy System.Linq.Async package, we need prevent the compiler from using the .NET runtime library
  56. System.Linq.AsyncEnumerable package.
  57. So although we get this references transitively (or automatically on .NET 10.0+) we need to put them explicitly here to set aliases.
  58. -->
  59. <ItemGroup Condition="'$(TargetFramework)' != 'net10.0'">
  60. <PackageReference Include="System.Linq.AsyncEnumerable" Version="10.0.0-rc.1.25451.107" Aliases="SystemLinqAsyncEnumerable" />
  61. </ItemGroup>
  62. <Target Name="_SetAliasOnBuiltInSystemLinqAsyncEnumerable" BeforeTargets="ResolveAssemblyReferences">
  63. <ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
  64. <Reference Condition="'%(Reference.AssemblyName)' == 'System.Linq.AsyncEnumerable'">
  65. <Aliases>SystemLinqAsyncEnumerable</Aliases>
  66. </Reference>
  67. </ItemGroup>
  68. </Target>
  69. <ItemGroup>
  70. <PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
  71. <PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
  72. <PrivateAssets>all</PrivateAssets>
  73. <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
  74. </PackageReference>
  75. <PackageReference Include="FluentAssertions" Version="6.4.0" />
  76. <PackageReference Include="xunit" Version="2.9.3" />
  77. </ItemGroup>
  78. <ItemGroup>
  79. <None Update="System\Linq\Operators\Average.Generated.tt">
  80. <Generator>TextTemplatingFileGenerator</Generator>
  81. <LastGenOutput>Average.Generated.cs</LastGenOutput>
  82. </None>
  83. <None Update="System\Linq\Operators\GroupBy.Generated.tt">
  84. <Generator>TextTemplatingFileGenerator</Generator>
  85. <LastGenOutput>GroupBy.Generated.cs</LastGenOutput>
  86. </None>
  87. <None Update="System\Linq\Operators\MinMax.Generated.tt">
  88. <Generator>TextTemplatingFileGenerator</Generator>
  89. <LastGenOutput>MinMax.Generated.cs</LastGenOutput>
  90. </None>
  91. <None Update="System\Linq\Operators\OrderBy.Generated.tt">
  92. <Generator>TextTemplatingFileGenerator</Generator>
  93. <LastGenOutput>OrderBy.Generated.cs</LastGenOutput>
  94. </None>
  95. </ItemGroup>
  96. <ItemGroup>
  97. <Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
  98. </ItemGroup>
  99. <ItemGroup>
  100. <Compile Update="System\Linq\Operators\Average.Generated.cs">
  101. <DesignTime>True</DesignTime>
  102. <AutoGen>True</AutoGen>
  103. <DependentUpon>Average.Generated.tt</DependentUpon>
  104. </Compile>
  105. <Compile Update="System\Linq\Operators\GroupBy.Generated.cs">
  106. <DesignTime>True</DesignTime>
  107. <AutoGen>True</AutoGen>
  108. <DependentUpon>GroupBy.Generated.tt</DependentUpon>
  109. </Compile>
  110. <Compile Update="System\Linq\Operators\MinMax.Generated.cs">
  111. <DesignTime>True</DesignTime>
  112. <AutoGen>True</AutoGen>
  113. <DependentUpon>MinMax.Generated.tt</DependentUpon>
  114. </Compile>
  115. <Compile Update="System\Linq\Operators\OrderBy.Generated.cs">
  116. <DesignTime>True</DesignTime>
  117. <AutoGen>True</AutoGen>
  118. <DependentUpon>OrderBy.Generated.tt</DependentUpon>
  119. </Compile>
  120. </ItemGroup>
  121. </Project>