<Project>
  <PropertyGroup>
    <!-- Default properties inherited by all projects. Projects can override. -->
    <RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
    <EnableNETAnalyzers>true</EnableNETAnalyzers>
    <AnalysisMode>AllEnabledByDefault</AnalysisMode>
    <AnalysisLevel>latest</AnalysisLevel>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
    <LangVersion>13</LangVersion>
    <Nullable>enable</Nullable>
    <NoWarn>$(NoWarn);NU5128</NoWarn>
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
    <ProjectsCoreTargetFrameworks>net9.0;net8.0</ProjectsCoreTargetFrameworks>
    <ProjectsDebugCoreTargetFrameworks>net9.0</ProjectsDebugCoreTargetFrameworks>
    <ProjectsTargetFrameworks>net9.0;net8.0;netstandard2.0;net472</ProjectsTargetFrameworks>
    <ProjectsDebugTargetFrameworks>net9.0;net472</ProjectsDebugTargetFrameworks>
    <IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible>
    <Configurations>Debug;Release;Publish</Configurations>
  </PropertyGroup>

  <PropertyGroup>
    <IsReleaseCandidate>false</IsReleaseCandidate>
  </PropertyGroup>
  
  <PropertyGroup>
    <!-- Disable NuGet packaging by default. Projects can override. -->
    <IsPackable>false</IsPackable>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)'=='Publish'">
    <Optimize>True</Optimize>
  </PropertyGroup>

  <!-- .NET Framework/.NET Standard don't properly support nullable reference types, suppress any warnings for those TFMs -->
  <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'net472' ">
    <NoWarn>$(NoWarn);nullable</NoWarn>
  </PropertyGroup>

  <PropertyGroup>
    <RepoRoot>$([System.IO.Path]::GetDirectoryName($([MSBuild]::GetPathOfFileAbove('CODE_OF_CONDUCT.md', '$(MSBuildThisFileDirectory)'))))</RepoRoot>
  </PropertyGroup>

  <ItemGroup>
    <!-- Add CLSCompliant=false to all projects by default. Projects can override. -->
    <AssemblyAttribute Include="System.CLSCompliantAttribute">
      <_Parameter1>false</_Parameter1>
    </AssemblyAttribute>
  </ItemGroup>

  <!-- Common properties -->
  <Import Project="$(MSBuildThisFileDirectory)\eng\MSBuild\LegacySupport.props" />
  <Import Project="$(MSBuildThisFileDirectory)\eng\MSBuild\Shared.props" />
</Project>
