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

  <!--
    Code coverage package versions go here and in the test-runtime-packages.config
  -->
  <PropertyGroup>
    <OpenCoverVersion>4.6.476-rc</OpenCoverVersion>
    <ReportGeneratorVersion>2.4.0-beta2</ReportGeneratorVersion>
    <CoverallsUploaderVersion>1.4</CoverallsUploaderVersion>
  </PropertyGroup>
  
  <!-- Coverage options -->
  <PropertyGroup>
    <CodeCoverageEnabled>false</CodeCoverageEnabled>
    <CodeCoverageEnabled Condition="'$(SkipTests)' != 'true' and '$(OS)' == 'Windows_NT' and '$(Coverage)' == 'true' and '$(Performance)' != 'true'">true</CodeCoverageEnabled>
    <CoverageReportDir Condition="'$(CoverageReportDir)' == ''">$(TestWorkingDir)coverage\</CoverageReportDir>

    <!-- This targets file has two modes one for individual projects and one for all -->
    <GenerateCodeCoverageReportForAll Condition="'$(GenerateCodeCoverageReportForAll)'==''">false</GenerateCodeCoverageReportForAll>
    <CoverageEnabledForProject Condition="'$(GenerateCodeCoverageReportForAll)'=='true'">false</CoverageEnabledForProject>
    <CoverageEnabledForProject Condition="'$(CoverageEnabledForProject)'=='' and '$(IsTestProject)'=='true'">$(CodeCoverageEnabled)</CoverageEnabledForProject>

    <GenerateIndividualCoverageReport Condition="'$(BuildAllProjects)'!='true' and '$(CoverageEnabledForProject)'=='true'">true</GenerateIndividualCoverageReport>
    <GenerateFullCoverageReport Condition="'$(GenerateCodeCoverageReportForAll)'=='true' and '$(CodeCoverageEnabled)'=='true' and '$(SkipFullCoverageReport)' != 'true'">true</GenerateFullCoverageReport>
    <GenerateVisitedMethodsReport Condition="'$(GenerateCodeCoverageReportForAll)'=='true' and '$(CodeCoverageEnabled)'=='true' and '$(GenerateVisitedReport)' == 'true'">true</GenerateVisitedMethodsReport>

    <!-- 
      When coverage is enabled, we disallow building projects in parallel. 
      There appear to be issues with the OpenCover tool in these scenarios. 
    -->
    <SerializeProjects Condition="'$(CodeCoverageEnabled)'=='true'">true</SerializeProjects>
  </PropertyGroup>

  <!-- xUnit command line with coverage enabled -->
  <PropertyGroup Condition="'$(CoverageEnabledForProject)'=='true'">
    <CoverageHost>$(PackagesDir)OpenCover\$(OpenCoverVersion)\tools\OpenCover.Console.exe</CoverageHost>
    <CoverageOutputFilePath>$(CoverageReportDir)$(MSBuildProjectName).coverage.xml</CoverageOutputFilePath>
    <CoverageOptions>-filter:"+[*]* -[*.Tests]*" -excludebyfile:"*\Common\src\System\SR.*" -nodefaultfilters -excludebyattribute:*.ExcludeFromCodeCoverage* -skipautoprops -hideskipped:All -threshold:1</CoverageOptions>
    <CoverageCommandLine>$(CoverageOptions) -returntargetcode -register:user -target:$(TestProgram) -output:$(CoverageOutputFilePath)</CoverageCommandLine>
    <TestHost>$(CoverageHost)</TestHost>
    <XunitOptions>$(XunitOptions) -parallel none</XunitOptions>
    <TestCommandLine>$(TestHost) $(CoverageCommandLine) -targetargs:"$(TestArguments) {XunitTraitOptions}"</TestCommandLine>
  </PropertyGroup>

  <!-- Report Generator Properties -->
  <PropertyGroup>
    <CoverageReportGeneratorOptions>-targetdir:$(CoverageReportDir) -reporttypes:Html;Badges</CoverageReportGeneratorOptions>
    <CoverageReportGeneratorCommandLine>$(PackagesDir)ReportGenerator\$(ReportGeneratorVersion)\tools\ReportGenerator.exe $(CoverageReportGeneratorOptions)</CoverageReportGeneratorCommandLine>
  </PropertyGroup>

  <PropertyGroup Condition="'$(GenerateIndividualCoverageReport)'=='true'">
    <GenerateIndividualCoverageReportAfterTargets Condition="'$(GenerateIndividualCoverageReportAfterTargets)'==''">RunTestsForProject</GenerateIndividualCoverageReportAfterTargets>
  </PropertyGroup>

  <!-- Generate coverage reports for individual projects. -->
  <Target Name="GenerateIndividualCoverageReport"
          AfterTargets="$(GenerateIndividualCoverageReportAfterTargets)"
          Inputs="$(CoverageOutputFilePath)"
          Outputs="$(CoverageReportDir)index.htm"
          Condition="'$(GenerateIndividualCoverageReport)'=='true'">

    <Exec Command="$(CoverageReportGeneratorCommandLine) -reports:$(CoverageOutputFilePath)"
          ContinueOnError="ErrorAndContinue" />
  </Target>

  <PropertyGroup Condition="'$(GenerateFullCoverageReport)'=='true'">
    <GenerateFullCoverageReportAfterTargets Condition="'$(GenerateFullCoverageReportAfterTargets)'==''">Test</GenerateFullCoverageReportAfterTargets>
  </PropertyGroup>

  <!-- Generate coverage report for all the projects. -->
  <Target Name="GenerateFullCoverageReport"
         AfterTargets="$(GenerateFullCoverageReportAfterTargets)"
         Inputs="$(CoverageReportDir)\*.coverage.xml"
         Outputs="$(CoverageReportDir)index.htm"
         Condition="'$(GenerateFullCoverageReport)'=='true'">

    <Exec Command="$(CoverageReportGeneratorCommandLine) -reports:$(CoverageReportDir)\*.coverage.xml"
          ContinueOnError="ErrorAndContinue"
          WorkingDirectory="$(ProjectDir)" />

    <PropertyGroup>
      <CoverallsUploaderCommandLine>$(PackagesDir)coveralls.io.$(CoverallsUploaderVersion)\tools\coveralls.net.exe</CoverallsUploaderCommandLine>
      <CoverallsUploaderOptions>--opencover $(CoverageReportDir)\*.coverage.xml --repo-token $(CoverallsToken)</CoverallsUploaderOptions>
    </PropertyGroup>

    <Exec Command="$(CoverallsUploaderCommandLine) $(CoverallsUploaderOptions)"
          ContinueOnError="ErrorAndContinue"
          WorkingDirectory="$(ProjectDir)"
          Condition="'$(UploadCoverallsData)'=='true'" />

  </Target>

  <UsingTask TaskName="ParseTestCoverageInfo" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll"/>

  <!-- Generates VisitedMethodsReport.xml -->
  <Target Name="GenerateVisitedReport"
          AfterTargets="Test"
          Condition="'$(GenerateVisitedMethodsReport)' == 'true'"
          Inputs="$(CoverageReportDir)*.coverage.xml"
          Outputs="$(CoverageReportDir)\VisitedMethodsReport.xml">
    <ItemGroup>
      <Reports Include="$(CoverageReportDir)*.coverage.xml"/>
    </ItemGroup>
    <ParseTestCoverageInfo CoverageReports="@(Reports)"
                           OutputReport="$(CoverageReportDir)\VisitedMethodsReport.xml"/>
  </Target>
  
</Project>
<commit_msg>Fix ReportGeneratorVersion<commit_after>﻿<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <!--
    Code coverage package versions go here and in the test-runtime-packages.config
  -->
  <PropertyGroup>
    <OpenCoverVersion>4.6.476-rc</OpenCoverVersion>
    <ReportGeneratorVersion>2.4.0</ReportGeneratorVersion>
    <CoverallsUploaderVersion>1.4</CoverallsUploaderVersion>
  </PropertyGroup>
  
  <!-- Coverage options -->
  <PropertyGroup>
    <CodeCoverageEnabled>false</CodeCoverageEnabled>
    <CodeCoverageEnabled Condition="'$(SkipTests)' != 'true' and '$(OS)' == 'Windows_NT' and '$(Coverage)' == 'true' and '$(Performance)' != 'true'">true</CodeCoverageEnabled>
    <CoverageReportDir Condition="'$(CoverageReportDir)' == ''">$(TestWorkingDir)coverage\</CoverageReportDir>

    <!-- This targets file has two modes one for individual projects and one for all -->
    <GenerateCodeCoverageReportForAll Condition="'$(GenerateCodeCoverageReportForAll)'==''">false</GenerateCodeCoverageReportForAll>
    <CoverageEnabledForProject Condition="'$(GenerateCodeCoverageReportForAll)'=='true'">false</CoverageEnabledForProject>
    <CoverageEnabledForProject Condition="'$(CoverageEnabledForProject)'=='' and '$(IsTestProject)'=='true'">$(CodeCoverageEnabled)</CoverageEnabledForProject>

    <GenerateIndividualCoverageReport Condition="'$(BuildAllProjects)'!='true' and '$(CoverageEnabledForProject)'=='true'">true</GenerateIndividualCoverageReport>
    <GenerateFullCoverageReport Condition="'$(GenerateCodeCoverageReportForAll)'=='true' and '$(CodeCoverageEnabled)'=='true' and '$(SkipFullCoverageReport)' != 'true'">true</GenerateFullCoverageReport>
    <GenerateVisitedMethodsReport Condition="'$(GenerateCodeCoverageReportForAll)'=='true' and '$(CodeCoverageEnabled)'=='true' and '$(GenerateVisitedReport)' == 'true'">true</GenerateVisitedMethodsReport>

    <!-- 
      When coverage is enabled, we disallow building projects in parallel. 
      There appear to be issues with the OpenCover tool in these scenarios. 
    -->
    <SerializeProjects Condition="'$(CodeCoverageEnabled)'=='true'">true</SerializeProjects>
  </PropertyGroup>

  <!-- xUnit command line with coverage enabled -->
  <PropertyGroup Condition="'$(CoverageEnabledForProject)'=='true'">
    <CoverageHost>$(PackagesDir)OpenCover\$(OpenCoverVersion)\tools\OpenCover.Console.exe</CoverageHost>
    <CoverageOutputFilePath>$(CoverageReportDir)$(MSBuildProjectName).coverage.xml</CoverageOutputFilePath>
    <CoverageOptions>-filter:"+[*]* -[*.Tests]*" -excludebyfile:"*\Common\src\System\SR.*" -nodefaultfilters -excludebyattribute:*.ExcludeFromCodeCoverage* -skipautoprops -hideskipped:All -threshold:1</CoverageOptions>
    <CoverageCommandLine>$(CoverageOptions) -returntargetcode -register:user -target:$(TestProgram) -output:$(CoverageOutputFilePath)</CoverageCommandLine>
    <TestHost>$(CoverageHost)</TestHost>
    <XunitOptions>$(XunitOptions) -parallel none</XunitOptions>
    <TestCommandLine>$(TestHost) $(CoverageCommandLine) -targetargs:"$(TestArguments) {XunitTraitOptions}"</TestCommandLine>
  </PropertyGroup>

  <!-- Report Generator Properties -->
  <PropertyGroup>
    <CoverageReportGeneratorOptions>-targetdir:$(CoverageReportDir) -reporttypes:Html;Badges</CoverageReportGeneratorOptions>
    <CoverageReportGeneratorCommandLine>$(PackagesDir)ReportGenerator\$(ReportGeneratorVersion)\tools\ReportGenerator.exe $(CoverageReportGeneratorOptions)</CoverageReportGeneratorCommandLine>
  </PropertyGroup>

  <PropertyGroup Condition="'$(GenerateIndividualCoverageReport)'=='true'">
    <GenerateIndividualCoverageReportAfterTargets Condition="'$(GenerateIndividualCoverageReportAfterTargets)'==''">RunTestsForProject</GenerateIndividualCoverageReportAfterTargets>
  </PropertyGroup>

  <!-- Generate coverage reports for individual projects. -->
  <Target Name="GenerateIndividualCoverageReport"
          AfterTargets="$(GenerateIndividualCoverageReportAfterTargets)"
          Inputs="$(CoverageOutputFilePath)"
          Outputs="$(CoverageReportDir)index.htm"
          Condition="'$(GenerateIndividualCoverageReport)'=='true'">

    <Exec Command="$(CoverageReportGeneratorCommandLine) -reports:$(CoverageOutputFilePath)"
          ContinueOnError="ErrorAndContinue" />
  </Target>

  <PropertyGroup Condition="'$(GenerateFullCoverageReport)'=='true'">
    <GenerateFullCoverageReportAfterTargets Condition="'$(GenerateFullCoverageReportAfterTargets)'==''">Test</GenerateFullCoverageReportAfterTargets>
  </PropertyGroup>

  <!-- Generate coverage report for all the projects. -->
  <Target Name="GenerateFullCoverageReport"
         AfterTargets="$(GenerateFullCoverageReportAfterTargets)"
         Inputs="$(CoverageReportDir)\*.coverage.xml"
         Outputs="$(CoverageReportDir)index.htm"
         Condition="'$(GenerateFullCoverageReport)'=='true'">

    <Exec Command="$(CoverageReportGeneratorCommandLine) -reports:$(CoverageReportDir)\*.coverage.xml"
          ContinueOnError="ErrorAndContinue"
          WorkingDirectory="$(ProjectDir)" />

    <PropertyGroup>
      <CoverallsUploaderCommandLine>$(PackagesDir)coveralls.io.$(CoverallsUploaderVersion)\tools\coveralls.net.exe</CoverallsUploaderCommandLine>
      <CoverallsUploaderOptions>--opencover $(CoverageReportDir)\*.coverage.xml --repo-token $(CoverallsToken)</CoverallsUploaderOptions>
    </PropertyGroup>

    <Exec Command="$(CoverallsUploaderCommandLine) $(CoverallsUploaderOptions)"
          ContinueOnError="ErrorAndContinue"
          WorkingDirectory="$(ProjectDir)"
          Condition="'$(UploadCoverallsData)'=='true'" />

  </Target>

  <UsingTask TaskName="ParseTestCoverageInfo" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll"/>

  <!-- Generates VisitedMethodsReport.xml -->
  <Target Name="GenerateVisitedReport"
          AfterTargets="Test"
          Condition="'$(GenerateVisitedMethodsReport)' == 'true'"
          Inputs="$(CoverageReportDir)*.coverage.xml"
          Outputs="$(CoverageReportDir)\VisitedMethodsReport.xml">
    <ItemGroup>
      <Reports Include="$(CoverageReportDir)*.coverage.xml"/>
    </ItemGroup>
    <ParseTestCoverageInfo CoverageReports="@(Reports)"
                           OutputReport="$(CoverageReportDir)\VisitedMethodsReport.xml"/>
  </Target>
  
</Project>

{'fraction_non_alphanumeric': 0.14513981358189082, 'fraction_numerical': 0.0033680582752408554, 'mean_word_length': 6.185143500281373, 'pattern_counts': {'":': 0, '<': 187, '<?xml version=': 2, '>': 187, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 22}, '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': '4555546', 'n_tokens_mistral': 3825, 'n_tokens_neox': 3298, 'n_words': 453}