<commit_before><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" InitialTargets="CheckForBuildTools" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <Target Name="CheckForBuildTools">
    <Error Condition="!Exists('$(ToolsDir)')"
           Text="The tools directory [$(ToolsDir)] does not exist. Please run sync in your enlistment to ensure the tools are installed before attempting to build an individual project." />
  </Target>

  <!-- Provide default targets which can be hooked onto or overridden as necessary -->
  <Target Name="BuildAndTest" DependsOnTargets="Build;Test" />
  <Target Name="RebuildAndTest" DependsOnTargets="Rebuild;Test" />
  <Target Name="Test" />

  <Import Project="$(ToolsDir)/Build.Common.targets" Condition="Exists('$(ToolsDir)Build.Common.targets') and '$(UseLiveBuildTools)' != 'true'" />

 <Target Name="BuildCustomTasks">
    <Exec Command="$(DotnetToolCommand) build $(MSBuildThisFileDirectory)tools-local/tasks/core-setup.tasks.csproj" />
  </Target>

  <Target Name="GetLatestCommitHash">
    <!-- Get the latest commit hash -->
    <Exec Command="git rev-parse HEAD 2>&amp;1" StandardOutputImportance="Low" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" ConsoleToMSBuild="true">
      <Output TaskParameter="ConsoleOutput" PropertyName="LatestCommit" />
      <Output TaskParameter="ExitCode" PropertyName="LatestCommitExitCode" />
    </Exec>
    <!-- We shouldn't fail the build if we can't retreive the commit hash, so in this case just set it to N/A -->
    <PropertyGroup Condition="'$(LatestCommitExitCode)'!='0'">
      <LatestCommit>N/A</LatestCommit>
    </PropertyGroup>
  </Target>

  <Target Name="GetCommitCount">
    <Exec Command="git rev-list --count HEAD"
          StandardOutputImportance="Low"
          IgnoreExitCode="true"
          IgnoreStandardErrorWarningFormat="true"
          ConsoleToMSBuild="true"
          Condition="'$(CommitCount)' == ''">
     <Output TaskParameter="ConsoleOutput" PropertyName="CommitCount" />
     <Output TaskParameter="ExitCode" PropertyName="CommitCountExitCode" />
    </Exec>
    <Error Condition="'$(CommitCount)' == ''" Text="Unable to determine the 'commit count'.  'Commit count' is used for generating an msi version.  If you are building outside of a git repo, you must pass the '/p:CommitCount=[value]' property" /><commit_msg>Allow setting the commit id using /p:LatestCommit<commit_after><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" InitialTargets="CheckForBuildTools" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <Target Name="CheckForBuildTools">
    <Error Condition="!Exists('$(ToolsDir)')"
           Text="The tools directory [$(ToolsDir)] does not exist. Please run sync in your enlistment to ensure the tools are installed before attempting to build an individual project." />
  </Target>

  <!-- Provide default targets which can be hooked onto or overridden as necessary -->
  <Target Name="BuildAndTest" DependsOnTargets="Build;Test" />
  <Target Name="RebuildAndTest" DependsOnTargets="Rebuild;Test" />
  <Target Name="Test" />

  <Import Project="$(ToolsDir)/Build.Common.targets" Condition="Exists('$(ToolsDir)Build.Common.targets') and '$(UseLiveBuildTools)' != 'true'" />

 <Target Name="BuildCustomTasks">
    <Exec Command="$(DotnetToolCommand) build $(MSBuildThisFileDirectory)tools-local/tasks/core-setup.tasks.csproj" />
  </Target>

  <Target Name="GetLatestCommitHash"
          Condition="'$(LatestCommit)' == ''">
    <!-- Get the latest commit hash -->
    <Exec Command="git rev-parse HEAD 2>&amp;1" StandardOutputImportance="Low" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" ConsoleToMSBuild="true">
      <Output TaskParameter="ConsoleOutput" PropertyName="LatestCommit" />
      <Output TaskParameter="ExitCode" PropertyName="LatestCommitExitCode" />
    </Exec>
    <!-- We shouldn't fail the build if we can't retreive the commit hash, so in this case just set it to N/A -->
    <PropertyGroup Condition="'$(LatestCommitExitCode)'!='0'">
      <LatestCommit>N/A</LatestCommit>
    </PropertyGroup>
  </Target>

  <Target Name="GetCommitCount"
          Condition="'$(CommitCount)' == ''">
    <Exec Command="git rev-list --count HEAD"
          StandardOutputImportance="Low"
          IgnoreExitCode="true"
          IgnoreStandardErrorWarningFormat="true"
          ConsoleToMSBuild="true">
     <Output TaskParameter="ConsoleOutput" PropertyName="CommitCount" />
     <Output TaskParameter="ExitCode" PropertyName="CommitCountExitCode" />
    </Exec>
    <Error Condition="'$(CommitCount)' == ''" Text="Unable to determine the 'commit count'.  'Commit count' is used for generating an msi version.  If you are building outside of a git repo, you must pass the '/p:CommitCount=[value]' property" />
{'fraction_non_alphanumeric': 0.14309278350515464, 'fraction_numerical': 0.0053608247422680414, 'mean_word_length': 4.660443407234539, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 2, '>': 67, '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': '7074521', 'n_tokens_mistral': 1395, 'n_tokens_neox': 1343, 'n_words': 349}