<commit_before>package org.jtrim2.build;

import java.io.IOException;
import org.gradle.api.Project;

import static org.jtrim2.build.BuildFileUtils.*;

public final class Versions {
    private static final String GROUP_NAME = "org.jtrim2";

    private static final String VERSION_BASE_PROPERTY = "versionBase";

    public static void setVersion(Project project) throws IOException {
        String suffix = ReleaseUtils.isRelease(project) ? "" : "-SNAPSHOT";

        String versionBase = readTextFile(rootPath(project, "version.txt")).trim();
        project.getExtensions().add(VERSION_BASE_PROPERTY, versionBase);

        project.setGroup(GROUP_NAME);
        project.setVersion(versionBase + suffix);
    }

    public static String getVersion(Project project) {
        Object version = project.getVersion();
        return version != null ? version.toString() : null;
    }

    public static String getVersionBase(Project project) {
        return ProjectUtils.getStringProperty(project, VERSION_BASE_PROPERTY, "");
    }

    private Versions() {
        throw new AssertionError();
    }
}
<commit_msg>Build now allows to specify custom version suffix.<commit_after>package org.jtrim2.build;

import java.io.IOException;
import org.gradle.api.Project;

import static org.jtrim2.build.BuildFileUtils.*;

public final class Versions {
    private static final String GROUP_NAME = "org.jtrim2";

    private static final String VERSION_BASE_PROPERTY = "versionBase";
    private static final String VERSION_SUFFIX_PROPERTY = "versionSuffix";

    public static void setVersion(Project project) throws IOException {
        String versionBase = readTextFile(rootPath(project, "version.txt")).trim();
        project.getExtensions().add(VERSION_BASE_PROPERTY, versionBase);

        project.setGroup(GROUP_NAME);
        project.setVersion(versionBase + getVersionSuffix(project));
    }

    private static String getVersionSuffix(Project project) {
        boolean release = ReleaseUtils.isRelease(project);

        String defaultSuffix = release ? "" : "SNAPSHOT";
        String suffix = ProjectUtils.getStringProperty(project, VERSION_SUFFIX_PROPERTY, defaultSuffix);
        return suffix.isEmpty()
                ? ""
                : "-" + suffix;
    }

    public static String getVersion(Project project) {
        Object version = project.getVersion();
        return version != null ? version.toString() : null;
    }

    public static String getVersionBase(Project project) {
        return ProjectUtils.getStringProperty(project, VERSION_BASE_PROPERTY, "");
    }

    private Versions() {
        throw new AssertionError();
    }
}

{'fraction_non_alphanumeric': 0.09582863585118377, 'fraction_numerical': 0.002254791431792559, 'mean_word_length': 3.511864406779661, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3223261', 'n_tokens_mistral': 710, 'n_tokens_neox': 704, 'n_words': 171}