<commit_before><Project>

  <!--
  Copies the binaries of MSBuild to a bootstrap folder so we can rebuild msbuild with itself.
  On netcore and mono it performs a directory copy.
  On full framework it performs a more involved deployment.
   -->

  <PropertyGroup>
    <BootstrapDestination>$(ArtifactsBinDir)bootstrap\</BootstrapDestination>
    <BootstrapDestination Condition="'$(Platform)' == 'x64'">$(BootstrapDestination)$(Platform)\</BootstrapDestination>
    <BootstrapDestination>$(BootstrapDestination)$(TargetFramework.ToLowerInvariant())\MSBuild\</BootstrapDestination>

    <!-- TODO: Mono build should use BootstrapNetCore logic -->
    <BootstrapDependsOn Condition="$(TargetFramework.StartsWith('net4'))">BootstrapFull</BootstrapDependsOn>
    <BootstrapDependsOn Condition="!$(TargetFramework.StartsWith('net4'))">BootstrapNetCore</BootstrapDependsOn>

    <!-- Needed to ensure that RuntimeTargetsCopyLocalItems is populated for full framework -->
    <DisableRuntimeTargets>false</DisableRuntimeTargets>
  </PropertyGroup>

  <Target Name="Bootstrap" DependsOnTargets="$(BootstrapDependsOn)"
          AfterTargets="AfterBuild"
          Condition="'$(CreateBootstrap)' == 'true'"/>

  <Target Name="CleanBootstrapFolder">
    <!-- This sometimes fails so it might need be retried. -->
    <RemoveDir
            Directories="$(BootstrapDestination)"
            ContinueOnError="true"/>

  </Target>
  <Target Name="GatherNuGetDependencies" AfterTargets="ResolvePackageAssets">
    <ItemGroup>
        <!-- Collect known NuGet dependencies after resolving packages -->
        <_NuGetRuntimeDependencies Include="%(RuntimeCopyLocalItems.Identity)" Condition="'@(RuntimeCopyLocalItems->Contains('NuGet.'))' == 'True'" />
        <_NuGetRuntimeDependencies Include="%(RuntimeCopyLocalItems.Identity)" Condition="'@(RuntimeCopyLocalItems->Contains('Newtonsoft.Json'))' == 'True'" />
        <_NuGetRuntimeDependencies Include="%(RuntimeCopyLocalItems.Identity)" Condition="'@(RuntimeCopyLocalItems->Contains('NuGetSdkResolver'))' == 'True'" />

        <!-- NuGet.targets will be in the ResolvedRuntimeTargets ItemGroup -->
        <_NuGetRuntimeDependencies Include="%(RuntimeTargetsCopyLocalItems.Identity)" Condition="'@(RuntimeTargetsCopyLocalItems->Contains('NuGet.'))' == 'True'" />

        <_NuGetRuntimeDependencies Include="$(DOTNET_INSTALL_DIR)\sdk\$(DotNetCliVersion)\RuntimeIdentifierGraph.json" />
    </ItemGroup>
  </Target>

  <Target Name="RemoveExtraAssemblyReferences" BeforeTargets="ResolveAssemblyReferences">
    <!-- This is really hacky, but these references will cause issues when trying to 'build' this project.
         To acquire the NuGet binaries we depend on for local run-time ('bootstrap'), we we are using a PackageReference (to
         'NuGet.Build.Tasks' and 'Microsoft.Build.NuGetSdkResolver'). This has the advantage of using NuGets compatibility
         check to ensure we choose the right version of those assemblies. But, at 'bootstrap' time these runtime dependencies
         need to be in a specific location that does not mesh with NuGet. To resolve this, we include the default
         PackageReference assets but will remove them from the Reference ItemGroup before RAR runs and avoid the warnings -->
    <ItemGroup>
        <Reference Remove="%(Reference.Identity)" Condition="'@(Reference->Contains('Microsoft.Build'))' == 'True'" />
        <Reference Remove="%(Reference.Identity)" Condition="'@(Reference->Contains('NuGet.'))' == 'True'" />
        <Reference Remove="%(Reference.Identity)" Condition="'@(Reference->Contains('Newtonsoft.Json'))' == 'True'" />
        <Reference Remove="%(Reference.Identity)" Condition="'@(Reference->Contains('NuGetSdkResolver'))' == 'True'" />
    </ItemGroup>
  </Target>

  <Target Name="BootstrapFull" DependsOnTargets="CleanBootstrapFolder;SetBinPaths;GatherNuGetDependencies">
    <ItemGroup>
      <InstalledVersionedExtensions Include="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\**\*.targets" />
      <InstalledVersionedExtensions Include="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\**\*.props" />
      <SdkResolverFiles Include="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Bin\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver\**\*.*" />
      <NuGetSdkResolverManifest Include= "$(RepoRoot)src\MSBuild\SdkResolvers\VS\Microsoft.Build.NuGetSdkResolver.xml" Condition="'$(MonoBuild)' != 'true'" />
      <NuGetSdkResolverManifest Include= "$(RepoRoot)src\MSBuild\SdkResolvers\Standalone\Microsoft.Build.NuGetSdkResolver.xml" Condition="'$(MonoBuild)' == 'true'" />
      <InstalledSdks Include="$(DOTNET_INSTALL_DIR)\sdk\$(DotNetCliVersion)\Sdks\**\*.*" />
      <InstalledSdks Include="$(MSBuildBinPath)\Sdks\**\*" Condition="'$(MonoBuild)' == 'true'" />

      <InstalledStaticAnalysisTools Include="$(VsInstallRoot)\Team Tools\Static Analysis Tools\**\*.*" />

      <ShimTargets Include="Microsoft.Data.Entity.targets" />
      <ShimTargets Include="Microsoft.ServiceModel.targets" />
      <ShimTargets Include="Microsoft.WinFx.targets" />
      <ShimTargets Include="Microsoft.WorkflowBuildExtensions.targets" />
      <ShimTargets Include="Microsoft.Xaml.targets" />
      <ShimTargets Include="Workflow.Targets" />
      <ShimTargets Include="Workflow.VisualBasic.Targets" />

      <InstalledMicrosoftExtensions Include="$(MSBuildExtensionsPath)\Microsoft\**\*.*" />

      <InstalledNuGetFiles Include="$(MSBuildExtensionsPath)\Microsoft\NuGet\*" />

      <FreshlyBuiltBinaries Include="$(OutputPath)**\*.dll" />
      <FreshlyBuiltBinaries Include="$(OutputPath)**\*.exe" />
      <FreshlyBuiltBinaries Include="$(OutputPath)**\*.tlb" />
      <FreshlyBuiltBinaries Include="$(OutputPath)**\*.pdb" />
      <FreshlyBuiltBinaries Include="$(OutputPath)**\*.exe.config" />
      <FreshlyBuiltBinaries Include="$(OutputPath)**\*.dll.config" />

      <FreshlyBuiltBinariesx64 Include="$(X64BinPath)**\*.dll" />
      <FreshlyBuiltBinariesx64 Include="$(X64BinPath)**\*.exe" />
      <FreshlyBuiltBinariesx64 Include="$(MSBuildTaskHostX64BinPath)**\*.exe" />
      <FreshlyBuiltBinariesx64 Include="$(X64BinPath)**\*.tlb" />
      <FreshlyBuiltBinariesx64 Include="$(X64BinPath)**\*.pdb" />
      <FreshlyBuiltBinariesx64 Include="$(MSBuildTaskHostX64BinPath)**\*.pdb" />
      <FreshlyBuiltBinariesx64 Include="$(X64BinPath)**\*.exe.config" />
      <FreshlyBuiltBinariesx64 Include="$(MSBuildTaskHostX64BinPath)**\*.exe.config" />
      <FreshlyBuiltBinariesx64 Include="$(X64BinPath)**\*.dll.config" />

      <FreshlyBuiltRootProjects Include="$(OutputPath)Microsoft.Common.props" />
      <FreshlyBuiltRootProjects Include="$(OutputPath)Microsoft.VisualStudioVersion.*.Common.props" />
      <FreshlyBuiltProjects Include="$(OutputPath)**\*props" Exclude="@(FreshlyBuiltRootProjects)" />
      <FreshlyBuiltProjects Include="$(OutputPath)**\*targets" />
      <FreshlyBuiltProjects Include="$(OutputPath)**\*tasks" />
      <FreshlyBuiltProjects Include="$(OutputPath)**\*xml" />
      <RoslynBinaries Include="$(OutputPath)\..\..\15.0\Bin\Roslyn\**\*.*" />
    </ItemGroup>

    <!-- Copy in props and targets from the machine-installed MSBuildExtensionsPath -->
    <Copy SourceFiles="@(InstalledVersionedExtensions)"
          DestinationFiles="@(InstalledVersionedExtensions->'$(BootstrapDestination)$(TargetMSBuildToolsVersion)\%(RecursiveDir)%(Filename)%(Extension)')" />
    <Copy SourceFiles="@(SdkResolverFiles)"
          DestinationFiles="@(SdkResolverFiles->'$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver\%(RecursiveDir)%(Filename)%(Extension)')" />

    <Copy SourceFiles="@(InstalledMicrosoftExtensions)"
          DestinationFiles="@(InstalledMicrosoftExtensions->'$(BootstrapDestination)Microsoft\%(RecursiveDir)%(Filename)%(Extension)')" />

    <Copy SourceFiles="@(InstalledSdks)"
          DestinationFiles="@(InstalledSdks -> '$(BootstrapDestination)Sdks\%(RecursiveDir)%(Filename)%(Extension)')"
          Condition="'$(MonoBuild)' != 'true'" />
    <Copy SourceFiles="@(InstalledSdks)"
          DestinationFiles="@(InstalledSdks -> '$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\Sdks\%(RecursiveDir)%(Filename)%(Extension)')"
          Condition="'$(MonoBuild)' == 'true'" />

    <Copy SourceFiles="@(InstalledStaticAnalysisTools)"
          DestinationFiles="@(InstalledStaticAnalysisTools -> '$(BootstrapDestination)..\Team Tools\Static Analysis Tools\%(RecursiveDir)%(Filename)%(Extension)')" />

    <Copy SourceFiles="@(InstalledNuGetFiles)"
          DestinationFiles="@(InstalledNuGetFiles->'$(BootstrapDestination)Microsoft\NuGet\%(Filename)%(Extension)')" />

    <Copy Condition="'$(MonoBuild)' != 'true'"
          SourceFiles="@(_NuGetRuntimeDependencies)"
          DestinationFolder="$(BootstrapDestination)..\Common7\IDE\CommonExtensions\Microsoft\NuGet\" />
    <Copy Condition="'$(MonoBuild)' == 'true'"
          SourceFiles="@(_NuGetRuntimeDependencies)"
          DestinationFolder="$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin" />

    <Copy SourceFiles="@(NuGetSdkResolverManifest)"
          DestinationFolder="$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\SdkResolvers\Microsoft.Build.NuGetSdkResolver" />

    <!-- Delete shim projects, because they point where we can't follow. -->
    <!-- It would be better to just not copy these. -->
    <Delete Files="@(ShimTargets->'$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\%(FileName)%(Extension)')" />

    <!-- Copy our binaries -->
    <Copy SourceFiles="@(FreshlyBuiltBinaries)"
          DestinationFiles="@(FreshlyBuiltBinaries -> '$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\%(RecursiveDir)%(Filename)%(Extension)')" />
    <Copy SourceFiles="@(RoslynBinaries)"
          DestinationFiles="@(RoslynBinaries -> '$(BootstrapDestination)15.0\Bin\Roslyn\%(RecursiveDir)%(Filename)%(Extension)')" />

    <!-- Copy our binaries to the x64 location. -->
     <Copy SourceFiles="@(FreshlyBuiltBinariesx64)"
          DestinationFiles="@(FreshlyBuiltBinariesx64 -> '$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\amd64\%(RecursiveDir)%(Filename)%(Extension)')" />
    
    <!-- Copy our freshly-built props and targets, overwriting anything we copied from the machine -->
    <Copy SourceFiles="@(FreshlyBuiltRootProjects)"
          DestinationFiles="@(FreshlyBuiltRootProjects -> '$(BootstrapDestination)$(TargetMSBuildToolsVersion)\%(Filename)%(Extension)')" />
    <Copy SourceFiles="@(FreshlyBuiltProjects)"
          DestinationFiles="@(FreshlyBuiltProjects -> '$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\%(RecursiveDir)%(Filename)%(Extension)')" />
  </Target>

  <Target Name="BootstrapNetCore" DependsOnTargets="CleanBootstrapFolder">

    <!-- Publish the project first.  The more obvious way to do this would be to depend on the Publish target,
         but that causes a target dependency cycle, even though it seems like AfterTargets="AfterBuild" should
         probably not count as a link in the cycle. -->
    <MSBuild Projects="$(MSBuildProjectFile)" Targets="Publish" BuildInParallel="$(BuildInParallel)" />

    <ItemGroup>
      <!-- Copy all items from the publish folder to the bootstrap folder.  We might be able to just use the published
            version as the bootstrapped version, but the extra separation here seems like it could be valuable. -->
      <DeployedItems Include="$(PublishDir)\**\*.*" />

      <NuGetSdkResolverManifest Include= "$(RepoRoot)src\MSBuild\SdkResolvers\Standalone\Microsoft.Build.NuGetSdkResolver.xml" />
      <InstalledSdks Include="$(DOTNET_INSTALL_DIR)\sdk\$(DotNetCliVersion)\Sdks\**\*.*" />
      <InstalledExtensions Include="$(DOTNET_INSTALL_DIR)\sdk\$(DotNetCliVersion)\Current\**\*.*" Exclude="$(DOTNET_INSTALL_DIR)\sdk\$(DotNetCliVersion)\Current\Microsoft.Common.props" />
    </ItemGroup>
    <Copy SourceFiles="@(DeployedItems)"
          DestinationFolder="$(BootstrapDestination)%(RecursiveDir)" />

    <Copy SourceFiles="@(NuGetSdkResolverManifest)"
          DestinationFolder="$(BootstrapDestination)SdkResolvers\Microsoft.Build.NuGetSdkResolver" />

    <Copy SourceFiles="@(InstalledSdks)"
          DestinationFiles="@(InstalledSdks -> '$(BootstrapDestination)Sdks\%(RecursiveDir)%(Filename)%(Extension)')" />

    <Copy SourceFiles="@(InstalledExtensions)"
          DestinationFolder="$(BootstrapDestination)Current\%(RecursiveDir)" />

    <Copy SourceFiles="@(_NuGetRuntimeDependencies)"
          DestinationFolder="$(BootstrapDestination)" />
  </Target>
</Project>
<commit_msg>Copy build files to 64bit bootstrap directory (#5825)<commit_after><Project>

  <!--
  Copies the binaries of MSBuild to a bootstrap folder so we can rebuild msbuild with itself.
  On netcore and mono it performs a directory copy.
  On full framework it performs a more involved deployment.
   -->

  <PropertyGroup>
    <BootstrapDestination>$(ArtifactsBinDir)bootstrap\</BootstrapDestination>
    <BootstrapDestination Condition="'$(Platform)' == 'x64'">$(BootstrapDestination)$(Platform)\</BootstrapDestination>
    <BootstrapDestination>$(BootstrapDestination)$(TargetFramework.ToLowerInvariant())\MSBuild\</BootstrapDestination>

    <!-- TODO: Mono build should use BootstrapNetCore logic -->
    <BootstrapDependsOn Condition="$(TargetFramework.StartsWith('net4'))">BootstrapFull</BootstrapDependsOn>
    <BootstrapDependsOn Condition="!$(TargetFramework.StartsWith('net4'))">BootstrapNetCore</BootstrapDependsOn>

    <!-- Needed to ensure that RuntimeTargetsCopyLocalItems is populated for full framework -->
    <DisableRuntimeTargets>false</DisableRuntimeTargets>
  </PropertyGroup>

  <Target Name="Bootstrap" DependsOnTargets="$(BootstrapDependsOn)"
          AfterTargets="AfterBuild"
          Condition="'$(CreateBootstrap)' == 'true'"/>

  <Target Name="CleanBootstrapFolder">
    <!-- This sometimes fails so it might need be retried. -->
    <RemoveDir
            Directories="$(BootstrapDestination)"
            ContinueOnError="true"/>

  </Target>
  <Target Name="GatherNuGetDependencies" AfterTargets="ResolvePackageAssets">
    <ItemGroup>
        <!-- Collect known NuGet dependencies after resolving packages -->
        <_NuGetRuntimeDependencies Include="%(RuntimeCopyLocalItems.Identity)" Condition="'@(RuntimeCopyLocalItems->Contains('NuGet.'))' == 'True'" />
        <_NuGetRuntimeDependencies Include="%(RuntimeCopyLocalItems.Identity)" Condition="'@(RuntimeCopyLocalItems->Contains('Newtonsoft.Json'))' == 'True'" />
        <_NuGetRuntimeDependencies Include="%(RuntimeCopyLocalItems.Identity)" Condition="'@(RuntimeCopyLocalItems->Contains('NuGetSdkResolver'))' == 'True'" />

        <!-- NuGet.targets will be in the ResolvedRuntimeTargets ItemGroup -->
        <_NuGetRuntimeDependencies Include="%(RuntimeTargetsCopyLocalItems.Identity)" Condition="'@(RuntimeTargetsCopyLocalItems->Contains('NuGet.'))' == 'True'" />

        <_NuGetRuntimeDependencies Include="$(DOTNET_INSTALL_DIR)\sdk\$(DotNetCliVersion)\RuntimeIdentifierGraph.json" />
    </ItemGroup>
  </Target>

  <Target Name="RemoveExtraAssemblyReferences" BeforeTargets="ResolveAssemblyReferences">
    <!-- This is really hacky, but these references will cause issues when trying to 'build' this project.
         To acquire the NuGet binaries we depend on for local run-time ('bootstrap'), we we are using a PackageReference (to
         'NuGet.Build.Tasks' and 'Microsoft.Build.NuGetSdkResolver'). This has the advantage of using NuGets compatibility
         check to ensure we choose the right version of those assemblies. But, at 'bootstrap' time these runtime dependencies
         need to be in a specific location that does not mesh with NuGet. To resolve this, we include the default
         PackageReference assets but will remove them from the Reference ItemGroup before RAR runs and avoid the warnings -->
    <ItemGroup>
        <Reference Remove="%(Reference.Identity)" Condition="'@(Reference->Contains('Microsoft.Build'))' == 'True'" />
        <Reference Remove="%(Reference.Identity)" Condition="'@(Reference->Contains('NuGet.'))' == 'True'" />
        <Reference Remove="%(Reference.Identity)" Condition="'@(Reference->Contains('Newtonsoft.Json'))' == 'True'" />
        <Reference Remove="%(Reference.Identity)" Condition="'@(Reference->Contains('NuGetSdkResolver'))' == 'True'" />
    </ItemGroup>
  </Target>

  <Target Name="BootstrapFull" DependsOnTargets="CleanBootstrapFolder;SetBinPaths;GatherNuGetDependencies">
    <ItemGroup>
      <InstalledVersionedExtensions Include="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\**\*.targets" />
      <InstalledVersionedExtensions Include="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\**\*.props" />
      <SdkResolverFiles Include="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Bin\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver\**\*.*" />
      <NuGetSdkResolverManifest Include= "$(RepoRoot)src\MSBuild\SdkResolvers\VS\Microsoft.Build.NuGetSdkResolver.xml" Condition="'$(MonoBuild)' != 'true'" />
      <NuGetSdkResolverManifest Include= "$(RepoRoot)src\MSBuild\SdkResolvers\Standalone\Microsoft.Build.NuGetSdkResolver.xml" Condition="'$(MonoBuild)' == 'true'" />
      <InstalledSdks Include="$(DOTNET_INSTALL_DIR)\sdk\$(DotNetCliVersion)\Sdks\**\*.*" />
      <InstalledSdks Include="$(MSBuildBinPath)\Sdks\**\*" Condition="'$(MonoBuild)' == 'true'" />

      <InstalledStaticAnalysisTools Include="$(VsInstallRoot)\Team Tools\Static Analysis Tools\**\*.*" />

      <ShimTargets Include="Microsoft.Data.Entity.targets" />
      <ShimTargets Include="Microsoft.ServiceModel.targets" />
      <ShimTargets Include="Microsoft.WinFx.targets" />
      <ShimTargets Include="Microsoft.WorkflowBuildExtensions.targets" />
      <ShimTargets Include="Microsoft.Xaml.targets" />
      <ShimTargets Include="Workflow.Targets" />
      <ShimTargets Include="Workflow.VisualBasic.Targets" />

      <InstalledMicrosoftExtensions Include="$(MSBuildExtensionsPath)\Microsoft\**\*.*" />

      <InstalledNuGetFiles Include="$(MSBuildExtensionsPath)\Microsoft\NuGet\*" />

      <FreshlyBuiltBinaries Include="$(OutputPath)**\*.dll" />
      <FreshlyBuiltBinaries Include="$(OutputPath)**\*.exe" />
      <FreshlyBuiltBinaries Include="$(OutputPath)**\*.tlb" />
      <FreshlyBuiltBinaries Include="$(OutputPath)**\*.pdb" />
      <FreshlyBuiltBinaries Include="$(OutputPath)**\*.exe.config" />
      <FreshlyBuiltBinaries Include="$(OutputPath)**\*.dll.config" />

      <FreshlyBuiltBinariesx64 Include="$(X64BinPath)**\*.dll" />
      <FreshlyBuiltBinariesx64 Include="$(X64BinPath)**\*.exe" />
      <FreshlyBuiltBinariesx64 Include="$(MSBuildTaskHostX64BinPath)**\*.exe" />
      <FreshlyBuiltBinariesx64 Include="$(X64BinPath)**\*.tlb" />
      <FreshlyBuiltBinariesx64 Include="$(X64BinPath)**\*.pdb" />
      <FreshlyBuiltBinariesx64 Include="$(MSBuildTaskHostX64BinPath)**\*.pdb" />
      <FreshlyBuiltBinariesx64 Include="$(X64BinPath)**\*.exe.config" />
      <FreshlyBuiltBinariesx64 Include="$(MSBuildTaskHostX64BinPath)**\*.exe.config" />
      <FreshlyBuiltBinariesx64 Include="$(X64BinPath)**\*.dll.config" />

      <FreshlyBuiltRootProjects Include="$(OutputPath)Microsoft.Common.props" />
      <FreshlyBuiltRootProjects Include="$(OutputPath)Microsoft.VisualStudioVersion.*.Common.props" />
      <FreshlyBuiltProjects Include="$(OutputPath)**\*props" Exclude="@(FreshlyBuiltRootProjects)" />
      <FreshlyBuiltProjects Include="$(OutputPath)**\*targets" />
      <FreshlyBuiltProjects Include="$(OutputPath)**\*tasks" />
      <FreshlyBuiltProjects Include="$(OutputPath)**\*xml" />
      <RoslynBinaries Include="$(OutputPath)\..\..\15.0\Bin\Roslyn\**\*.*" />
    </ItemGroup>

    <!-- Copy in props and targets from the machine-installed MSBuildExtensionsPath -->
    <Copy SourceFiles="@(InstalledVersionedExtensions)"
          DestinationFiles="@(InstalledVersionedExtensions->'$(BootstrapDestination)$(TargetMSBuildToolsVersion)\%(RecursiveDir)%(Filename)%(Extension)')" />
    <Copy SourceFiles="@(SdkResolverFiles)"
          DestinationFiles="@(SdkResolverFiles->'$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver\%(RecursiveDir)%(Filename)%(Extension)')" />

    <Copy SourceFiles="@(InstalledMicrosoftExtensions)"
          DestinationFiles="@(InstalledMicrosoftExtensions->'$(BootstrapDestination)Microsoft\%(RecursiveDir)%(Filename)%(Extension)')" />

    <Copy SourceFiles="@(InstalledSdks)"
          DestinationFiles="@(InstalledSdks -> '$(BootstrapDestination)Sdks\%(RecursiveDir)%(Filename)%(Extension)')"
          Condition="'$(MonoBuild)' != 'true'" />
    <Copy SourceFiles="@(InstalledSdks)"
          DestinationFiles="@(InstalledSdks -> '$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\Sdks\%(RecursiveDir)%(Filename)%(Extension)')"
          Condition="'$(MonoBuild)' == 'true'" />

    <Copy SourceFiles="@(InstalledStaticAnalysisTools)"
          DestinationFiles="@(InstalledStaticAnalysisTools -> '$(BootstrapDestination)..\Team Tools\Static Analysis Tools\%(RecursiveDir)%(Filename)%(Extension)')" />

    <Copy SourceFiles="@(InstalledNuGetFiles)"
          DestinationFiles="@(InstalledNuGetFiles->'$(BootstrapDestination)Microsoft\NuGet\%(Filename)%(Extension)')" />

    <Copy Condition="'$(MonoBuild)' != 'true'"
          SourceFiles="@(_NuGetRuntimeDependencies)"
          DestinationFolder="$(BootstrapDestination)..\Common7\IDE\CommonExtensions\Microsoft\NuGet\" />
    <Copy Condition="'$(MonoBuild)' == 'true'"
          SourceFiles="@(_NuGetRuntimeDependencies)"
          DestinationFolder="$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin" />

    <Copy SourceFiles="@(NuGetSdkResolverManifest)"
          DestinationFolder="$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\SdkResolvers\Microsoft.Build.NuGetSdkResolver" />

    <!-- Delete shim projects, because they point where we can't follow. -->
    <!-- It would be better to just not copy these. -->
    <Delete Files="@(ShimTargets->'$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\%(FileName)%(Extension)')" />

    <!-- Copy our binaries -->
    <Copy SourceFiles="@(FreshlyBuiltBinaries)"
          DestinationFiles="@(FreshlyBuiltBinaries -> '$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\%(RecursiveDir)%(Filename)%(Extension)')" />
    <Copy SourceFiles="@(RoslynBinaries)"
          DestinationFiles="@(RoslynBinaries -> '$(BootstrapDestination)15.0\Bin\Roslyn\%(RecursiveDir)%(Filename)%(Extension)')" />

    <!-- Copy our binaries to the x64 location. -->
     <Copy SourceFiles="@(FreshlyBuiltBinariesx64)"
          DestinationFiles="@(FreshlyBuiltBinariesx64 -> '$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\amd64\%(RecursiveDir)%(Filename)%(Extension)')" />
    
    <!-- Copy our freshly-built props and targets, overwriting anything we copied from the machine -->
    <Copy SourceFiles="@(FreshlyBuiltRootProjects)"
          DestinationFiles="@(FreshlyBuiltRootProjects -> '$(BootstrapDestination)$(TargetMSBuildToolsVersion)\%(Filename)%(Extension)')" />
    <Copy SourceFiles="@(FreshlyBuiltProjects)"
          DestinationFiles="@(FreshlyBuiltProjects -> '$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\%(RecursiveDir)%(Filename)%(Extension)')" />
    <Copy SourceFiles="@(FreshlyBuiltProjects)"
          DestinationFiles="@(FreshlyBuiltProjects -> '$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\amd64\%(RecursiveDir)%(Filename)%(Extension)')" />

  </Target>

  <Target Name="BootstrapNetCore" DependsOnTargets="CleanBootstrapFolder">

    <!-- Publish the project first.  The more obvious way to do this would be to depend on the Publish target,
         but that causes a target dependency cycle, even though it seems like AfterTargets="AfterBuild" should
         probably not count as a link in the cycle. -->
    <MSBuild Projects="$(MSBuildProjectFile)" Targets="Publish" BuildInParallel="$(BuildInParallel)" />

    <ItemGroup>
      <!-- Copy all items from the publish folder to the bootstrap folder.  We might be able to just use the published
            version as the bootstrapped version, but the extra separation here seems like it could be valuable. -->
      <DeployedItems Include="$(PublishDir)\**\*.*" />

      <NuGetSdkResolverManifest Include= "$(RepoRoot)src\MSBuild\SdkResolvers\Standalone\Microsoft.Build.NuGetSdkResolver.xml" />
      <InstalledSdks Include="$(DOTNET_INSTALL_DIR)\sdk\$(DotNetCliVersion)\Sdks\**\*.*" />
      <InstalledExtensions Include="$(DOTNET_INSTALL_DIR)\sdk\$(DotNetCliVersion)\Current\**\*.*" Exclude="$(DOTNET_INSTALL_DIR)\sdk\$(DotNetCliVersion)\Current\Microsoft.Common.props" />
    </ItemGroup>
    <Copy SourceFiles="@(DeployedItems)"
          DestinationFolder="$(BootstrapDestination)%(RecursiveDir)" />

    <Copy SourceFiles="@(NuGetSdkResolverManifest)"
          DestinationFolder="$(BootstrapDestination)SdkResolvers\Microsoft.Build.NuGetSdkResolver" />

    <Copy SourceFiles="@(InstalledSdks)"
          DestinationFiles="@(InstalledSdks -> '$(BootstrapDestination)Sdks\%(RecursiveDir)%(Filename)%(Extension)')" />

    <Copy SourceFiles="@(InstalledExtensions)"
          DestinationFolder="$(BootstrapDestination)Current\%(RecursiveDir)" />

    <Copy SourceFiles="@(_NuGetRuntimeDependencies)"
          DestinationFolder="$(BootstrapDestination)" />
  </Target>
</Project>

{'fraction_non_alphanumeric': 0.15664773839827686, 'fraction_numerical': 0.0046211082827491675, 'mean_word_length': 4.988742964352721, 'pattern_counts': {'":': 0, '<': 254, '<?xml version=': 0, '>': 299, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '2201290', 'n_tokens_mistral': 7704, 'n_tokens_neox': 6959, 'n_words': 1159}