<commit_before><?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <UsingTask TaskName="MakeAndroidResourcesInternalTask" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" Condition="'$(TargetFramework)' == '$(AndroidTargetFramework)'">
    <ParameterGroup>
      <ResourceFilePath Required="True" />
    </ParameterGroup>
    <Task>
      <Code Type="Fragment" Language="cs">
        try
        {
            var publicResourceClassDecl = "public";
            var internalResourceClassDecl = "[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]\npublic";
            
            // Check whether the auto-generated Resource.Designer.cs file exists
            if (File.Exists(ResourceFilePath))
            {
                Log.LogMessage("Found auto-generated resource file: " + ResourceFilePath, MessageImportance.Low);
                
                // Read the file
                var resourceClassDef = File.ReadAllText(ResourceFilePath);
                if (resourceClassDef.Contains(internalResourceClassDecl))
                {
                    Log.LogMessage("Auto-generated Resource class is already updated", MessageImportance.Low);
                }
                else if (resourceClassDef.Contains(publicResourceClassDecl))
                {
                    // Make the Resource class internal
                    resourceClassDef = resourceClassDef.Replace(publicResourceClassDecl, internalResourceClassDecl);
                    File.WriteAllText(ResourceFilePath, resourceClassDef);
                    Log.LogMessage("Updated auto-generated resource file to make Resource class internal", MessageImportance.Low);
                }
                else
                {
                    Log.LogError("Resource class declaration not found in auto-generated file " + ResourceFilePath);
                    return false;
                }
            }
            else
            {
                Log.LogWarning("Auto-generated file not found at path " + ResourceFilePath);
                return false;
            }
        }
        catch (Exception ex)
        {
            Log.LogError("Error occured: " + ex.Message + "\n" + ex.StackTrace);
            return false;
        }
      </Code>
    </Task>
  </UsingTask>
  <Target Name="MakeAndroidResourcesInternal" AfterTargets="_UpdateAndroidResgen">
    <MakeAndroidResourcesInternalTask ResourceFilePath="$(ProjectDir)$(AndroidResgenFile)">
    </MakeAndroidResourcesInternalTask>
  </Target><commit_msg>Return true on warning-only<commit_after><?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <UsingTask TaskName="MakeAndroidResourcesInternalTask" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" Condition="'$(TargetFramework)' == '$(AndroidTargetFramework)'">
    <ParameterGroup>
      <ResourceFilePath Required="True" />
    </ParameterGroup>
    <Task>
      <Code Type="Fragment" Language="cs">
        try
        {
            var publicResourceClassDecl = "public";
            var internalResourceClassDecl = "[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]\npublic";
            
            // Check whether the auto-generated Resource.Designer.cs file exists
            if (File.Exists(ResourceFilePath))
            {
                Log.LogMessage("Found auto-generated resource file: " + ResourceFilePath, MessageImportance.Low);
                
                // Read the file
                var resourceClassDef = File.ReadAllText(ResourceFilePath);
                if (resourceClassDef.Contains(internalResourceClassDecl))
                {
                    Log.LogMessage("Auto-generated Resource class is already updated", MessageImportance.Low);
                }
                else if (resourceClassDef.Contains(publicResourceClassDecl))
                {
                    // Make the Resource class internal
                    resourceClassDef = resourceClassDef.Replace(publicResourceClassDecl, internalResourceClassDecl);
                    File.WriteAllText(ResourceFilePath, resourceClassDef);
                    Log.LogMessage("Updated auto-generated resource file to make Resource class internal", MessageImportance.Low);
                }
                else
                {
                    Log.LogError("Resource class declaration not found in auto-generated file " + ResourceFilePath);
                    return false;
                }
            }
            else
            {
                Log.LogWarning("Auto-generated file not found at path " + ResourceFilePath);
                return true;
            }
        }
        catch (Exception ex)
        {
            Log.LogError("Error occured: " + ex.Message + "\n" + ex.StackTrace);
            return false;
        }
      </Code>
    </Task>
  </UsingTask>
  <Target Name="MakeAndroidResourcesInternal" AfterTargets="_UpdateAndroidResgen">
    <MakeAndroidResourcesInternalTask ResourceFilePath="$(ProjectDir)$(AndroidResgenFile)">
    </MakeAndroidResourcesInternalTask>
  </Target>
{'fraction_non_alphanumeric': 0.0964332892998679, 'fraction_numerical': 0.003396867333459143, 'mean_word_length': 2.156640857653365, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 2, '>': 33, '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': '3318737', 'n_tokens_mistral': 1259, 'n_tokens_neox': 1194, 'n_words': 244}