<commit_before><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Target Name="GetNuGetPackagesArchive"
            DependsOnTargets="SetupNuGetPackagesArchiveInputsOutputs;
                              DownloadNuGetPackagesArchive;
                              GenerateNuGetPackagesArchive;
                              UploadNuGetPackagesArchiveToAzure"
            Inputs="$(IntermediateArchive)"
            Outputs="$(FinalArchive)">
      <Copy SourceFiles="$(IntermediateArchive)" DestinationFiles="$(FinalArchive)" />
    </Target>

    <Target Name="UploadNuGetPackagesArchiveToAzure"
            DependsOnTargets="SetupNuGetPackagesArchiveInputsOutputs;
                              SetupAzureBlobInformation;
                              GenerateNuGetPackagesArchive"
            Condition=" '$(UploadNuGetPackagesArchiveToAzure)' == 'true' And  '$(PUBLISH_TO_AZURE_BLOB)' != '' ">
      <ItemGroup>
        <NuGetPackagesArchiveToUpload Include="$(IntermediateArchive)" />
      </ItemGroup>

      <ItemGroup>
        <NuGetPackagesArchiveToUpload>
          <RelativeBlobPath>$(CoreSetupChannel)/Binaries/$(SharedFrameworkVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
        </NuGetPackagesArchiveToUpload>
      </ItemGroup>

      <UploadToAzure
        AccountKey="$(ArtifactCloudDropAccessToken)"
        AccountName="$(ArtifactCloudDropAccountName)"
        ContainerName="$(ArtifactContainerName)"
        Items="@(NuGetPackagesArchiveToUpload)"
        Overwrite="false"
        ContinueOnError="WarnAndContinue" />
    </Target>

    <Target Name="DownloadNuGetPackagesArchive"
            DependsOnTargets="SetupNuGetPackagesArchiveInputsOutputs"
            Inputs="$(IntermediateArchive)"
            Outputs="$(IntermediateArchive)">
      <DownloadFile Uri="$(NugetPackagesArchiveBlobUrl)"
                    DestinationPath="$(IntermediateArchive)"
                    ContinueOnError="WarnAndContinue" />
    </Target>

    <Target Name="GenerateNuGetPackagesArchive"
            DependsOnTargets="SetupNuGetPackagesArchiveInputsOutputs"
            Inputs="$(IntermediateArchive)"
            Outputs="$(IntermediateArchive)">
      <PropertyGroup>
        <UploadNuGetPackagesArchiveToAzure>true</UploadNuGetPackagesArchiveToAzure>
      </PropertyGroup>

      <ItemGroup>
        <FilesToClean Include="$(NuGetPackagesArchiveProject)/**/*" />
        <FilesToClean Include="$(NuGetPackagesArchiveFolder)/**/*" />
      </ItemGroup>

      <Delete Files="@(FilesToClean)" />
      <RemoveDir Directories="$(NuGetPackagesArchiveProject);$(NuGetPackagesArchiveFolder)" />
      <MakeDir Directories="$(NuGetPackagesArchiveProject);$(NuGetPackagesArchiveFolder)"/>

      <DotNetNew ToolPath="$(Stage2Directory)"
                 TemplateType="Web"
                 WorkingDirectory="$(NuGetPackagesArchiveProject)" />

      <DotNetRestore ToolPath="$(Stage2Directory)"
                     Packages="$(NuGetPackagesArchiveFolder)"
                     SkipInvalidConfigurations="True"<commit_msg>Skip uploading archive if it already exists (#5170)<commit_after><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Target Name="GetNuGetPackagesArchive"
            DependsOnTargets="SetupNuGetPackagesArchiveInputsOutputs;
                              DownloadNuGetPackagesArchive;
                              GenerateNuGetPackagesArchive;
                              UploadNuGetPackagesArchiveToAzure"
            Inputs="$(IntermediateArchive)"
            Outputs="$(FinalArchive)">
      <Copy SourceFiles="$(IntermediateArchive)" DestinationFiles="$(FinalArchive)" />
    </Target>

    <Target Name="UploadNuGetPackagesArchiveToAzure"
            DependsOnTargets="SetupNuGetPackagesArchiveInputsOutputs;
                              SetupAzureBlobInformation;
                              GenerateNuGetPackagesArchive"
            Condition=" '$(UploadNuGetPackagesArchiveToAzure)' == 'true' And  '$(PUBLISH_TO_AZURE_BLOB)' != '' ">
      <ItemGroup>
        <NuGetPackagesArchiveToUpload Include="$(IntermediateArchive)" />
      </ItemGroup>

      <ItemGroup>
        <NuGetPackagesArchiveToUpload>
          <RelativeBlobPath>$(CoreSetupChannel)/Binaries/$(SharedFrameworkVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
        </NuGetPackagesArchiveToUpload>
      </ItemGroup>

      <UploadToAzure
        AccountKey="$(ArtifactCloudDropAccessToken)"
        AccountName="$(ArtifactCloudDropAccountName)"
        ContainerName="$(ArtifactContainerName)"
        Items="@(NuGetPackagesArchiveToUpload)"
        Overwrite="false"
        ContinueOnError="WarnAndContinue" />
    </Target>

    <Target Name="DownloadNuGetPackagesArchive"
            DependsOnTargets="SetupNuGetPackagesArchiveInputsOutputs"
            Inputs="$(IntermediateArchive)"
            Outputs="$(IntermediateArchive)">
      <DownloadFile Uri="$(NugetPackagesArchiveBlobUrl)"
                    DestinationPath="$(IntermediateArchive)"
                    ContinueOnError="WarnAndContinue" />
    </Target>

    <PropertyGroup>
      <UploadNuGetPackagesArchiveToAzure>false</UploadNuGetPackagesArchiveToAzure>
    </PropertyGroup>

    <Target Name="GenerateNuGetPackagesArchive"
            DependsOnTargets="SetupNuGetPackagesArchiveInputsOutputs"
            Inputs="$(IntermediateArchive)"
            Outputs="$(IntermediateArchive)">

      <!-- I need to use the CreateProperty task in conjunction with the ValueSetByTask TaskParameter -->
      <!-- to ensure that the property only gets set when the parent target is run. -->
      <CreateProperty Value="true">
        <Output TaskParameter="ValueSetByTask" PropertyName="UploadNuGetPackagesArchiveToAzure" />
      </CreateProperty>

      <ItemGroup>
        <FilesToClean Include="$(NuGetPackagesArchiveProject)/**/*" />
        <FilesToClean Include="$(NuGetPackagesArchiveFolder)/**/*" />
      </ItemGroup>

      <Delete Files="@(FilesToClean)" />
      <RemoveDir Directories="$(NuGetPackagesArchiveProject);$(NuGetPackagesArchiveFolder)" />
      <MakeDir Directories="$(NuGetPackagesArchiveProject);$(NuGetPackagesArchiveFolder)"/>

      <DotNetNew ToolPath="$(Stage2Directory)"
                 TemplateType="Web"
                 WorkingDirectory="$(NuGetPackagesArchiveProject)" />

      <DotNetRestore ToolPath="$(Stage2Directory)"
                     Packages="$(NuGetPackagesArchiveFolder)"
                     SkipInvalidConfigurations="True"
{'fraction_non_alphanumeric': 0.11790068391317277, 'fraction_numerical': 0.004162949747249479, 'mean_word_length': 3.1143730886850154, 'pattern_counts': {'":': 0, '<': 76, '<?xml version=': 2, '>': 74, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4328672', 'n_tokens_mistral': 1921, 'n_tokens_neox': 1644, 'n_words': 207}