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

  <PropertyGroup>
    <IlcBuildTasksPath Condition="'$(IlcBuildTasksPath)' == ''">$(MSBuildThisFileDirectory)..\tools\ILCompiler.Build.Tasks.dll</IlcBuildTasksPath>
    
    <!--
      Prevent dotnet CLI from deploying the CoreCLR shim executable since we produce
      a native executable.
    -->
    <DeployAppHost>false</DeployAppHost>
  </PropertyGroup>

  <Target Name="_ComputeIlcCompileInputs"
          BeforeTargets="ComputeIlcCompileInputs"
          DependsOnTargets="$(IlcDynamicBuildPropertyDependencies)">
    <ItemGroup>
      <IlcReference Include="@(_ManagedResolvedAssembliesToPublish)" />
    </ItemGroup>
  </Target>

  <!--
    This target hooks into the dotnet CLI publish pipeline. That pipeline has
    a target called ComputeFilesToPublish which produces the ItemGroup
    ResolvedFileToPublish based on the inputs of @(IntermediateAssembly)
    and @(ResolvedAssembliesToPublish). We modify those two item groups
    to control what gets published after CoreRT optimizes the application.
  -->
  <Target Name="ComputeLinkedFilesToPublish"
          BeforeTargets="ComputeFilesToPublish"
          DependsOnTargets="_ComputeAssembliesToCompileToNative;LinkNative">
    
    <ItemGroup>
      <ResolvedAssembliesToPublish Remove="@(_AssembliesToSkipPublish)" />
      <ResolvedAssembliesToPublish Include="@(_LinkedResolvedAssemblies)" />
    </ItemGroup>
    
    <ItemGroup>
      <_NativeIntermediateAssembly Include="@(IntermediateAssembly->'$(NativeOutputPath)%(Filename)$(NativeBinaryExt)')" />
      <IntermediateAssembly Remove="@(IntermediateAssembly)" />
      <IntermediateAssembly Include="@(_NativeIntermediateAssembly)" />
    </ItemGroup>
  </Target>
  
  <!--
    Filter the input publish file list selecting managed assemblies for compilation.
    Also produces _AssembliesToSkipPublish which chops out things from the publish
    pipeline we don't want to see in the output (native images, CoreCLR artifacts)
    until we get a proper AOT NetCore app package.
  -->
  <UsingTask TaskName="ComputeManagedAssemblies" AssemblyFile="$(IlcBuildTasksPath)" />
  <Target Name="_ComputeAssembliesToCompileToNative" DependsOnTargets="$(IlcDynamicBuildPropertyDependencies)">

    <!-- CoreRT SDK and Framework Assemblies need to be defined to avoid CoreCLR implementations being set as compiler inputs -->  
    <Error Condition="'@(PrivateSdkAssemblies)' == ''" Text="The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" />
    <Error Condition="'@(FrameworkAssemblies)' == ''" Text="The FrameworkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" />

    <ComputeManagedAssemblies Assemblies="@(ResolvedAssembliesToPublish)" 
    DotNetAppHostExecutableName="$(_DotNetAppHostExecutableName)" DotNetHostFxrLibraryName="$(_DotNetHostFxrLibraryName)" DotNetHostPolicyLibraryName="$(_DotNetHostPolicyLibraryName)"
    SdkAssemblies="@(PrivateSdkAssemblies)" FrameworkAssemblies="@(FrameworkAssemblies)">
      <Output TaskParameter="ManagedAssemblies" ItemName="_ManagedResolvedAssembliesToPublish" />
      <Output TaskParameter="AssembliesToSkipPublish" ItemName="_AssembliesToSkipPublish" />
    </ComputeManagedAssemblies><commit_msg>Fail with descriptive error message when RID is not specified for native compilation (#5364)<commit_after><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup>
    <IlcBuildTasksPath Condition="'$(IlcBuildTasksPath)' == ''">$(MSBuildThisFileDirectory)..\tools\ILCompiler.Build.Tasks.dll</IlcBuildTasksPath>
    
    <!--
      Prevent dotnet CLI from deploying the CoreCLR shim executable since we produce
      a native executable.
    -->
    <DeployAppHost>false</DeployAppHost>
  </PropertyGroup>

  <Target Name="_ComputeIlcCompileInputs"
          BeforeTargets="ComputeIlcCompileInputs"
          DependsOnTargets="$(IlcDynamicBuildPropertyDependencies)">
    <ItemGroup>
      <IlcReference Include="@(_ManagedResolvedAssembliesToPublish)" />
    </ItemGroup>
  </Target>

  <!--
    This target hooks into the dotnet CLI publish pipeline. That pipeline has
    a target called ComputeFilesToPublish which produces the ItemGroup
    ResolvedFileToPublish based on the inputs of @(IntermediateAssembly)
    and @(ResolvedAssembliesToPublish). We modify those two item groups
    to control what gets published after CoreRT optimizes the application.
  -->
  <Target Name="ComputeLinkedFilesToPublish"
          BeforeTargets="ComputeFilesToPublish"
          DependsOnTargets="_ComputeAssembliesToCompileToNative;LinkNative">
    
    <ItemGroup>
      <ResolvedAssembliesToPublish Remove="@(_AssembliesToSkipPublish)" />
      <ResolvedAssembliesToPublish Include="@(_LinkedResolvedAssemblies)" />
    </ItemGroup>
    
    <ItemGroup>
      <_NativeIntermediateAssembly Include="@(IntermediateAssembly->'$(NativeOutputPath)%(Filename)$(NativeBinaryExt)')" />
      <IntermediateAssembly Remove="@(IntermediateAssembly)" />
      <IntermediateAssembly Include="@(_NativeIntermediateAssembly)" />
    </ItemGroup>
  </Target>
  
  <!--
    Filter the input publish file list selecting managed assemblies for compilation.
    Also produces _AssembliesToSkipPublish which chops out things from the publish
    pipeline we don't want to see in the output (native images, CoreCLR artifacts)
    until we get a proper AOT NetCore app package.
  -->
  <UsingTask TaskName="ComputeManagedAssemblies" AssemblyFile="$(IlcBuildTasksPath)" />
  <Target Name="_ComputeAssembliesToCompileToNative" DependsOnTargets="$(IlcDynamicBuildPropertyDependencies)">

    <!-- Fail with descriptive error message for common mistake. -->
    <Error Condition="'$(RuntimeIdentifier)' == ''" Text="RuntimeIdentifier is required for native compilation. Try running dotnet publish with the -r option value specified." />

    <!-- CoreRT SDK and Framework Assemblies need to be defined to avoid CoreCLR implementations being set as compiler inputs -->  
    <Error Condition="'@(PrivateSdkAssemblies)' == ''" Text="The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" />
    <Error Condition="'@(FrameworkAssemblies)' == ''" Text="The FrameworkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" />

    <ComputeManagedAssemblies Assemblies="@(ResolvedAssembliesToPublish)" 
    DotNetAppHostExecutableName="$(_DotNetAppHostExecutableName)" DotNetHostFxrLibraryName="$(_DotNetHostFxrLibraryName)" DotNetHostPolicyLibraryName="$(_DotNetHostPolicyLibraryName)"
    SdkAssemblies="@(PrivateSdkAssemblies)" FrameworkAssemblies="@(FrameworkAssemblies)">
      <Output TaskParameter="ManagedAssemblies" ItemName="_ManagedResolvedAssembliesToPublish" />
      <Output TaskParameter="AssembliesToSkipPublish" ItemName="_AssembliesToSkipPublish" />
    </ComputeManagedAssemblies>
{'fraction_non_alphanumeric': 0.09919493962047153, 'fraction_numerical': 0.0017251293847038527, 'mean_word_length': 5.206066012488849, 'pattern_counts': {'":': 0, '<': 75, '<?xml version=': 0, '>': 77, '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': '5394625', 'n_tokens_mistral': 1974, 'n_tokens_neox': 1843, 'n_words': 428}