<commit_before><?xml version="1.0" encoding="utf-8"?>

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <Target Name="_BuildSolution">
    <Message Text="Running $(SolutionTarget) $(BuildConfiguration) with $(BuildTools) on $(SolutionFile)" Importance="normal" />
    <MSBuild Targets="$(SolutionTarget)" Projects="$(SolutionFile)" ToolsVersion="$(BuildTools)"
             Properties="Configuration=$(BuildConfiguration);$(ForcedFrameworkVersion)TreatWarningsAsErrors=true;"
             />
  </Target>

  <Target Name="_Clean">
		<RemoveDir Directories="@(WorkingDirectories)" Condition="Exists(%(WorkingDirectories.Identity))" />
		<MakeDir Directories="@(WorkingDirectories)" />

    <MSBuild Projects="$(MSBuildProjectFullPath)" Properties="SolutionTarget=Clean;BuildConfiguration=$(BuildConfiguration)" Targets="_BuildSolution" ContinueOnError="true" />
  </Target>

  <Target Name="_Compile">
    <MSBuild Projects="$(MSBuildProjectFullPath)" Properties="SolutionTarget=Rebuild;BuildConfiguration=$(BuildConfiguration)" Targets="_BuildSolution" />
  </Target>

  <Target Name="_CompileGeneratedSource" DependsOnTargets="_CopyGeneratedSource">
    <MSBuild Projects="$(MSBuildProjectFullPath)" Properties="Step=Two;SolutionTarget=Build;BuildConfiguration=$(BuildConfiguration)" Targets="_BuildSolution" />
  </Target>
  
	<Target Name="_GenerateSource">
    <Exec Command="$(ProtocExePath) --proto_path=$(ProtosDirectory) --descriptor_set_out=compiled.pb @(Protos->'%(RelativeDir)%(Filename)%(Extension)', ' ')" WorkingDirectory="$(BuildTempDirectory)" />
		<Exec Command="$(ProtogenExePath) compiled.pb" WorkingDirectory="$(BuildTempDirectory)" />
	</Target>

	<Target Name="_CopyGeneratedSource" DependsOnTargets="_GenerateSource">
		<Copy SourceFiles="%(GeneratedSource.Identity)" DestinationFiles="%(GeneratedSource.TargetDirectory)\%(GeneratedSource.Filename)%(GeneratedSource.Extension)" />
  </Target>

  <Target Name="_Test" DependsOnTargets="_CompileGeneratedSource" Condition="$(BuildConfiguration)=='Debug' or $(BuildConfiguration)=='Release'">
    <CallTarget Targets="_RunTests" />
  </Target>

  <Target Name="_RunTests">
		<Exec Command="&quot;$(NUnitExePath)&quot; /noshadow %(TestContainer.Identity) /xml:$(BuildTempDirectory)\..\%(TestContainer.Filename).$(BuildConfiguration).xml" />
	</Target>
	
	<!--## Package Generation ##-->
	<Target Name="_CleanOutputDirectory">
		<RemoveDir Directories="$(BuildOutputDirectory)" ContinueOnError="true" />
    <MakeDir Directories="$(BuildOutputDirectory)" ContinueOnError="true" />
	</Target>
	
	<Target Name="_PreparePackageComponent">
		<Copy SourceFiles="@(DynamicPackageItem)" DestinationFolder="$(BuildOutputDirectory)\%(DynamicPackageItem.TargetDirectory)\%(DynamicPackageItem.RecursiveDir)" />
	</Target>

	<Target Name="_GeneratePackage">
		<Copy SourceFiles="@(StaticPackageItem)" DestinationFolder="$(BuildOutputDirectory)\%(StaticPackageItem.TargetDirectory)\%(StaticPackageItem.RecursiveDir)" />
		<Exec Command="&quot;$(ZipExePath)&quot; a -tzip $(PackageName) * -r" WorkingDirectory="$(BuildOutputDirectory)" />

	</Target>

	<!--## Benchmark ##-->
	<Target Name="_GenerateBenchmarkSource" DependsOnTargets="_Clean">
		<PropertyGroup>
			<Args>$(BenchmarkProtosDirectory)\google_size.proto $(BenchmarkProtosDirectory)\google_speed.proto</Args>
		</PropertyGroup>

		<Exec Command="$(ProtocExePath) --proto_path=$(BenchmarkProtosDirectory);$(ProtosDirectory) --include_imports=compiled.pb --descriptor_set_out=compiled.pb $(Args)" WorkingDirectory="$(BuildTempDirectory)" />
		<Exec Command="$(ProtogenExePath) compiled.pb" WorkingDirectory="$(BuildTempDirectory)" />
	</Target>

	<Target Name="_CompileBenchmarkAssembly" DependsOnTargets="_GenerateBenchmarkSource">
		<ItemGroup>
			<BenchmarkSources Include="$(BuildTempDirectory)\GoogleSizeProtoFile.cs" /><commit_msg>Fix to rebuild src prior to running benchmarks<commit_after><?xml version="1.0" encoding="utf-8"?>

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <Target Name="_BuildSolution">
    <Message Text="Running $(SolutionTarget) $(BuildConfiguration) with $(BuildTools) on $(SolutionFile)" Importance="normal" />
    <MSBuild Targets="$(SolutionTarget)" Projects="$(SolutionFile)" ToolsVersion="$(BuildTools)"
             Properties="Configuration=$(BuildConfiguration);$(ForcedFrameworkVersion)TreatWarningsAsErrors=true;"
             />
  </Target>

  <Target Name="_Clean">
		<RemoveDir Directories="@(WorkingDirectories)" Condition="Exists(%(WorkingDirectories.Identity))" />
		<MakeDir Directories="@(WorkingDirectories)" />

    <MSBuild Projects="$(MSBuildProjectFullPath)" Properties="SolutionTarget=Clean;BuildConfiguration=$(BuildConfiguration)" Targets="_BuildSolution" ContinueOnError="true" />
  </Target>

  <Target Name="_Compile">
    <MSBuild Projects="$(MSBuildProjectFullPath)" Properties="SolutionTarget=Rebuild;BuildConfiguration=$(BuildConfiguration)" Targets="_BuildSolution" />
  </Target>

  <Target Name="_CompileGeneratedSource" DependsOnTargets="_CopyGeneratedSource">
    <MSBuild Projects="$(MSBuildProjectFullPath)" Properties="Step=Two;SolutionTarget=Build;BuildConfiguration=$(BuildConfiguration)" Targets="_BuildSolution" />
  </Target>
  
	<Target Name="_GenerateSource">
    <Exec Command="$(ProtocExePath) --proto_path=$(ProtosDirectory) --descriptor_set_out=compiled.pb @(Protos->'%(RelativeDir)%(Filename)%(Extension)', ' ')" WorkingDirectory="$(BuildTempDirectory)" />
		<Exec Command="$(ProtogenExePath) compiled.pb" WorkingDirectory="$(BuildTempDirectory)" />
	</Target>

	<Target Name="_CopyGeneratedSource" DependsOnTargets="_GenerateSource">
		<Copy SourceFiles="%(GeneratedSource.Identity)" DestinationFiles="%(GeneratedSource.TargetDirectory)\%(GeneratedSource.Filename)%(GeneratedSource.Extension)" />
  </Target>

  <Target Name="_Test" DependsOnTargets="_CompileGeneratedSource" Condition="$(BuildConfiguration)=='Debug' or $(BuildConfiguration)=='Release'">
    <CallTarget Targets="_RunTests" />
  </Target>

  <Target Name="_RunTests">
		<Exec Command="&quot;$(NUnitExePath)&quot; /noshadow %(TestContainer.Identity) /xml:$(BuildTempDirectory)\..\%(TestContainer.Filename).$(BuildConfiguration).xml" />
	</Target>
	
	<!--## Package Generation ##-->
	<Target Name="_CleanOutputDirectory">
		<RemoveDir Directories="$(BuildOutputDirectory)" ContinueOnError="true" />
    <MakeDir Directories="$(BuildOutputDirectory)" ContinueOnError="true" />
	</Target>
	
	<Target Name="_PreparePackageComponent">
		<Copy SourceFiles="@(DynamicPackageItem)" DestinationFolder="$(BuildOutputDirectory)\%(DynamicPackageItem.TargetDirectory)\%(DynamicPackageItem.RecursiveDir)" />
	</Target>

	<Target Name="_GeneratePackage">
		<Copy SourceFiles="@(StaticPackageItem)" DestinationFolder="$(BuildOutputDirectory)\%(StaticPackageItem.TargetDirectory)\%(StaticPackageItem.RecursiveDir)" />
		<Exec Command="&quot;$(ZipExePath)&quot; a -tzip $(PackageName) * -r" WorkingDirectory="$(BuildOutputDirectory)" />

	</Target>

	<!--## Benchmark ##-->
	<Target Name="_GenerateBenchmarkSource" DependsOnTargets="_Clean;_Compile">
		<PropertyGroup>
			<Args>$(BenchmarkProtosDirectory)\google_size.proto $(BenchmarkProtosDirectory)\google_speed.proto</Args>
		</PropertyGroup>

		<Exec Command="$(ProtocExePath) --proto_path=$(BenchmarkProtosDirectory);$(ProtosDirectory) --include_imports=compiled.pb --descriptor_set_out=compiled.pb $(Args)" WorkingDirectory="$(BuildTempDirectory)" />
		<Exec Command="$(ProtogenExePath) compiled.pb" WorkingDirectory="$(BuildTempDirectory)" />
	</Target>

	<Target Name="_CompileBenchmarkAssembly" DependsOnTargets="_GenerateBenchmarkSource">
		<ItemGroup>
			<BenchmarkSources Include="$(BuildTempDirectory)\GoogleSizeProtoFile.cs" />
{'fraction_non_alphanumeric': 0.16594276954522227, 'fraction_numerical': 0.0022994379151762903, 'mean_word_length': 8.188967136150234, 'pattern_counts': {'":': 0, '<': 111, '<?xml version=': 2, '>': 113, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '5589789', 'n_tokens_mistral': 2324, 'n_tokens_neox': 2078, 'n_words': 295}