<commit_before>package org.mockito.release.internal.gradle;

import org.gradle.api.Action;
import org.gradle.api.Project;
import org.mockito.release.gradle.BumpVersionFileTask;
import org.mockito.release.gradle.VersioningPlugin;
import org.mockito.release.version.Version;

import java.io.File;

import static org.mockito.release.internal.gradle.CommonSettings.TASK_GROUP;

public class DefaultVersioningPlugin implements VersioningPlugin {

    public void apply(Project project) {
        File versionFile = project.file("version.properties");
        final String version = Version.versionFile(versionFile).getVersion();

        project.allprojects(new Action<Project>() {
            @Override
            public void execute(Project project) {
                project.setVersion(version);
            }
        });

        BumpVersionFileTask task = project.getTasks().create("bumpVersionFile", DefaultBumpVersionFileTask.class);
        task.setVersionFile(versionFile);
        task.setDescription("Increments version number in the properties file that contains the version.");
        task.setGroup(TASK_GROUP);
    }
}<commit_msg>Added useful logging<commit_after>package org.mockito.release.internal.gradle;

import org.gradle.api.Action;
import org.gradle.api.Project;
import org.gradle.api.logging.Logger;
import org.gradle.api.logging.Logging;
import org.gradle.api.plugins.ExtraPropertiesExtension;
import org.mockito.release.gradle.BumpVersionFileTask;
import org.mockito.release.gradle.VersioningPlugin;
import org.mockito.release.version.Version;

import java.io.File;

import static org.mockito.release.internal.gradle.CommonSettings.TASK_GROUP;

public class DefaultVersioningPlugin implements VersioningPlugin {

    private static Logger LOG = Logging.getLogger(DefaultVersioningPlugin.class);

    public void apply(Project project) {
        File versionFile = project.file("version.properties");
        final String version;

        ExtraPropertiesExtension ext = project.getExtensions().getExtraProperties();
        if (ext.has("release_version")) {
            version = ext.get("release_version").toString();
            LOG.lifecycle("  Using version '{}' supplied via 'release_version' project property.", version);
        } else {
            version = Version.versionFile(versionFile).getVersion();
            LOG.lifecycle("  Using version '{}' from '{}' file.", version, versionFile.getName());
        }

        project.allprojects(new Action<Project>() {
            @Override
            public void execute(Project project) {
                project.setVersion(version);
            }
        });

        BumpVersionFileTask task = project.getTasks().create("bumpVersionFile", DefaultBumpVersionFileTask.class);
        task.setVersionFile(versionFile);
        task.setDescription("Increments version number in the properties file that contains the version.");
        task.setGroup(TASK_GROUP);
    }
}
{'fraction_non_alphanumeric': 0.10271186440677967, 'fraction_numerical': 0.0, 'mean_word_length': 3.5751937984496123, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4048101', 'n_tokens_mistral': 779, 'n_tokens_neox': 750, 'n_words': 154}