2023-05-23 02:38:10 +03:00
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<Import Project="$(MSBuildThisFileDirectory)\eng\MSBuild\Analyzers.targets" />
<Import Project="$(MSBuildThisFileDirectory)\eng\MSBuild\Packaging.targets" />
<Import Project="$(MSBuildThisFileDirectory)\eng\MSBuild\LegacySupport.targets" />
<Import Project="$(MSBuildThisFileDirectory)\eng\MSBuild\Shared.targets" />
<Import Project="$(MSBuildThisFileDirectory)\eng\MSBuild\Generators.targets" />
<Import Project="$(MSBuildThisFileDirectory)\eng\MSBuild\ProjectStaging.targets" />
<!-- Warning stuff -->
<PropertyGroup>
<MSBuildWarningsAsMessages>$(MSBuildWarningsAsMessages);NETSDK1138;MSB3270</MSBuildWarningsAsMessages>
<WarningLevel>5</WarningLevel>
<!-- This is false for local development, but set to true in the CI system -->
<TreatWarningsAsErrors Condition=" '$(TreatWarningsAsErrors)' == '' ">false</TreatWarningsAsErrors>
<!-- Prevent analyzer crashes from stopping things -->
<NoWarn>$(NoWarn);AD0001</NoWarn>
2023-07-18 02:21:07 +03:00
<!-- Experimental warnings are for customers, not for this repo -->
2024-09-12 02:41:14 +03:00
<NoWarn>$(NoWarn);EXTEXP0001;EXTEXP0002;EXTEXP0003;EXTEXP0004;EXTEXP0005;EXTEXP0006;EXTEXP0007;EXTEXP0008;EXTEXP0009;EXTEXP0010;EXTEXP0011;EXTEXP0012;EXTEXP0013;EXTEXP0014;EXTEXP0015;EXTEXP0016;EXTEXP0017;EXTEXP0018</NoWarn>
2023-05-23 02:38:10 +03:00
2024-08-26 06:52:38 +03:00
<!-- Obsoletion warnings are for customers, not for this repo -->
<NoWarn>$(NoWarn);EXTOBS0001;</NoWarn>
2023-05-23 02:38:10 +03:00
<!-- NU5104: A stable release of a package should not have a prerelease dependency -->
<NoWarn>$(NoWarn);NU5104</NoWarn>
<NoWarn Condition="'$(GenerateDocumentationFile)' != 'true'">$(NoWarn);SA1600;SA0001</NoWarn>
2024-07-31 04:13:48 +03:00
<!-- Conflicts with SA1405: Debug.Assert should provide message text -->
<NoWarn>$(NoWarn);S3236</NoWarn>
2023-05-23 02:38:10 +03:00
<!-- Legacy targets do not support attributes for a nullable context thus suppressing null check warnings -->
2023-06-28 20:46:02 +03:00
<NoWarn Condition="'$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netstandard2.0'">$(NoWarn);CA1062</NoWarn>
2023-05-23 02:38:10 +03:00
</PropertyGroup>
2023-05-26 06:38:55 +03:00
<ItemGroup Condition="('$(Stage)' == 'normal' OR '$(Stage)' == 'obsolete') AND '$(OutputType)' != 'Exe' AND '$(IsPackable)' == 'true' AND '$(Api)' != 'false'">
<AdditionalFiles Include="$(MSBuildProjectName).json" Visible="False" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<Target
Name="AddApiBaselineFilesToRoot"
Condition="('$(Stage)' == 'normal' OR '$(Stage)'=='obsolete') AND '$(OutputType)' != 'Exe' AND '$(IsPackable)' == 'true' AND '$(Api)' != 'false'"
BeforeTargets="BeforeCompile">
<WriteLinesToFile
File="$(MSBuildProjectName).json"
Lines=""
Condition="!Exists('$(MSBuildProjectName).json')" />
</Target>
2023-05-23 02:38:10 +03:00
<ItemGroup Condition="'$(Stage)' == 'dev' AND '$(OutputType)' != 'Exe' AND '$(Api)' != 'false'">
2023-06-28 09:11:36 +03:00
<AssemblyAttribute Include="System.Diagnostics.CodeAnalysis.ExperimentalAttribute">
2023-11-03 20:50:27 +03:00
<_Parameter1>$(StageDevDiagnosticId)</_Parameter1>
2023-06-30 03:55:42 +03:00
<_Parameter2>UrlFormat = "https://aka.ms/dotnet-extensions-warnings/{0}"</_Parameter2>
<_Parameter2_IsLiteral>true</_Parameter2_IsLiteral>
2023-06-28 09:11:36 +03:00
</AssemblyAttribute>
2023-05-23 02:38:10 +03:00
</ItemGroup>
<Target Name="AddInternalsVisibleToDynamicProxyGenAssembly2" BeforeTargets="BeforeCompile">
<ItemGroup Condition="'@(InternalsVisibleToDynamicProxyGenAssembly2->Count())' > 0">
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1 Condition="'$(SignArtifacts)' == 'true' ">DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7</_Parameter1>
<_Parameter1 Condition="'$(SignArtifacts)' != 'true' ">DynamicProxyGenAssembly2</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
</Target>
<Target Name="AddInternalsVisibleToTest" Condition="'$(BuildTests)'!='false'" BeforeTargets="BeforeCompile">
<ItemGroup Condition="'@(InternalsVisibleToTest->Count())' > 0">
<InternalsVisibleTo Include="%(InternalsVisibleToTest.Identity)" />
</ItemGroup>
</Target>
<Target Name="_ConfigureTestRunnerAdditionalArguments" BeforeTargets="_InnerGetTestsToRun">
<PropertyGroup>
<!-- See https://learn.microsoft.com/dotnet/core/tools/dotnet-test -->
<_BlameArgs>--blame --blame-crash --blame-crash-dump-type full --blame-hang --blame-hang-dump-type full --blame-hang-timeout 6m</_BlameArgs>
<!-- This property is used by the Arcade SDK while bootstrapping the VS Test runner -->
<TestRunnerAdditionalArguments>$(TestRunnerAdditionalArguments) $(_BlameArgs)</TestRunnerAdditionalArguments>
</PropertyGroup>
</Target>
2023-08-09 21:02:43 +03:00
2023-09-14 02:31:16 +03:00
<!-- This target will make sure that projects targeting net462 will also have the Microsoft.Extensions.Logging.Abstractions analyzer removed. -->
2024-03-12 19:21:05 +03:00
<Target Name="_Microsoft_Extensions_Logging_AbstractionsRemoveAnalyzers"
2023-08-09 21:02:43 +03:00
Condition="'$(DisableMicrosoftExtensionsLoggingSourceGenerator)' == 'true'"
AfterTargets="ResolveReferences">
<ItemGroup>
<_Microsoft_Extensions_Logging_AbstractionsAnalyzer Include="@(Analyzer)" Condition="'%(Analyzer.NuGetPackageId)' == 'Microsoft.Extensions.Logging.Abstractions' Or
('%(Analyzer.AssemblyName)' == 'Microsoft.Extensions.Logging.Generators' and '%(Analyzer.NuGetPackageId)' == 'Microsoft.AspNetCore.App.Ref')" />
</ItemGroup>
<!-- Remove Microsoft.Extensions.Logging.Abstractions Analyzer -->
<ItemGroup>
<Analyzer Remove="@(_Microsoft_Extensions_Logging_AbstractionsAnalyzer)" />
</ItemGroup>
</Target>
2023-05-23 02:38:10 +03:00
</Project>