Directory.build.props 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <Project>
  2. <PropertyGroup>
  3. <Copyright>Copyright (c) .NET Foundation and Contributors.</Copyright>
  4. <MinClientVersion>2.12</MinClientVersion>
  5. <GenerateDocumentationFile>true</GenerateDocumentationFile>
  6. <Authors>.NET Foundation and Contributors</Authors>
  7. <PackageIcon>icon.png</PackageIcon>
  8. <PackageProjectUrl>https://github.com/dotnet/reactive</PackageProjectUrl>
  9. <PackageLicenseExpression>MIT</PackageLicenseExpression>
  10. <SignAssembly>true</SignAssembly>
  11. <AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)ReactiveX.snk</AssemblyOriginatorKeyFile>
  12. <NoWarn>$(NoWarn);1701;1702;CS1591;NU5105</NoWarn>
  13. <DefaultLanguage>en-US</DefaultLanguage>
  14. <IncludeSymbols>false</IncludeSymbols>
  15. <IsTestProject>$(MSBuildProjectName.Contains('Tests'))</IsTestProject>
  16. <GeneratePackageOnBuild Condition=" '$(IsTestProject)' != 'true' and '$(CreatePackage)' == 'true' ">true</GeneratePackageOnBuild>
  17. <PackageOutputPath>$(MSBuildThisFileDirectory)artifacts</PackageOutputPath>
  18. <EmbedUntrackedSources>true</EmbedUntrackedSources>
  19. <PublishRepositoryUrl>true</PublishRepositoryUrl>
  20. <LangVersion>latest</LangVersion>
  21. </PropertyGroup>
  22. <PropertyGroup Condition="'$(Configuration)' != 'Debug'">
  23. <IncludeSymbols>true</IncludeSymbols>
  24. <SymbolPackageFormat>snupkg</SymbolPackageFormat>
  25. </PropertyGroup>
  26. <PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
  27. <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
  28. </PropertyGroup>
  29. <ItemGroup>
  30. <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
  31. <!--
  32. Nerdbank.GitVersioning 3.6.128 injects a reference to a .proj file that doesn't work inside the
  33. UWP test runner project. We don't ship that as a NuGet package, so it doesn't matter what its
  34. version number is.
  35. -->
  36. <PackageReference
  37. Include="Nerdbank.GitVersioning"
  38. Version="3.8.118"
  39. PrivateAssets="all"
  40. Condition="$(ProjectName) != 'Tests.System.Reactive.Uwp.DeviceRunner'" />
  41. </ItemGroup>
  42. <ItemGroup>
  43. <None Include="$(MSBuildThisFileDirectory)../Resources/Artwork/Logo.png" Pack="true" PackagePath="\icon.png"/>
  44. </ItemGroup>
  45. <ItemGroup Condition="'$(IsTestProject)' == 'true'">
  46. <PackageReference Include="coverlet.collector" Version="6.0.4" />
  47. </ItemGroup>
  48. <PropertyGroup Condition="'$(TargetFramework)'=='uap10.0.18362'">
  49. <!--
  50. See 0003-uap-targets.md ADR in documentation for the reasons behind these settings.
  51. -->
  52. <NoStdLib>True</NoStdLib>
  53. <TargetPlatformMinVersion>10.0.18362</TargetPlatformMinVersion>
  54. <TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion>
  55. <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
  56. <TargetFrameworkMoniker>.NETCore,Version=v5.0</TargetFrameworkMoniker>
  57. <TargetFrameworkIdentifier>.NETCore</TargetFrameworkIdentifier>
  58. <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
  59. <NugetTargetMoniker>UAP,Version=v10.0</NugetTargetMoniker>
  60. <DefineConstants>$(DefineConstants);WINDOWS_UWP</DefineConstants>
  61. <!-- At some point, it looks like a fully-qualified version number stopped resolving the TargetPlatformSdkPath
  62. and now it only works with 10.0, so the SDK no longer sets this for us in UAP targets. -->
  63. <TargetPlatformSdkPath Condition="'$(TargetPlatformSdkPath)' == ''">$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformSDKLocation('Windows', '10.0'))</TargetPlatformSdkPath>
  64. </PropertyGroup>
  65. <PropertyGroup>
  66. <AnalysisLevelDesign>7.0-default</AnalysisLevelDesign>
  67. <AnalysisLevelNaming>7.0-all</AnalysisLevelNaming>
  68. <AnalysisLevelPerformance>7.0-all</AnalysisLevelPerformance>
  69. <!-- Enable analyzers on older targets. -->
  70. <EnableNETAnalyzers>true</EnableNETAnalyzers>
  71. <!--
  72. Disabled diagnostics:
  73. CA1001 - types holding disposable fields should implement IDisposable. See next item.
  74. CA2213 - IDisposable types should Dispose any IDisposable fields. This rule finds over 600
  75. examples! These are all in subtle multithreaded or async code. Some of them appear
  76. not to be real problems. For example, there are places where schedulers retain
  77. references to IDisposable work items, but that IDisposable interfaces is only there
  78. to enable application code to cancel scheduled work, so it's not Rx's place to call
  79. Dispose. And there are more subtle cases where disposal is deferred to give threads
  80. a chance to shut down. Each of these likely needs individual review:
  81. https://github.com/dotnet/reactive/issues/1927
  82. IDE0028 - Suggests Collection expressions in place of construction, e.g. replaces new List<int>(x)
  83. [.. x]. To me, this is less readable, and it doesn't improve performance, as far as we know.
  84. Annoyingly, we don't seem to be able to configure this to apply only when it would not
  85. introduce a spread.
  86. IDE0056 - Use of index/range syntax - relevant types not available on all targets, so we can't
  87. IDE0057 do this.
  88. IDE0130 - Namespace does not match folder structure. Conforming to this would be a significant
  89. upheaval, and it's not clear that it would be an improvement.
  90. IDE0290 - Primary ctors. This diagnostic suggests them in a lot of places where we don't want
  91. them. E.g., in most types with multiple constructors I find I prefer not to have
  92. a primary ctor. Since this is all or nothing, we turn it off.
  93. IDE0305 - Suggests Collection expressions in place of .ToArray. E.g, wants to change this:
  94. _readyList.ToArray()
  95. to this:
  96. [.. readyList]
  97. This won't improve performance as far as we know (sometimes a reason for using that
  98. syntax), and it's not obviously an improvement in readability.
  99. IDE0306 - Suggests Collection expressions in place of construction, e.g. replaces new List<int>(x)
  100. [.. x]. To me, this is less readable, and it doesn't improve performance, as far as we know.
  101. CA1510 - use ArgumentNullException.ThrowIf (not available on all targets)
  102. CA1513 - use ObjectDisposedException.ThrowIf (not available on all targets)
  103. -->
  104. <NoWarn>$(NoWarn);CA1001;CA2213;CA1510;CA1513;IDE0028;IDE0056;IDE0057;IDE0130;IDE0290;IDE0305;IDE0306</NoWarn>
  105. </PropertyGroup>
  106. <ItemGroup>
  107. <GlobalAnalyzerConfigFiles Include="$(MSBuildThisFileDirectory)analyzers.globalconfig" />
  108. </ItemGroup>
  109. </Project>