<commit_before>package org.gradle.api.plugins.shadow

import org.gradle.api.artifacts.Configuration
import org.gradle.api.plugins.shadow.tasks.KnowsTask
import org.gradle.api.plugins.shadow.tasks.OutputSignedLibsTask
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.JavaPlugin
import org.gradle.api.plugins.shadow.tasks.ShadowTask

class ShadowPlugin implements Plugin<Project>{

    static final String GROUP = "Shadow"

    @Override
    public void apply(Project project) {
        project.plugins.apply JavaPlugin
        addShadow(project)
    }

    void addShadow(Project project) {

        ["compile", "runtime"].each { config ->
            Configuration signed = project.configurations.add "signed${config.capitalize()}"
            Configuration original = project.configurations.getByName config
            original.extendsFrom = (original.extendsFrom + signed) as Set
        }

        project.extensions.create(ShadowTaskExtension.NAME, ShadowTaskExtension, project)

        KnowsTask knows = project.tasks.add(KnowsTask.NAME, KnowsTask)
        knows.description = KnowsTask.DESC
        knows.group = GROUP

        OutputSignedLibsTask signedCopyTask = project.tasks.add(OutputSignedLibsTask.NAME, OutputSignedLibsTask)
        signedCopyTask.description = OutputSignedLibsTask.DESC
        signedCopyTask.group = GROUP
        signedCopyTask.from project.configurations.signedCompile
        signedCopyTask.from project.configurations.signedRuntime
        signedCopyTask.into project.shadow.signedLibsDir<commit_msg>stop using deprecate methods to add configurations and tasks<commit_after>package org.gradle.api.plugins.shadow

import org.gradle.api.artifacts.Configuration
import org.gradle.api.plugins.shadow.tasks.KnowsTask
import org.gradle.api.plugins.shadow.tasks.OutputSignedLibsTask
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.JavaPlugin
import org.gradle.api.plugins.shadow.tasks.ShadowTask

class ShadowPlugin implements Plugin<Project>{

    static final String GROUP = "Shadow"

    @Override
    public void apply(Project project) {
        project.plugins.apply JavaPlugin
        addShadow(project)
    }

    void addShadow(Project project) {

        ["compile", "runtime"].each { config ->
            Configuration signed = project.configurations.create "signed${config.capitalize()}"
            Configuration original = project.configurations.getByName config
            original.extendsFrom = (original.extendsFrom + signed) as Set
        }

        project.extensions.create(ShadowTaskExtension.NAME, ShadowTaskExtension, project)

        KnowsTask knows = project.tasks.create(KnowsTask.NAME, KnowsTask)
        knows.description = KnowsTask.DESC
        knows.group = GROUP

        OutputSignedLibsTask signedCopyTask = project.tasks.add(OutputSignedLibsTask.NAME, OutputSignedLibsTask)
        signedCopyTask.description = OutputSignedLibsTask.DESC
        signedCopyTask.group = GROUP
        signedCopyTask.from project.configurations.signedCompile
        signedCopyTask.from project.configurations.signedRuntime
        signedCopyTask.into project.shadow.signedLibsDir
{'fraction_non_alphanumeric': 0.08034880099657428, 'fraction_numerical': 0.0, 'mean_word_length': 3.6483357452966714, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '4742197', 'n_tokens_mistral': 877, 'n_tokens_neox': 829, 'n_words': 161}