<commit_before>﻿<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup>
    <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
  </PropertyGroup>

  <PropertyGroup Condition="'$(IsUnitTestProject)' != 'true'">
    <StrongNameKeyId>Microsoft</StrongNameKeyId>
  </PropertyGroup>

  <PropertyGroup Condition="'$(IsUnitTestProject)' == 'true'">
    <StrongNameKeyId>MSBuildTest</StrongNameKeyId>
    <AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Test.snk</AssemblyOriginatorKeyFile>
    <PublicKey>002400000480000094000000060200000024000052534131000400000100010015c01ae1f50e8cc09ba9eac9147cf8fd9fce2cfe9f8dce4f7301c4132ca9fb50ce8cbf1df4dc18dd4d210e4345c744ecb3365ed327efdbc52603faa5e21daa11234c8c4a73e51f03bf192544581ebe107adee3a34928e39d04e524a9ce729d5090bfd7dad9d10c722c0def9ccc08ff0a03790e48bcd1f9b6c476063e1966a1c4</PublicKey>
    <PublicKeyToken>9d77cc7ad39b68eb</PublicKeyToken>

    <!-- Set output type of test projects to EXE.  This will allow us to run tests on .NET Core via F5 or "dotnet run" -->
    <OutputType>Exe</OutputType>
    <GenerateProgramFile>false</GenerateProgramFile>

    <!-- Makes xunit print all test names in stdout -->
    <XunitOptions>$(XunitOptions) -diagnostics</XunitOptions>

    <!-- Respect the traits set up by PlatformSpecific attribute. -->
    <XunitOptions Condition="$([MSBuild]::IsOSPlatform('windows'))">$(XunitOptions) -notrait category=nonwindowstests</XunitOptions>
    <XunitOptions Condition="$([MSBuild]::IsOSPlatform('linux'))">$(XunitOptions) -notrait category=nonlinuxtests</XunitOptions>
    <XunitOptions Condition="$([MSBuild]::IsOSPlatform('linux')) and '$(NetCoreBuild)'=='true'">-notrait category=nonlinuxtests -notrait category=netcore-linux-failing</XunitOptions>
    <XunitOptions Condition="$([MSBuild]::IsOSPlatform('osx'))">$(XunitOptions) -notrait category=nonosxtests</XunitOptions>
    <XunitOptions Condition="$([MSBuild]::IsOSPlatform('osx')) and '$(NetCoreBuild)'=='true'">-notrait category=nonosxtests -notrait category=netcore-osx-failing</XunitOptions>
    <!-- Replace with MSBuild::IsBsdLike once the initial msbuild knows about it -->
    <XunitOptions Condition="$([MSBuild]::IsOSPlatform('FREEBSD')) Or $([MSBuild]::IsOSPlatform('NETBSD')) Or $([MSBuild]::IsOSPlatform('OPENBSD'))">$(XunitOptions) -notrait category=nonfreebsdtests</XunitOptions>

    <XunitOptions Condition="'$(MonoBuild)' == 'true'">$(XunitOptions) -notrait category=non-mono-tests -notrait category=nonmonotests</XunitOptions>
    <XunitOptions Condition="$([MSBuild]::IsOSPlatform('osx')) and '$(MonoBuild)' == 'true'">$(XunitOptions) -notrait category=mono-osx-failing</XunitOptions>
    <XunitOptions Condition="$([MSBuild]::IsOSPlatform('windows')) and '$(MonoBuild)' == 'true'">$(XunitOptions) -notrait category=mono-windows-failing</XunitOptions>

    <XunitOptions Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">$(XunitOptions) -notrait category=nonnetcoreapptests</XunitOptions>
    <XunitOptions Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">$(XunitOptions) -notrait category=nonnetfxtests</XunitOptions>

    <XunitOptions>$(XunitOptions) -notrait category=failing</XunitOptions>

    <TestRunnerAdditionalArguments>$(XunitOptions)</TestRunnerAdditionalArguments>

    <PackageOutputPath Condition="'$(IsVisualStudioInsertionPackage)' == 'true'">$(DevDivPackagesDir)</PackageOutputPath>

    <!-- Arcade sdk also carries an xunit.runner.json which sometimes overrides the one in this repo. Assign a value to the arcade properties XUnitDesktopSettingsFile and XUnitCoreSettingsFile to prevent the arcade version of the file being added. -->
    <XUnitDesktopSettingsFile>$(MSBuildThisFileDirectory)Shared\UnitTests\xunit.runner.json</XUnitDesktopSettingsFile>
    <XUnitCoreSettingsFile>$(XUnitDesktopSettingsFile)</XUnitCoreSettingsFile>
  </PropertyGroup>

  <ItemGroup Condition="'$(IsUnitTestProject)' == 'true'">
    <!-- MSBuild isn't xunit analyzer clean, so remove the reference to the xunit package added by the repo toolset and
         replace it with references to xunit.core and xunit.assert. -->
    <PackageReference Remove="xunit" />
    <PackageReference Include="xunit.core" />
    <PackageReference Include="xunit.assert" />

    <PackageReference Include="Microsoft.DotNet.XUnitExtensions" />

    <!-- Don't localize unit test projects -->
    <PackageReference Remove="XliffTasks" />

    <Compile Include="$(RepoRoot)src\Shared\UnitTests\TestAssemblyInfo.cs" Condition="'$(IsLibraryTestProject)' != 'true'" />
    <Compile Include="$(RepoRoot)src\Shared\UnitTests\TestProgram.cs" />
  </ItemGroup>

  <ItemGroup>
    <!-- Work around https://github.com/dotnet/sdk/issues/2204 by explicitly setting
         PrivateAssets to keep this reference (auto-added when targeting netcoreapp*)
         from making it into our NuGet packages. -->
    <PackageReference Update="Microsoft.NETCore.App" PrivateAssets="All" />

    <!-- Configure analyzer to forbid certain API calls -->
    <AdditionalFiles Include="$(MSBuildThisFileDirectory)BannedSymbols.txt" />
  </ItemGroup>

  <PropertyGroup Condition="'$(GenerateReferenceAssemblySource)' == 'true'">
    <PublicApiTfm Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework'">net</PublicApiTfm>
    <PublicApiTfm Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework' and $([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) == '3.5'">net35</PublicApiTfm>
    <PublicApiTfm Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETStandard'">netstandard</PublicApiTfm>
    <PublicApiTfm Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETCoreApp'">netstandard</PublicApiTfm>

    <GenAPIFolderPath>$(RepoRoot)ref\$(GenAPIAssemblyName)\$(GenAPIShortFrameworkIdentifier)\</GenAPIFolderPath>
  </PropertyGroup>

  <ItemGroup Condition="'$(GenerateReferenceAssemblySource)' == 'true'">
    <!-- Ensure API stability for shipping packages -->
    <PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="all" />

    <AdditionalFiles Include="PublicAPI/$(PublicApiTfm)/PublicAPI.Shipped.txt" />
    <AdditionalFiles Include="PublicAPI/$(PublicApiTfm)/PublicAPI.Unshipped.txt" />
  </ItemGroup>

  <ItemGroup Condition="'$(IsUnitTestProject)' == 'true' And '$(TargetFrameworkIdentifier)' != '.NETFramework' ">
    <PackageReference Include="xunit.console" />
  </ItemGroup>

  <ItemGroup Condition="'$(OutputType)' == 'Exe'">
    <!-- Copy empty Directory.Build.props and Directory.Build.targets files to output directory to prevent
         tests from picking up these files from the repo root. -->
    <Content Include="$(RepoRoot)src\Shared\EmptyDirectoryBuildFiles\*" CopyToOutputDirectory="PreserveNewest"
             Visible="false" Pack="false"/>
  </ItemGroup>

  <Target Name="SetResourceProperties" BeforeTargets="_GetEmbeddedResourcesWithSourceGeneration">
    <ItemGroup>
      <EmbeddedResource Update="@(EmbeddedResource)" Condition="'%(EmbeddedResource.NuGetPackageId)' == 'Microsoft.CodeAnalysis.Collections' AND '%(FileName)' == 'Strings'">
        <GenerateSource>true</GenerateSource>
        <Generator>MSBuild:_GenerateResxSource</Generator>
        <ClassName>Microsoft.CodeAnalysis.Collections.SR</ClassName>
      </EmbeddedResource>
    </ItemGroup>
  </Target>
<commit_msg>Don't reference PublicApiAnalyzers in sourcebuild (#7118)<commit_after>﻿<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup>
    <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
  </PropertyGroup>

  <PropertyGroup Condition="'$(IsUnitTestProject)' != 'true'">
    <StrongNameKeyId>Microsoft</StrongNameKeyId>
  </PropertyGroup>

  <PropertyGroup Condition="'$(IsUnitTestProject)' == 'true'">
    <StrongNameKeyId>MSBuildTest</StrongNameKeyId>
    <AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Test.snk</AssemblyOriginatorKeyFile>
    <PublicKey>002400000480000094000000060200000024000052534131000400000100010015c01ae1f50e8cc09ba9eac9147cf8fd9fce2cfe9f8dce4f7301c4132ca9fb50ce8cbf1df4dc18dd4d210e4345c744ecb3365ed327efdbc52603faa5e21daa11234c8c4a73e51f03bf192544581ebe107adee3a34928e39d04e524a9ce729d5090bfd7dad9d10c722c0def9ccc08ff0a03790e48bcd1f9b6c476063e1966a1c4</PublicKey>
    <PublicKeyToken>9d77cc7ad39b68eb</PublicKeyToken>

    <!-- Set output type of test projects to EXE.  This will allow us to run tests on .NET Core via F5 or "dotnet run" -->
    <OutputType>Exe</OutputType>
    <GenerateProgramFile>false</GenerateProgramFile>

    <!-- Makes xunit print all test names in stdout -->
    <XunitOptions>$(XunitOptions) -diagnostics</XunitOptions>

    <!-- Respect the traits set up by PlatformSpecific attribute. -->
    <XunitOptions Condition="$([MSBuild]::IsOSPlatform('windows'))">$(XunitOptions) -notrait category=nonwindowstests</XunitOptions>
    <XunitOptions Condition="$([MSBuild]::IsOSPlatform('linux'))">$(XunitOptions) -notrait category=nonlinuxtests</XunitOptions>
    <XunitOptions Condition="$([MSBuild]::IsOSPlatform('linux')) and '$(NetCoreBuild)'=='true'">-notrait category=nonlinuxtests -notrait category=netcore-linux-failing</XunitOptions>
    <XunitOptions Condition="$([MSBuild]::IsOSPlatform('osx'))">$(XunitOptions) -notrait category=nonosxtests</XunitOptions>
    <XunitOptions Condition="$([MSBuild]::IsOSPlatform('osx')) and '$(NetCoreBuild)'=='true'">-notrait category=nonosxtests -notrait category=netcore-osx-failing</XunitOptions>
    <!-- Replace with MSBuild::IsBsdLike once the initial msbuild knows about it -->
    <XunitOptions Condition="$([MSBuild]::IsOSPlatform('FREEBSD')) Or $([MSBuild]::IsOSPlatform('NETBSD')) Or $([MSBuild]::IsOSPlatform('OPENBSD'))">$(XunitOptions) -notrait category=nonfreebsdtests</XunitOptions>

    <XunitOptions Condition="'$(MonoBuild)' == 'true'">$(XunitOptions) -notrait category=non-mono-tests -notrait category=nonmonotests</XunitOptions>
    <XunitOptions Condition="$([MSBuild]::IsOSPlatform('osx')) and '$(MonoBuild)' == 'true'">$(XunitOptions) -notrait category=mono-osx-failing</XunitOptions>
    <XunitOptions Condition="$([MSBuild]::IsOSPlatform('windows')) and '$(MonoBuild)' == 'true'">$(XunitOptions) -notrait category=mono-windows-failing</XunitOptions>

    <XunitOptions Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">$(XunitOptions) -notrait category=nonnetcoreapptests</XunitOptions>
    <XunitOptions Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">$(XunitOptions) -notrait category=nonnetfxtests</XunitOptions>

    <XunitOptions>$(XunitOptions) -notrait category=failing</XunitOptions>

    <TestRunnerAdditionalArguments>$(XunitOptions)</TestRunnerAdditionalArguments>

    <PackageOutputPath Condition="'$(IsVisualStudioInsertionPackage)' == 'true'">$(DevDivPackagesDir)</PackageOutputPath>

    <!-- Arcade sdk also carries an xunit.runner.json which sometimes overrides the one in this repo. Assign a value to the arcade properties XUnitDesktopSettingsFile and XUnitCoreSettingsFile to prevent the arcade version of the file being added. -->
    <XUnitDesktopSettingsFile>$(MSBuildThisFileDirectory)Shared\UnitTests\xunit.runner.json</XUnitDesktopSettingsFile>
    <XUnitCoreSettingsFile>$(XUnitDesktopSettingsFile)</XUnitCoreSettingsFile>
  </PropertyGroup>

  <ItemGroup Condition="'$(IsUnitTestProject)' == 'true'">
    <!-- MSBuild isn't xunit analyzer clean, so remove the reference to the xunit package added by the repo toolset and
         replace it with references to xunit.core and xunit.assert. -->
    <PackageReference Remove="xunit" />
    <PackageReference Include="xunit.core" />
    <PackageReference Include="xunit.assert" />

    <PackageReference Include="Microsoft.DotNet.XUnitExtensions" />

    <!-- Don't localize unit test projects -->
    <PackageReference Remove="XliffTasks" />

    <Compile Include="$(RepoRoot)src\Shared\UnitTests\TestAssemblyInfo.cs" Condition="'$(IsLibraryTestProject)' != 'true'" />
    <Compile Include="$(RepoRoot)src\Shared\UnitTests\TestProgram.cs" />
  </ItemGroup>

  <ItemGroup>
    <!-- Work around https://github.com/dotnet/sdk/issues/2204 by explicitly setting
         PrivateAssets to keep this reference (auto-added when targeting netcoreapp*)
         from making it into our NuGet packages. -->
    <PackageReference Update="Microsoft.NETCore.App" PrivateAssets="All" />

    <!-- Configure analyzer to forbid certain API calls -->
    <AdditionalFiles Include="$(MSBuildThisFileDirectory)BannedSymbols.txt" />
  </ItemGroup>

  <PropertyGroup Condition="'$(GenerateReferenceAssemblySource)' == 'true'">
    <PublicApiTfm Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework'">net</PublicApiTfm>
    <PublicApiTfm Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework' and $([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) == '3.5'">net35</PublicApiTfm>
    <PublicApiTfm Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETStandard'">netstandard</PublicApiTfm>
    <PublicApiTfm Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETCoreApp'">netstandard</PublicApiTfm>

    <GenAPIFolderPath>$(RepoRoot)ref\$(GenAPIAssemblyName)\$(GenAPIShortFrameworkIdentifier)\</GenAPIFolderPath>
  </PropertyGroup>

  <ItemGroup Condition="'$(GenerateReferenceAssemblySource)' == 'true'">
    <!-- Ensure API stability for shipping packages -->
    <PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="all" Condition="'$(DotNetBuildFromSource)' != 'true'" />

    <AdditionalFiles Include="PublicAPI/$(PublicApiTfm)/PublicAPI.Shipped.txt" />
    <AdditionalFiles Include="PublicAPI/$(PublicApiTfm)/PublicAPI.Unshipped.txt" />
  </ItemGroup>

  <ItemGroup Condition="'$(IsUnitTestProject)' == 'true' And '$(TargetFrameworkIdentifier)' != '.NETFramework' ">
    <PackageReference Include="xunit.console" />
  </ItemGroup>

  <ItemGroup Condition="'$(OutputType)' == 'Exe'">
    <!-- Copy empty Directory.Build.props and Directory.Build.targets files to output directory to prevent
         tests from picking up these files from the repo root. -->
    <Content Include="$(RepoRoot)src\Shared\EmptyDirectoryBuildFiles\*" CopyToOutputDirectory="PreserveNewest"
             Visible="false" Pack="false"/>
  </ItemGroup>

  <Target Name="SetResourceProperties" BeforeTargets="_GetEmbeddedResourcesWithSourceGeneration">
    <ItemGroup>
      <EmbeddedResource Update="@(EmbeddedResource)" Condition="'%(EmbeddedResource.NuGetPackageId)' == 'Microsoft.CodeAnalysis.Collections' AND '%(FileName)' == 'Strings'">
        <GenerateSource>true</GenerateSource>
        <Generator>MSBuild:_GenerateResxSource</Generator>
        <ClassName>Microsoft.CodeAnalysis.Collections.SR</ClassName>
      </EmbeddedResource>
    </ItemGroup>
  </Target>

{'fraction_non_alphanumeric': 0.14504771306350772, 'fraction_numerical': 0.03066798288910826, 'mean_word_length': 6.4820285573609056, 'pattern_counts': {'":': 0, '<': 235, '<?xml version=': 0, '>': 235, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7560142', 'n_tokens_mistral': 4887, 'n_tokens_neox': 4339, 'n_words': 731}