<commit_before><Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!-- ====================================================================================
  
         Support for rolling optimization data into assemblies.

       ==================================================================================== -->

  <PropertyGroup>
    <OptimizationDataFolderPath>$(MSBuildThisFileDirectory)..\..\Closed\OptimizationData</OptimizationDataFolderPath>
    <OptimizationDataFile>$([System.IO.Path]::GetFullPath('$(OptimizationDataFolderPath)\$(TargetName).pgo'))</OptimizationDataFile>
    <IbcMergePath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\Closed\Tools\ibcmerge\ibcmerge.exe'))</IbcMergePath>
  </PropertyGroup>

  <Target Name="ApplyOptimizations"
          Condition="'$(Configuration)' == 'Release' AND '$(NonShipping)' != 'true' AND '$(SkipApplyOptimizations)' != 'true' AND Exists('$(OptimizationDataFile)')"
          DependsOnTargets="CoreCompile"
          Inputs="@(IntermediateAssembly)"
          Outputs="@(IntermediateAssembly);@(IntermediateAssembly->'%(RootDir)%(Directory)%(Filename).ibcmerge.timestamp')">

    <Message Text="Adding optimization data to @(IntermediateAssembly)"/>
    <Exec Command="&quot;$(IbcMergePath)&quot; -q -f -partialNGEN -minify -mo &quot;@(IntermediateAssembly)&quot; -incremental &quot;$(OptimizationDataFile)&quot;" />

    <Message Text="Re-signing after merging optimization data" Condition="'$(DelaySign)' != 'true' AND '$(SignAssembly)' == 'true'" />
    <Exec Command="&quot;$(SnToolPath)&quot; -q -R &quot;@(IntermediateAssembly)&quot; &quot;$(AssemblyOriginatorKeyFile)&quot;" Condition="'$(DelaySign)' != 'true' AND '$(SignAssembly)' == 'true'" />

    <!-- Write out a sentinel timestamp file. Since the rewrite happens in-place, this extra output enables incremental build to work. -->
    <Touch AlwaysCreate="true" Files="@(IntermediateAssembly->'%(RootDir)%(Directory)%(Filename).ibcmerge.timestamp')" />

  </Target>

  <Target Name="CleanApplyOptimizations">
    <Delete Files="@(IntermediateAssembly->'%(RootDir)%(Directory)%(Filename).ibcmerge.timestamp')" />
  </Target>

  <Target Name="CreateAndSignPhoneCopy" 
          Condition="'$(NeedsPhoneCopy)' == 'true'"
          DependsOnTargets="Compile"
          BeforeTargets="SignVsixInputs"
          Inputs="@(IntermediateAssembly)"
          Outputs="$(OutDir)Phone\%(Filename)%(Extension)">
    <Copy SourceFiles="@(IntermediateAssembly)"
        DestinationFolder="$(OutDir)Phone" />

    <ItemGroup Condition="'$(ShouldSignBuild)' == 'true'">
        <PhoneAssembliesToSign Include="$(OutDir)Phone\%(IntermediateAssembly.Filename)%(IntermediateAssembly.Extension)">
            <Authenticode>WindowsPhone623</Authenticode>
            <StrongName>72</StrongName>
        </PhoneAssembliesToSign>
    </ItemGroup>

    <Message Condition="'$(ShouldSignBuild)' == 'true'"
             Text="Signing phone assemblies: using authenticode certificate '%(PhoneAssembliesToSign.Authenticode)' for @(PhoneAssembliesToSign)"/>
    
    <SignFiles Condition="'$(ShouldSignBuild)' == 'true'"
               Files="@(PhoneAssembliesToSign)" 
               IntermediatesDirectory="$(IntermediateOutputPath)"
               BinariesDirectory="$(OutDir)Phone" 
               Type="$(SignType)" />
  </Target>

  <Target Name="CleanPhoneCopy">
    <RemoveDir Directories="$(OutDir)Phone')" />
  </Target>

  <PropertyGroup>
    <CompileDependsOn>$(CompileDependsOn);ApplyOptimizations</CompileDependsOn>
    <CleanDependsOn>$(CleanDependsOn);CleanApplyOptimizations;CleanPhoneCopy</CleanDependsOn>
  </PropertyGroup>

  <!-- ====================================================================================
  
         Support for signing files that are in VSIXes, and also signing the resulting package

       ==================================================================================== -->

  <PropertyGroup>
    <RunningInMicroBuild Condition="Exists('$(TF_BUILD_BUILDDIRECTORY)\MicroBuild\MicroBuild.Signing.dll')">true</RunningInMicroBuild>
    <ShouldSignBuild Condition="'$(RealSignBuild)' == 'true' OR ('$(RunningInMicroBuild)' == 'true' AND '$(SignType)' == 'real')">true</ShouldSignBuild>
    <CompileDependsOn>$(CompileDependsOn);FakeSignAssembly</CompileDependsOn>
    <FakeSignSentinelFile>$(IntermediateOutputPath)$(TargetFileName).fakesign</FakeSignSentinelFile>
    <FakeSignToolPath>$(OutputPath)FakeSign.exe</FakeSignToolPath>
  </PropertyGroup>

  <Target Name="FakeSignAssembly"
          Condition="'$(DelaySign)' == 'true' AND '$(ShouldSignBuild)' != 'true' AND ('$(Language)' == 'C#' OR '$(Language)' == 'VB')"
          DependsOnTargets="CoreCompile"
          Inputs="$(IntermediateOutputPath)$(TargetFileName)"
          Outputs="$(FakeSignSentinelFile)">
    <Exec Command="$(FakeSignToolPath) &quot;$(IntermediateOutputPath)$(TargetFileName)&quot;" />
    <Touch Files="$(FakeSignSentinelFile)" AlwaysCreate="true" />
  </Target>
  
  <UsingTask TaskName="SignFiles" AssemblyFile="$(TF_BUILD_BUILDDIRECTORY)\MicroBuild\MicroBuild.Signing.dll" Condition="'$(RunningInMicroBuild)' == 'true'" />
  
  <PropertyGroup>
    <CreateVsixContainerDependsOn>$(CreateVsixContainerDependsOn);SignVsixInputs</CreateVsixContainerDependsOn>
    <PrepareForRunDependsOn>$(PrepareForRunDependsOn);SignVsix</PrepareForRunDependsOn>
    <ProducingSignedVsix Condition="'$(ShouldSignBuild)' == 'true' AND '$(NonShipping)' != 'true' AND '$(CreateVsixContainer)' == 'true'">true</ProducingSignedVsix>
  </PropertyGroup>
  
  <!-- GetTargetPath returns the path under $(OutDir) for each project.
       This target adds the $(AuthenticodeCertificateName) as metadata. -->
  <Target Name="GetTargetPathWithAuthenticodeCertificateName" DependsOnTargets="GetTargetPath" Returns="@(TargetPathWithAuthenticodeCertificateName)">
    <ItemGroup>
      <TargetPathWithAuthenticodeCertificateName Include="$(TargetPath)">
        <AuthenticodeCertificateName>$(AuthenticodeCertificateName)</AuthenticodeCertificateName>
      </TargetPathWithAuthenticodeCertificateName>
    </ItemGroup>
  </Target>

  <Target Name="SignVsixInputs" Condition="'$(ProducingSignedVsix)' == 'true'" DependsOnTargets="GetVsixSourceItems" BeforeTargets="CopyFilesToOutputDirectory">
    <!-- Ensure the build tasks project is already built -->
    <MSBuild Projects="$(MSBuildThisFileDirectory)..\..\Closed\Setup\BuildTasks\BuildTasks.vbproj" Condition="!Exists('$(OutDir)\Roslyn.Setup.BuildTasks.dll') AND '$(RunningInMicroBuild)' != 'true'" />
    
    <!-- Collect the paths of all dependent projects. GetTargetPath returns the path under $(OutDir) for each project. -->
    <MSBuild Projects="@(ProjectReferenceWithConfiguration)"
             Targets="GetTargetPathWithAuthenticodeCertificateName"
             BuildInParallel="$(BuildInParallel)"
             Properties="%(ProjectReferenceWithConfiguration.SetConfiguration); %(ProjectReferenceWithConfiguration.SetPlatform)">

      <Output TaskParameter="TargetOutputs" ItemName="VsixInputAssembliesToSign" />
    </MSBuild>

    <!-- Include the assembly we just built if we're also including it in the VSIX-->
    <ItemGroup>
      <VsixInputAssembliesToSign Include="@(IntermediateAssembly)" Condition="'$(IncludeAssemblyInVSIXContainer)' == 'true'">
        <AuthenticodeCertificateName>$(AuthenticodeCertificateName)</AuthenticodeCertificateName>
      </VsixInputAssembliesToSign>
    </ItemGroup>
    
    <Message Text="Signing VSIX inputs: using authenticode certificate '%(VsixInputAssembliesToSign.AuthenticodeCertificateName)' for @(VsixInputAssembliesToSign)"/>

    <ItemGroup Condition="'$(RunningInMicroBuild)' == 'true'">
        <VsixInputAssembliesToSign>
            <Authenticode>%(VsixInputAssembliesToSign.AuthenticodeCertificateName)</Authenticode>
            <StrongName>72</StrongName>
        </VsixInputAssembliesToSign>
    </ItemGroup>

    <SignFiles Condition="'$(RunningInMicroBuild)' == 'true'"
               Files="@(VsixInputAssembliesToSign)" 
               BinariesDirectory="$(OutDir)" 
               IntermediatesDirectory="$(IntermediateOutputPath)"
               Type="$(SignType)" />
  </Target>

  <Target Name="SignVsix"  Condition="'$(ProducingSignedVsix)' == 'true'" DependsOnTargets="CreateVsixContainer">
    <Message Text="Signing VSIX: $(TargetVsixContainer)"/>

    <ItemGroup Condition="'$(RunningInMicroBuild)' == 'true'">
        <VsixToSign Include="$(TargetVsixContainer)">
            <Authenticode>Vsix</Authenticode>
        </VsixToSign>
    </ItemGroup>
    
    <SignFiles Condition="'$(RunningInMicroBuild)' == 'true'"
               Files="@(VsixToSign)" 
               BinariesDirectory="$(OutDir)" 
               IntermediatesDirectory="$(IntermediateOutputPath)"
               Type="$(SignType)" />
  </Target>
 </Project>
<commit_msg>Fix amd64 build: FakeSign is built into the x86 binaries path. (changeset 1400156)<commit_after><Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!-- ====================================================================================
  
         Support for rolling optimization data into assemblies.

       ==================================================================================== -->

  <PropertyGroup>
    <OptimizationDataFolderPath>$(MSBuildThisFileDirectory)..\..\Closed\OptimizationData</OptimizationDataFolderPath>
    <OptimizationDataFile>$([System.IO.Path]::GetFullPath('$(OptimizationDataFolderPath)\$(TargetName).pgo'))</OptimizationDataFile>
    <IbcMergePath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\Closed\Tools\ibcmerge\ibcmerge.exe'))</IbcMergePath>
  </PropertyGroup>

  <Target Name="ApplyOptimizations"
          Condition="'$(Configuration)' == 'Release' AND '$(NonShipping)' != 'true' AND '$(SkipApplyOptimizations)' != 'true' AND Exists('$(OptimizationDataFile)')"
          DependsOnTargets="CoreCompile"
          Inputs="@(IntermediateAssembly)"
          Outputs="@(IntermediateAssembly);@(IntermediateAssembly->'%(RootDir)%(Directory)%(Filename).ibcmerge.timestamp')">

    <Message Text="Adding optimization data to @(IntermediateAssembly)"/>
    <Exec Command="&quot;$(IbcMergePath)&quot; -q -f -partialNGEN -minify -mo &quot;@(IntermediateAssembly)&quot; -incremental &quot;$(OptimizationDataFile)&quot;" />

    <Message Text="Re-signing after merging optimization data" Condition="'$(DelaySign)' != 'true' AND '$(SignAssembly)' == 'true'" />
    <Exec Command="&quot;$(SnToolPath)&quot; -q -R &quot;@(IntermediateAssembly)&quot; &quot;$(AssemblyOriginatorKeyFile)&quot;" Condition="'$(DelaySign)' != 'true' AND '$(SignAssembly)' == 'true'" />

    <!-- Write out a sentinel timestamp file. Since the rewrite happens in-place, this extra output enables incremental build to work. -->
    <Touch AlwaysCreate="true" Files="@(IntermediateAssembly->'%(RootDir)%(Directory)%(Filename).ibcmerge.timestamp')" />

  </Target>

  <Target Name="CleanApplyOptimizations">
    <Delete Files="@(IntermediateAssembly->'%(RootDir)%(Directory)%(Filename).ibcmerge.timestamp')" />
  </Target>

  <Target Name="CreateAndSignPhoneCopy" 
          Condition="'$(NeedsPhoneCopy)' == 'true'"
          DependsOnTargets="Compile"
          BeforeTargets="SignVsixInputs"
          Inputs="@(IntermediateAssembly)"
          Outputs="$(OutDir)Phone\%(Filename)%(Extension)">
    <Copy SourceFiles="@(IntermediateAssembly)"
        DestinationFolder="$(OutDir)Phone" />

    <ItemGroup Condition="'$(ShouldSignBuild)' == 'true'">
        <PhoneAssembliesToSign Include="$(OutDir)Phone\%(IntermediateAssembly.Filename)%(IntermediateAssembly.Extension)">
            <Authenticode>WindowsPhone623</Authenticode>
            <StrongName>72</StrongName>
        </PhoneAssembliesToSign>
    </ItemGroup>

    <Message Condition="'$(ShouldSignBuild)' == 'true'"
             Text="Signing phone assemblies: using authenticode certificate '%(PhoneAssembliesToSign.Authenticode)' for @(PhoneAssembliesToSign)"/>
    
    <SignFiles Condition="'$(ShouldSignBuild)' == 'true'"
               Files="@(PhoneAssembliesToSign)" 
               IntermediatesDirectory="$(IntermediateOutputPath)"
               BinariesDirectory="$(OutDir)Phone" 
               Type="$(SignType)" />
  </Target>

  <Target Name="CleanPhoneCopy">
    <RemoveDir Directories="$(OutDir)Phone')" />
  </Target>

  <PropertyGroup>
    <CompileDependsOn>$(CompileDependsOn);ApplyOptimizations</CompileDependsOn>
    <CleanDependsOn>$(CleanDependsOn);CleanApplyOptimizations;CleanPhoneCopy</CleanDependsOn>
  </PropertyGroup>

  <!-- ====================================================================================
  
         Support for signing files that are in VSIXes, and also signing the resulting package

       ==================================================================================== -->

  <PropertyGroup>
    <RunningInMicroBuild Condition="Exists('$(TF_BUILD_BUILDDIRECTORY)\MicroBuild\MicroBuild.Signing.dll')">true</RunningInMicroBuild>
    <ShouldSignBuild Condition="'$(RealSignBuild)' == 'true' OR ('$(RunningInMicroBuild)' == 'true' AND '$(SignType)' == 'real')">true</ShouldSignBuild>
    <CompileDependsOn>$(CompileDependsOn);FakeSignAssembly</CompileDependsOn>
    <FakeSignSentinelFile>$(IntermediateOutputPath)$(TargetFileName).fakesign</FakeSignSentinelFile>
  </PropertyGroup>

  <Target Name="FakeSignAssembly"
          Condition="'$(DelaySign)' == 'true' AND '$(ShouldSignBuild)' != 'true' AND ('$(Language)' == 'C#' OR '$(Language)' == 'VB')"
          DependsOnTargets="CoreCompile"
          Inputs="$(IntermediateOutputPath)$(TargetFileName)"
          Outputs="$(FakeSignSentinelFile)">
    <Exec Command="$(VSLOutDir)\FakeSign.exe &quot;$(IntermediateOutputPath)$(TargetFileName)&quot;" />
    <Touch Files="$(FakeSignSentinelFile)" AlwaysCreate="true" />
  </Target>
  
  <UsingTask TaskName="SignFiles" AssemblyFile="$(TF_BUILD_BUILDDIRECTORY)\MicroBuild\MicroBuild.Signing.dll" Condition="'$(RunningInMicroBuild)' == 'true'" />
  
  <PropertyGroup>
    <CreateVsixContainerDependsOn>$(CreateVsixContainerDependsOn);SignVsixInputs</CreateVsixContainerDependsOn>
    <PrepareForRunDependsOn>$(PrepareForRunDependsOn);SignVsix</PrepareForRunDependsOn>
    <ProducingSignedVsix Condition="'$(ShouldSignBuild)' == 'true' AND '$(NonShipping)' != 'true' AND '$(CreateVsixContainer)' == 'true'">true</ProducingSignedVsix>
  </PropertyGroup>
  
  <!-- GetTargetPath returns the path under $(OutDir) for each project.
       This target adds the $(AuthenticodeCertificateName) as metadata. -->
  <Target Name="GetTargetPathWithAuthenticodeCertificateName" DependsOnTargets="GetTargetPath" Returns="@(TargetPathWithAuthenticodeCertificateName)">
    <ItemGroup>
      <TargetPathWithAuthenticodeCertificateName Include="$(TargetPath)">
        <AuthenticodeCertificateName>$(AuthenticodeCertificateName)</AuthenticodeCertificateName>
      </TargetPathWithAuthenticodeCertificateName>
    </ItemGroup>
  </Target>

  <Target Name="SignVsixInputs" Condition="'$(ProducingSignedVsix)' == 'true'" DependsOnTargets="GetVsixSourceItems" BeforeTargets="CopyFilesToOutputDirectory">
    <!-- Ensure the build tasks project is already built -->
    <MSBuild Projects="$(MSBuildThisFileDirectory)..\..\Closed\Setup\BuildTasks\BuildTasks.vbproj" Condition="!Exists('$(OutDir)\Roslyn.Setup.BuildTasks.dll') AND '$(RunningInMicroBuild)' != 'true'" />
    
    <!-- Collect the paths of all dependent projects. GetTargetPath returns the path under $(OutDir) for each project. -->
    <MSBuild Projects="@(ProjectReferenceWithConfiguration)"
             Targets="GetTargetPathWithAuthenticodeCertificateName"
             BuildInParallel="$(BuildInParallel)"
             Properties="%(ProjectReferenceWithConfiguration.SetConfiguration); %(ProjectReferenceWithConfiguration.SetPlatform)">

      <Output TaskParameter="TargetOutputs" ItemName="VsixInputAssembliesToSign" />
    </MSBuild>

    <!-- Include the assembly we just built if we're also including it in the VSIX-->
    <ItemGroup>
      <VsixInputAssembliesToSign Include="@(IntermediateAssembly)" Condition="'$(IncludeAssemblyInVSIXContainer)' == 'true'">
        <AuthenticodeCertificateName>$(AuthenticodeCertificateName)</AuthenticodeCertificateName>
      </VsixInputAssembliesToSign>
    </ItemGroup>
    
    <Message Text="Signing VSIX inputs: using authenticode certificate '%(VsixInputAssembliesToSign.AuthenticodeCertificateName)' for @(VsixInputAssembliesToSign)"/>

    <ItemGroup Condition="'$(RunningInMicroBuild)' == 'true'">
        <VsixInputAssembliesToSign>
            <Authenticode>%(VsixInputAssembliesToSign.AuthenticodeCertificateName)</Authenticode>
            <StrongName>72</StrongName>
        </VsixInputAssembliesToSign>
    </ItemGroup>

    <SignFiles Condition="'$(RunningInMicroBuild)' == 'true'"
               Files="@(VsixInputAssembliesToSign)" 
               BinariesDirectory="$(OutDir)" 
               IntermediatesDirectory="$(IntermediateOutputPath)"
               Type="$(SignType)" />
  </Target>

  <Target Name="SignVsix"  Condition="'$(ProducingSignedVsix)' == 'true'" DependsOnTargets="CreateVsixContainer">
    <Message Text="Signing VSIX: $(TargetVsixContainer)"/>

    <ItemGroup Condition="'$(RunningInMicroBuild)' == 'true'">
        <VsixToSign Include="$(TargetVsixContainer)">
            <Authenticode>Vsix</Authenticode>
        </VsixToSign>
    </ItemGroup>
    
    <SignFiles Condition="'$(RunningInMicroBuild)' == 'true'"
               Files="@(VsixToSign)" 
               BinariesDirectory="$(OutDir)" 
               IntermediatesDirectory="$(IntermediateOutputPath)"
               Type="$(SignType)" />
  </Target>
 </Project>

{'fraction_non_alphanumeric': 0.18302224209232146, 'fraction_numerical': 0.0018441935844417123, 'mean_word_length': 5.03948700641242, 'pattern_counts': {'":': 0, '<': 229, '<?xml version=': 0, '>': 235, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3808117', 'n_tokens_mistral': 5175, 'n_tokens_neox': 4692, 'n_words': 737}