<commit_before><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    
    <!-- Thanks to <NAME> (https://github.com/dotnet/sdk/issues/1151#issuecomment-385133284) -->
    <PropertyGroup>
        <ReplacePackageReferences Condition="$(ReplacePackageReferences) == ''">true</ReplacePackageReferences>
        <SolutionPath>$(MSBuildThisFileDirectory)\nuke.sln</SolutionPath>
    </PropertyGroup>

    <Choose>  
        <When Condition="$(ReplacePackageReferences) AND '$(SolutionPath)' != '' AND '$(SolutionPath)' != '*undefined*' AND Exists('$(SolutionPath)')">
        
        <PropertyGroup>
            <SolutionFileContent>$([System.IO.File]::ReadAllText($(SolutionPath)))</SolutionFileContent>
            <SmartSolutionDir>$([System.IO.Path]::GetDirectoryName( $(SolutionPath) ))</SmartSolutionDir>
            <RegexPattern>(?&lt;="[PackageName]", ")(.*)(?=", ")</RegexPattern>
        </PropertyGroup>
        
        <ItemGroup>
            <!-- Keep the identity of the package reference -->
            <SmartPackageReference Include="@(PackageReference)">
            <PackageName>%(Identity)</PackageName>
            <InSolution>$(SolutionFileContent.Contains('\%(Identity).csproj'))</InSolution>
            </SmartPackageReference>

            <!-- Filter them by mapping them to another itemGroup using the WithMetadataValue item function -->
            <PackageInSolution Include="@(SmartPackageReference -> WithMetadataValue('InSolution', True) )">
            <Pattern>$(RegexPattern.Replace('[PackageName]','%(PackageName)') )</Pattern>
            <SmartPath>$([System.Text.RegularExpressions.Regex]::Match( '$(SolutionFileContent)', '%(Pattern)' ))</SmartPath>
            </PackageInSolution>
            
            <ProjectReference  Include="@(PackageInSolution -> '$(SmartSolutionDir)\%(SmartPath)' )"/>

            <!-- Remove the package references that are now referenced as projects -->
            <PackageReference Remove="@(PackageInSolution -> '%(PackageName)' )"/>
        </ItemGroup>

        </When>
    </Choose>

</Project><commit_msg>Change ReplacePackageReferences to default to false<commit_after><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

    <!-- Thanks to <NAME> (https://github.com/dotnet/sdk/issues/1151#issuecomment-385133284) -->
    <PropertyGroup>
        <ReplacePackageReferences Condition="$(ReplacePackageReferences) == ''">false</ReplacePackageReferences>
        <SolutionPath>$(MSBuildThisFileDirectory)\nuke.sln</SolutionPath>
    </PropertyGroup>

    <Choose>
        <When Condition="$(ReplacePackageReferences) AND '$(SolutionPath)' != '' AND '$(SolutionPath)' != '*undefined*' AND Exists('$(SolutionPath)')">

        <PropertyGroup>
            <SolutionFileContent>$([System.IO.File]::ReadAllText($(SolutionPath)))</SolutionFileContent>
            <SmartSolutionDir>$([System.IO.Path]::GetDirectoryName( $(SolutionPath) ))</SmartSolutionDir>
            <RegexPattern>(?&lt;="[PackageName]", ")(.*)(?=", ")</RegexPattern>
        </PropertyGroup>

        <ItemGroup>
            <!-- Keep the identity of the package reference -->
            <SmartPackageReference Include="@(PackageReference)">
            <PackageName>%(Identity)</PackageName>
            <InSolution>$(SolutionFileContent.Contains('\%(Identity).csproj'))</InSolution>
            </SmartPackageReference>

            <!-- Filter them by mapping them to another itemGroup using the WithMetadataValue item function -->
            <PackageInSolution Include="@(SmartPackageReference -> WithMetadataValue('InSolution', True) )">
            <Pattern>$(RegexPattern.Replace('[PackageName]','%(PackageName)') )</Pattern>
            <SmartPath>$([System.Text.RegularExpressions.Regex]::Match( '$(SolutionFileContent)', '%(Pattern)' ))</SmartPath>
            </PackageInSolution>

            <ProjectReference  Include="@(PackageInSolution -> '$(SmartSolutionDir)\%(SmartPath)' )"/>

            <!-- Remove the package references that are now referenced as projects -->
            <PackageReference Remove="@(PackageInSolution -> '%(PackageName)' )"/>
        </ItemGroup>

        </When>
    </Choose>

</Project>
{'fraction_non_alphanumeric': 0.16876286302309626, 'fraction_numerical': 0.010061742510862108, 'mean_word_length': 3.490759753593429, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 2, '>': 93, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, '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': '3791522', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1101, 'n_words': 188}