<commit_before><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!-- Import after Microsoft.CSharp.Targets -->
  
  <UsingTask TaskName="SlowMonkey.Tasks.TransformXml" AssemblyFile="$(MSBuildThisFileDirectory)SlowMonkey.Tasks.dll" />

  <Target Name="_SlowMonkeySetTransformFile" BeforeTargets="_CopyAppConfigFile">
    <!-- If ConfigTransformFile specified, error if it does not exist. -->
    <Error Condition="$(ConfigTransformFile) != '' and !Exists('$(ConfigTransformFile)')"
           Text="ConfigTransformFile does not exist: $(ConfigTransformFile)" />
    
    <CreateProperty Condition="'$(ConfigTransformFile)' == ''" Value="@(AppConfigWithTargetPath->'%(Filename).$(Configuration)%(Extension)')">
      <Output TaskParameter="Value" PropertyName="ConfigTransformFile" />
    </CreateProperty>
    
    <!-- Make it an item so we can get the file name instead of using $(ConfigTransformFile)
         in the name of the transformed file, because that might contain directory separators -->
    <CreateItem Condition="'$(ConfigTransformFile)' != ''" Include="$(ConfigTransformFile)">
      <Output TaskParameter="Include" ItemName="ConfigTransformFileItem" />
    </CreateItem>
    
    <CreateProperty Condition="'$(ConfigTransformFile)' != ''" Value="@(ConfigTransformFileItem->'%(Filename)%(Extension)')">
      <Output TaskParameter="Value" PropertyName="ConfigTransformFilename" />
    </CreateProperty>
  
    <CreateProperty Condition="'$(ConfigTransformFile)' != ''" Value="$(IntermediateOutputPath)$(MSBuildProjectFile).$(ConfigTransformFilename).transformed">
      <Output TaskParameter="Value" PropertyName="ConfigTransformOutput" />
    </CreateProperty>
  </Target>

  <Target Name="_TransformAppConfig"
          AfterTargets="_SlowMonkeySetTransformFile"
          Condition="'@(AppConfigWithTargetPath)' != '' and Exists('$(ConfigTransformFile)')"
          Inputs="@(AppConfigWithTargetPath);$(ConfigTransformFile)"
          Outputs="$(ConfigTransformOutput)"
  >
    <!-- Copy to obj folder -->
    <Copy SourceFiles="@(AppConfigWithTargetPath)" DestinationFiles="$(ConfigTransformOutput)" />
    
    <!-- Transform -->
    <SlowMonkey.Tasks.TransformXml
      Source="$(ConfigTransformOutput)"
      Destination="$(ConfigTransformOutput)"
      Transform="$(ConfigTransformFile)" />
  </Target>

  <Target Name="_TouchTransformedConfig"
          AfterTargets="_TransformAppConfig"
          Condition="'@(AppConfigWithTargetPath)' != '' and Exists('$(ConfigTransformFile)')"
  >
    <!-- Set the modified timestamp of the transformed config to now, so that _CopyAppConfigFile actually copies the file.
         Otherwise what can happen is you build in configuration A, then in Configuration B, then in Configuration A again.
         _CopyAppConfigFile will see that the timestamp of the Configuration A transformed config is older than the app.config
         in the bin folder and so won't copy it to bin.
         <commit_msg>Don't copy base config to obj folder before transforming it.<commit_after><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!-- Import after Microsoft.CSharp.Targets -->
  
  <UsingTask TaskName="SlowMonkey.Tasks.TransformXml" AssemblyFile="$(MSBuildThisFileDirectory)SlowMonkey.Tasks.dll" />

  <Target Name="_SlowMonkeySetTransformFile" BeforeTargets="_CopyAppConfigFile">
    <!-- If ConfigTransformFile specified, error if it does not exist. -->
    <Error Condition="$(ConfigTransformFile) != '' and !Exists('$(ConfigTransformFile)')"
           Text="ConfigTransformFile does not exist: $(ConfigTransformFile)" />
    
    <CreateProperty Condition="'$(ConfigTransformFile)' == ''" Value="@(AppConfigWithTargetPath->'%(Filename).$(Configuration)%(Extension)')">
      <Output TaskParameter="Value" PropertyName="ConfigTransformFile" />
    </CreateProperty>
    
    <!-- Make it an item so we can get the file name instead of using $(ConfigTransformFile)
         in the name of the transformed file, because that might contain directory separators -->
    <CreateItem Condition="'$(ConfigTransformFile)' != ''" Include="$(ConfigTransformFile)">
      <Output TaskParameter="Include" ItemName="ConfigTransformFileItem" />
    </CreateItem>
    
    <CreateProperty Condition="'$(ConfigTransformFile)' != ''" Value="@(ConfigTransformFileItem->'%(Filename)%(Extension)')">
      <Output TaskParameter="Value" PropertyName="ConfigTransformFilename" />
    </CreateProperty>
  
    <CreateProperty Condition="'$(ConfigTransformFile)' != ''" Value="$(IntermediateOutputPath)$(MSBuildProjectFile).$(ConfigTransformFilename).transformed">
      <Output TaskParameter="Value" PropertyName="ConfigTransformOutput" />
    </CreateProperty>
  </Target>

  <Target Name="_TransformAppConfig"
          AfterTargets="_SlowMonkeySetTransformFile"
          Condition="'@(AppConfigWithTargetPath)' != '' and Exists('$(ConfigTransformFile)')"
          Inputs="@(AppConfigWithTargetPath);$(ConfigTransformFile)"
          Outputs="$(ConfigTransformOutput)"
  >
    <!-- Transform -->
    <SlowMonkey.Tasks.TransformXml
      Source="@(AppConfigWithTargetPath)"
      Destination="$(ConfigTransformOutput)"
      Transform="$(ConfigTransformFile)" />
  </Target>

  <Target Name="_TouchTransformedConfig"
          AfterTargets="_TransformAppConfig"
          Condition="'@(AppConfigWithTargetPath)' != '' and Exists('$(ConfigTransformFile)')"
  >
    <!-- Set the modified timestamp of the transformed config to now, so that _CopyAppConfigFile actually copies the file.
         Otherwise what can happen is you build in configuration A, then in Configuration B, then in Configuration A again.
         _CopyAppConfigFile will see that the timestamp of the Configuration A transformed config is older than the app.config
         in the bin folder and so won't copy it to bin.
         
{'fraction_non_alphanumeric': 0.13149847094801223, 'fraction_numerical': 0.0013591573224600749, 'mean_word_length': 4.517338331771321, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 59, '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': '2543585', 'n_tokens_mistral': 1519, 'n_tokens_neox': 1418, 'n_words': 356}