<commit_before>package com.tencent.gradle

import org.gradle.api.Plugin
import org.gradle.api.Project

/**
 * Registers the plugin's tasks.
 *
 * @author <NAME> (<EMAIL>)
 */

class AndResGuardPlugin implements Plugin<Project> {

    @Override
    public void apply(Project project) {
        project.apply plugin: 'osdetector'
        project.extensions.create('andResGuard', AndResGuardExtension)
        project.extensions.add("sevenzip", new ExecutorExtension("sevenzip"))

        project.afterEvaluate {
            project.extensions.android.productFlavors.all { flavor ->
                createTask(project, flavor)
            }

            project.extensions.android.buildTypes.all { buildType ->
                createTask(project, buildType)
            }
            def ExecutorExtension sevenzip = project.extensions.findByName("sevenzip")
            sevenzip.loadArtifact(project)
        }
    }

    private void createTask(Project project, variant) {
        def typeName = new StringBuffer()
                .append(Character.toUpperCase(variant.name.charAt(0)))
                .append(variant.name[1..-1])
                .toString()

        def task = project.task("resguard${typeName}", type: AndResGuardTask)
        task.dependsOn "assemble${typeName}"
    }
}<commit_msg>add double dimensions tasks: buildTypes & productFlavors<commit_after>package com.tencent.gradle

import org.gradle.api.Plugin
import org.gradle.api.Project

/**
 * Registers the plugin's tasks.
 *
 * @author <NAME> (<EMAIL>)
 */

class AndResGuardPlugin implements Plugin<Project> {

    @Override
    public void apply(Project project) {
        project.apply plugin: 'osdetector'
        project.extensions.create('andResGuard', AndResGuardExtension)
        project.extensions.add("sevenzip", new ExecutorExtension("sevenzip"))

        project.afterEvaluate {
            project.extensions.android.productFlavors.all { flavor ->
                createTask(project, flavor)
            }

            project.extensions.android.buildTypes.all { buildType ->
                createTask(project, buildType)
            }

            project.extensions.android.productFlavors.all { flavor ->
                project.extensions.android.buildTypes.all { buildType ->
                    def variants = [flavor, buildType]
                    createTask(project, variants)
                }
            }

            def ExecutorExtension sevenzip = project.extensions.findByName("sevenzip")
            sevenzip.loadArtifact(project)
        }
    }

    private static void dealWithPascalCaseTypeName(typeName, variant) {
        typeName.append(Character.toUpperCase(variant.name.charAt(0)))
                .append(variant.name[1..-1])
    }

    private static void createTask(Project project, variants) {
        def typeName = new StringBuffer()

        variants.each { variant ->
            dealWithPascalCaseTypeName(typeName, variant)
        }

        def task = project.task("resguard${typeName}", type: AndResGuardTask)
        task.dependsOn "assemble${typeName}"
    }
}
{'fraction_non_alphanumeric': 0.10258899676375405, 'fraction_numerical': 0.001941747572815534, 'mean_word_length': 2.4004400440044003, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '143831', 'n_tokens_mistral': 846, 'n_tokens_neox': 799, 'n_words': 150}