<commit_before>﻿<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="SignVsixesIfPfxSupplied" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <!-- Targets to handle signing one or more VSIXes using a pfx certificate.
    
       Usage:
       The following properties should be set by the caller:
       * $(pfxCertificatePath)  : full path to the pfx file
       * $(pfxPassword)         : password to the certificate file
       * $(pfxSha1)             : the sha1 for the certificate file
       * @(VSIXesToSign)        : the list of VSIXes to sign
       * $(PackagesFolder)      : the folder containing the packages. Defaults to $(NuGetPackageRoot) if not set.
  -->

  <ItemGroup>
    <PackageReference Include="Microsoft.VSSDK.Vsixsigntool" Version="15.0.26201" />
  </ItemGroup>
    
  <Target Name="SignVsixesIfPfxSupplied">
    <Message Importance="high" Text="Vsixes to sign: @(VSIXesToSign)" />
    <CallTarget Condition=" $(pfxCertificatePath) != '' " Targets="ValidateVsixSigningInputs;LocateVsixSignToolAndBinaries;SignVsixes" />
    <Message Condition=" $(pfxCertificatePath) == '' " Importance="high" Text="Skipping signing VSIXes - pfx certificate path has not been set." />
  </Target>

  <Target Name="ValidateVsixSigningInputs">
    <Error Condition=" $(pfxCertificatePath) == '' " Text="pfxCertificatePath has not been set" />
    <Error Condition=" $(pfxPassword) == '' " Text="pfxPassword has not been set" />
    <Error Condition=" $(pfxSha1) == '' " Text="pfxSha1 has not been set" />
    <Error Condition=" !Exists($(pfxCertificatePath)) " Text="The specified pfx file does not exist: $(pfxCertificatePath)" />
    
    <Error Condition=" @(VSIXesToSign) == '' " Text="The list of VSIXes to sign is empty." />
    <Message Importance="high" Text="VSIXes to sign: @(VSIXesToSign)" />
  </Target>

  <!-- The vsixsigntool is shipped in a NuGet package. We need to locate the exe file. -->
  <Target Name="LocateVsixSignToolAndBinaries" >
    <PropertyGroup>
      <PackagesFolder Condition=" $(PackagesFolder) == ''">$(NuGetPackageRoot)</PackagesFolder>
    </PropertyGroup>

    <Message Importance="high" Text="Locating VSIX sign tool..." />
    <Message Importance="high" Text="  Searching under '$(PackagesFolder)'" />

    <!-- There could be multiple versions of the NuGet package on the machine. We'll select all
	       of the matching exes, and then just pick one. -->
    <ItemGroup>
	    <VsixSignToolsList Include="$(PackagesFolder)/Microsoft.VSSDK.Vsixsigntool/**/vsixsigntool.exe" />
	  </ItemGroup>
    <PropertyGroup>
      <VsixSignToolPath>%(VsixSignToolsList.Identity)</VsixSignToolPath>	
	  </PropertyGroup>

    <Error Condition=" $(VsixSignToolPath) == '' " Text="Unable to locate vsixsigntool.exe. Check that the Microsoft.VSSDK.Vsixsigntool NuGet package is installed." />
    <Message Importance="high" Text="VSIX signing tool located at $(VsixSignToolPath)" />
  </Target>

  <Target Name="SignVsixes">
    <Error Condition=" $(pfxCertificatePath) == '' " Text="pfxCertificatePath has not been set" />
    <Error Condition=" $(pfxPassword) == '' " Text="pfxPassword has not been set" />
    <Exec Command="$(VsixSignToolPath) sign /f $(pfxCertificatePath) /p $(pfxPassword) /sha1 $(pfxSha1) %(VSIXesToSign.Identity)" />
  </Target>

</Project><commit_msg>Timestamp VSIX when signing (#1175)<commit_after>﻿<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="SignVsixesIfPfxSupplied" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <!-- Targets to handle signing one or more VSIXes using a pfx certificate.
    
       Usage:
       The following properties should be set by the caller:
       * $(pfxCertificatePath)  : full path to the pfx file
       * $(pfxPassword)         : password to the certificate file
       * $(pfxSha1)             : the sha1 for the certificate file
       * @(VSIXesToSign)        : the list of VSIXes to sign
       * $(PackagesFolder)      : the folder containing the packages. Defaults to $(NuGetPackageRoot) if not set.
  -->

  <ItemGroup>
    <PackageReference Include="Microsoft.VSSDK.Vsixsigntool" Version="15.0.26201" />
  </ItemGroup>
    
  <Target Name="SignVsixesIfPfxSupplied">
    <Message Importance="high" Text="Vsixes to sign: @(VSIXesToSign)" />
    <CallTarget Condition=" $(pfxCertificatePath) != '' " Targets="ValidateVsixSigningInputs;LocateVsixSignToolAndBinaries;SignVsixes" />
    <Message Condition=" $(pfxCertificatePath) == '' " Importance="high" Text="Skipping signing VSIXes - pfx certificate path has not been set." />
  </Target>

  <Target Name="ValidateVsixSigningInputs">
    <Error Condition=" $(pfxCertificatePath) == '' " Text="pfxCertificatePath has not been set" />
    <Error Condition=" $(pfxPassword) == '' " Text="pfxPassword has not been set" />
    <Error Condition=" $(pfxSha1) == '' " Text="pfxSha1 has not been set" />
    <Error Condition=" !Exists($(pfxCertificatePath)) " Text="The specified pfx file does not exist: $(pfxCertificatePath)" />
    
    <Error Condition=" @(VSIXesToSign) == '' " Text="The list of VSIXes to sign is empty." />
    <Message Importance="high" Text="VSIXes to sign: @(VSIXesToSign)" />
  </Target>

  <!-- The vsixsigntool is shipped in a NuGet package. We need to locate the exe file. -->
  <Target Name="LocateVsixSignToolAndBinaries" >
    <PropertyGroup>
      <PackagesFolder Condition=" $(PackagesFolder) == ''">$(NuGetPackageRoot)</PackagesFolder>
    </PropertyGroup>

    <Message Importance="high" Text="Locating VSIX sign tool..." />
    <Message Importance="high" Text="  Searching under '$(PackagesFolder)'" />

    <!-- There could be multiple versions of the NuGet package on the machine. We'll select all
	       of the matching exes, and then just pick one. -->
    <ItemGroup>
	    <VsixSignToolsList Include="$(PackagesFolder)/Microsoft.VSSDK.Vsixsigntool/**/vsixsigntool.exe" />
	  </ItemGroup>
    <PropertyGroup>
      <VsixSignToolPath>%(VsixSignToolsList.Identity)</VsixSignToolPath>	
	  </PropertyGroup>

    <Error Condition=" $(VsixSignToolPath) == '' " Text="Unable to locate vsixsigntool.exe. Check that the Microsoft.VSSDK.Vsixsigntool NuGet package is installed." />
    <Message Importance="high" Text="VSIX signing tool located at $(VsixSignToolPath)" />
  </Target>

  <Target Name="SignVsixes">
    <Error Condition=" $(pfxCertificatePath) == '' " Text="pfxCertificatePath has not been set" />
    <Error Condition=" $(pfxPassword) == '' " Text="pfxPassword has not been set" />
    <Exec Command="$(VsixSignToolPath) sign /f $(pfxCertificatePath) /p $(pfxPassword) /sha1 $(pfxSha1) /tr http://timestamp.digicert.com /v %(VSIXesToSign.Identity)" />
  </Target>

</Project>
{'fraction_non_alphanumeric': 0.14127382887542486, 'fraction_numerical': 0.0076843505246046995, 'mean_word_length': 3.9546120058565153, 'pattern_counts': {'":': 0, '<': 91, '<?xml version=': 2, '>': 91, 'https://': 0, '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': '2125158', 'n_tokens_mistral': 2179, 'n_tokens_neox': 2060, 'n_words': 556}