<commit_before><?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <!-- TODO: Figure out how to get signing to work in MicroBuildV2 for .xproj without using this "unsupported" manual approach. -->
        <PathToSigningDll>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\MicroBuild\Plugins\MicroBuild.Plugins.Signing.1.0.200\build\MicroBuild.Signing.dll</PathToSigningDll>
        <RunningInMicroBuild Condition="Exists('$(AGENT_BUILDDIRECTORY)')">true</RunningInMicroBuild>
        <SignAssembly Condition="Exists('$(PathToSigningDll)')">true</SignAssembly>
        <AssemblyOriginatorKeyFile>$(CommonBuildPropsLocation)\Keys\InternalKey.snk</AssemblyOriginatorKeyFile>
    </PropertyGroup>

    <PropertyGroup Condition="'$(PublicRelease)' == 'True'">
        <DefineConstants>$(DefineConstants);PUBLIC_RELEASE</DefineConstants>
        <DelaySign>true</DelaySign>
        <AssemblyOriginatorKeyFile>$(CommonBuildPropsLocation)\Keys\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
    </PropertyGroup>

    <ItemDefinitionGroup>
        <FilesToSign>
            <!-- Microsoft authenticode certificate for all file types -->
            <Authenticode Condition="'%(FilesToSign.Authenticode)' == ''">Microsoft</Authenticode>
            <!-- Microsoft strong-name key for managed assemblies -->
            <StrongName Condition="'$(TargetExt)' == '.winmdobj' OR '$(TargetExt)' == '.dll' OR '$(TargetExt)' == '.exe'">MsSharedLib72</StrongName>
        </FilesToSign>
    </ItemDefinitionGroup>

    <UsingTask TaskName="SignFiles" AssemblyFile="$(PathToSigningDll)" Condition="'$(RunningInMicroBuild)' == 'true'" />

    <Target Name="SignFiles" AfterTargets="AfterBuild" DependsOnTargets="AfterBuild">
        <SignFiles Condition="'$(RunningInMicroBuild)' == 'true' AND '$(SignAssembly)' == 'true'"
            Files="@(FilesToSign)"
            BinariesDirectory="$([System.IO.Path]::GetDirectoryName(%(FilesToSign.FullPath)))"
            IntermediatesDirectory="$([System.IO.Path]::GetDirectoryName(%(FilesToSign.FullPath)))"
            Type="$(SignType)" />
    </Target>
</Project><commit_msg>Added warning message when the signing DLL cannot be found.<commit_after><?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <!-- TODO: Figure out how to get signing to work in MicroBuildV2 for .xproj without using this "unsupported" manual approach. -->
        <PathToSigningDll>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\MicroBuild\Plugins\MicroBuild.Plugins.Signing.1.0.200\build\MicroBuild.Signing.dll</PathToSigningDll>
        <RunningInMicroBuild Condition="Exists('$(AGENT_BUILDDIRECTORY)')">true</RunningInMicroBuild>
        <SignAssembly Condition="Exists('$(PathToSigningDll)')">true</SignAssembly>
        <AssemblyOriginatorKeyFile>$(CommonBuildPropsLocation)\Keys\InternalKey.snk</AssemblyOriginatorKeyFile>
    </PropertyGroup>

    <PropertyGroup Condition="'$(PublicRelease)' == 'True'">
        <DefineConstants>$(DefineConstants);PUBLIC_RELEASE</DefineConstants>
        <DelaySign>true</DelaySign>
        <AssemblyOriginatorKeyFile>$(CommonBuildPropsLocation)\Keys\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
    </PropertyGroup>

    <ItemDefinitionGroup>
        <FilesToSign>
            <!-- Microsoft authenticode certificate for all file types -->
            <Authenticode Condition="'%(FilesToSign.Authenticode)' == ''">Microsoft</Authenticode>
            <!-- Microsoft strong-name key for managed assemblies -->
            <StrongName Condition="'$(TargetExt)' == '.winmdobj' OR '$(TargetExt)' == '.dll' OR '$(TargetExt)' == '.exe'">MsSharedLib72</StrongName>
        </FilesToSign>
    </ItemDefinitionGroup>

    <UsingTask TaskName="SignFiles" AssemblyFile="$(PathToSigningDll)" Condition="'$(RunningInMicroBuild)' == 'true'" />

    <Target Name="SignFiles" AfterTargets="AfterBuild" DependsOnTargets="AfterBuild">
        <Warning Condition="'$(SignAssembly)' != 'true'" Text="Signing assembly not found!"></Warning>
        <SignFiles Condition="'$(RunningInMicroBuild)' == 'true' AND '$(SignAssembly)' == 'true'"
            Files="@(FilesToSign)"
            BinariesDirectory="$([System.IO.Path]::GetDirectoryName(%(FilesToSign.FullPath)))"
            IntermediatesDirectory="$([System.IO.Path]::GetDirectoryName(%(FilesToSign.FullPath)))"
            Type="$(SignType)" />
    </Target>
</Project>
{'fraction_non_alphanumeric': 0.15685403243723617, 'fraction_numerical': 0.00933125972006221, 'mean_word_length': 4.476885644768856, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 2, '>': 77, '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': '598290', 'n_tokens_mistral': 1340, 'n_tokens_neox': 1224, 'n_words': 194}