<commit_before>buildscript {
    repositories {
        jcenter()
    }
}

plugins {
    java
    `maven-publish`
    id("com.jfrog.bintray").version("1.8.4")
    id("pl.allegro.tech.build.axion-release").version("1.10.3")
}

allprojects {
    apply(plugin = "java")
    apply(plugin = "pl.allegro.tech.build.axion-release")

    extra["springBootVersion"] = "2.2.2.RELEASE"
    extra["p6SpyVersion"] = "3.8.7"
    extra["datasourceProxyVersion"] = "1.6"
    extra["flexyPoolVersion"] = "2.2.1"
    extra["sleuthVersion"] = "2.2.1.RELEASE"

    extra["release"] = listOf(
            "datasource-decorator-spring-boot-autoconfigure",
            "datasource-proxy-spring-boot-starter",
            "flexy-pool-spring-boot-starter",
            "p6spy-spring-boot-starter"
    ).contains(project.name)

    scmVersion {
        with(tag) {
            prefix = ""
            versionSeparator = ""
        }
    }

    java.sourceCompatibility = JavaVersion.VERSION_1_8

    group = "com.github.gavlyukovskiy"
    version = scmVersion.version

    repositories {
        mavenCentral()
    }

    tasks {
        val releaseCheck by registering {
            doLast {
                val errors = ArrayList<String>()
                if (!project.hasProperty("release.version"))
                    errors.add("'-Prelease.version' must be set")
                if (!project.hasProperty("release.customUsername"))
                    errors.add("'-Prelease.customUsername' must be set")
                if (!project.hasProperty("release.customPassword"))
                    errors.add("'-Prelease.customPassword' must be set")
                if (!errors.isEmpty()) {
                    throw IllegalStateException(errors.joinToString("\n"))
                }
            }
        }

        verifyRelease {
            finalizedBy(releaseCheck)
        }
    }

    if (extra["release"] as Boolean) {
        apply(plugin = "maven-publish")
        apply(plugin = "com.jfrog.bintray")

        tasks {
            val bintrayUploadCheck by registering {
                doLast {
                    val errors = ArrayList<String>()
                    if ((project.version as String).contains("SNAPSHOT")) {
                        errors.add("Cannot release SNAPSHOT version")
                    }
                    if (System.getenv("BINTRAY_USER") == null && !project.hasProperty("release.bintray_user"))
                        errors.add("'BINTRAY_USER' or '-Prelease.bintray_user' must be set")
                    if (System.getenv("BINTRAY_KEY") == null && !project.hasProperty("release.bintray_key"))
                        errors.add("'BINTRAY_KEY' or '-Prelease.bintray_key' must be set")
                    if (System.getenv("GPG_PASSPHRASE") == null && !project.hasProperty("release.gpg_passphrase"))
                        errors.add("'GPG_PASSPHRASE' or '-Prelease.gpg_passphrase' must be set")
                    if (System.getenv("SONATYPE_USER") == null && !project.hasProperty("release.sonatype_user"))
                        errors.add("'SONATYPE_USER' or '-Prelease.sonatype_user' must be set")
                    if (System.getenv("SONATYPE_PASSWORD") == null && !project.hasProperty("release.sonatype_password"))
                        errors.add("'SONATYPE_PASSWORD' or '-Prelease.sonatype_password' must be set")
                    if (!errors.isEmpty()) {
                        throw IllegalStateException(errors.joinToString("\n"))
                    }
                }
            }

            bintrayUpload {
                dependsOn(bintrayUploadCheck)
            }

            verifyRelease {
                dependsOn(build)
            }

            withType<Jar> {
                from(rootProject.projectDir) {
                    include("LICENSE.txt")
                    into("META-INF")
                }
            }
        }

        val sourceJar by tasks.registering(Jar::class) {
            archiveClassifier.set("sources")<commit_msg>Fixed release process<commit_after>buildscript {
    repositories {
        jcenter()
    }
}

plugins {
    java
    `maven-publish`
    id("com.jfrog.bintray").version("1.8.4")
    id("pl.allegro.tech.build.axion-release").version("1.10.3")
}

allprojects {
    apply(plugin = "java")
    apply(plugin = "pl.allegro.tech.build.axion-release")

    extra["springBootVersion"] = "2.2.2.RELEASE"
    extra["p6SpyVersion"] = "3.8.7"
    extra["datasourceProxyVersion"] = "1.6"
    extra["flexyPoolVersion"] = "2.2.1"
    extra["sleuthVersion"] = "2.2.1.RELEASE"

    extra["release"] = listOf(
            "datasource-decorator-spring-boot-autoconfigure",
            "datasource-proxy-spring-boot-starter",
            "flexy-pool-spring-boot-starter",
            "p6spy-spring-boot-starter"
    ).contains(project.name)

    scmVersion {
        with(tag) {
            prefix = ""
            versionSeparator = ""
        }
    }

    java.sourceCompatibility = JavaVersion.VERSION_1_8

    group = "com.github.gavlyukovskiy"
    version = scmVersion.version

    repositories {
        mavenCentral()
    }

    tasks {
        val releaseCheck by registering {
            doLast {
                val errors = ArrayList<String>()
                if (!project.hasProperty("release.version"))
                    errors.add("'-Prelease.version' must be set")
                if (!project.hasProperty("release.customUsername"))
                    errors.add("'-Prelease.customUsername' must be set")
                if (!project.hasProperty("release.customPassword"))
                    errors.add("'-Prelease.customPassword' must be set")
                if (!errors.isEmpty()) {
                    throw IllegalStateException(errors.joinToString("\n"))
                }
            }
        }

        verifyRelease {
            dependsOn(build)
            finalizedBy(releaseCheck)
        }
    }

    if (extra["release"] as Boolean) {
        apply(plugin = "maven-publish")
        apply(plugin = "com.jfrog.bintray")

        tasks {
            val bintrayUploadCheck by registering {
                doLast {
                    val errors = ArrayList<String>()
                    if ((project.version as String).contains("SNAPSHOT")) {
                        errors.add("Cannot release SNAPSHOT version")
                    }
                    if (System.getenv("BINTRAY_USER") == null && !project.hasProperty("release.bintray_user"))
                        errors.add("'BINTRAY_USER' or '-Prelease.bintray_user' must be set")
                    if (System.getenv("BINTRAY_KEY") == null && !project.hasProperty("release.bintray_key"))
                        errors.add("'BINTRAY_KEY' or '-Prelease.bintray_key' must be set")
                    if (System.getenv("GPG_PASSPHRASE") == null && !project.hasProperty("release.gpg_passphrase"))
                        errors.add("'GPG_PASSPHRASE' or '-Prelease.gpg_passphrase' must be set")
                    if (System.getenv("SONATYPE_USER") == null && !project.hasProperty("release.sonatype_user"))
                        errors.add("'SONATYPE_USER' or '-Prelease.sonatype_user' must be set")
                    if (System.getenv("SONATYPE_PASSWORD") == null && !project.hasProperty("release.sonatype_password"))
                        errors.add("'SONATYPE_PASSWORD' or '-Prelease.sonatype_password' must be set")
                    if (!errors.isEmpty()) {
                        throw IllegalStateException(errors.joinToString("\n"))
                    }
                }
            }

            bintrayUpload {
                dependsOn(bintrayUploadCheck)
            }

            withType<Jar> {
                from(rootProject.projectDir) {
                    include("LICENSE.txt")
                    into("META-INF")
                }
            }
        }

        val sourceJar by tasks.registering(Jar::class) {
            archiveClassifier.set("sources")
{'fraction_non_alphanumeric': 0.1252352867361024, 'fraction_numerical': 0.006274312962730581, 'mean_word_length': 1.7416580667354662, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4070409', 'n_tokens_mistral': 2321, 'n_tokens_neox': 2192, 'n_words': 334}