<commit_before>import com.jfrog.bintray.gradle.BintrayExtension
import groovy.util.Node
import groovy.util.NodeList
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.util.Date
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

group = "test_runner"
version = "SNAPSHOT"

plugins {
    application
    jacoco
    kotlin("jvm") version Versions.KOTLIN

    id("io.gitlab.arturbosch.detekt") version Versions.DETEKT
    id("com.jfrog.bintray") version "1.8.4"
    id("maven-publish")
    id("com.github.johnrengelman.shadow") version "5.2.0"
}

val artifactID = "flank"

val shadowJar: ShadowJar by tasks
shadowJar.apply {
    archiveBaseName.set(artifactID)
    mergeServiceFiles()
    @Suppress("UnstableApiUsage")
    manifest {
        attributes(mapOf("Main-Class" to "ftl.Main"))
    }
}

// https://bintray.com/flank/maven
// https://github.com/bintray/gradle-bintray-plugin#readme
bintray {
    user = System.getenv("MVN_USER")
    key = System.getenv("MVN_KEY")
    publish = true
    setPublications("mavenJava")
    pkg(closureOf<BintrayExtension.PackageConfig> {
        repo = "maven"
        name = "flank"
        userOrg = "flank"
        setLicenses("Apache-2.0")
        vcsUrl = "https://github.com/Flank/flank.git"
        version(closureOf<BintrayExtension.VersionConfig> {
            name = System.getenv("MVN_VERSION")
            vcsTag = System.getenv("MVN_REVISION")
            released = Date().toString()
        })
    })
}

publishing {
    publications {
        register("mavenJava", MavenPublication::class) {
            from(components["java"])

            groupId = "flank"
            artifactId = "flank"
            version = System.getenv("MVN_VERSION")

            artifact(shadowJar)

            pom.withXml {
                // Remove deps since we're publishing a fat jar
                val pom = asNode()
                val depNode: NodeList = pom.get("dependencies") as NodeList
                for (child in depNode) {
                    pom.remove(child as Node)
                }
            }
        }
    }
}

detekt {
    input = files("src/main/kotlin", "src/test/kotlin")
    config = files("../config/detekt.yml")
    reports {
        xml {
            enabled = false
        }
        html {
            enabled = true
        }
    }
}

// http://www.eclemma.org/jacoco/
jacoco {
    toolVersion = "0.8.5"
}

tasks.jacocoTestReport {
    classDirectories.setFrom(
        fileTree("build/classes/kotlin/main").apply {
            exclude("**/*\$run$1.class")
            exclude("**/ftl/mock/*")
        })

    reports {
        xml.isEnabled = true
        html.isEnabled = true
    }
}

tasks.withType<KotlinCompile>().configureEach {
    // https://devcenter.bitrise.io/builds/available-environment-variables/
    val runningOnBitrise = System.getenv("BITRISE_IO") != null
    kotlinOptions.allWarningsAsErrors = runningOnBitrise
}

apply {
    plugin("kotlin")
}

application {
    mainClassName = "main"
}

repositories {
    maven(url = "http://dl.bintray.com/kotlin/ktor")
    maven(url = "https://dl.bintray.com/kotlin/kotlinx")
    jcenter()
}

// Output full test results to console
// Avoids having to read the HTML report
tasks.withType<Test> {
    testLogging {
        events("passed", "skipped", "failed")
        exceptionFormat = TestExceptionFormat.FULL
    }
}

dependencies {
    implementation(Libs.BUGSNAG)

    implementation(Libs.DD_PLIST)
    implementation(Libs.DEX_TEST_PARSER)
<commit_msg>Fix application name (#675)<commit_after>import com.jfrog.bintray.gradle.BintrayExtension
import groovy.util.Node
import groovy.util.NodeList
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.util.Date
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

group = "test_runner"
version = "SNAPSHOT"

plugins {
    application
    jacoco
    kotlin("jvm") version Versions.KOTLIN

    id("io.gitlab.arturbosch.detekt") version Versions.DETEKT
    id("com.jfrog.bintray") version "1.8.4"
    id("maven-publish")
    id("com.github.johnrengelman.shadow") version "5.2.0"
}

val artifactID = "flank"

val shadowJar: ShadowJar by tasks
shadowJar.apply {
    archiveBaseName.set(artifactID)
    mergeServiceFiles()
    @Suppress("UnstableApiUsage")
    manifest {
        attributes(mapOf("Main-Class" to "ftl.Main"))
    }
}

// https://bintray.com/flank/maven
// https://github.com/bintray/gradle-bintray-plugin#readme
bintray {
    user = System.getenv("MVN_USER")
    key = System.getenv("MVN_KEY")
    publish = true
    setPublications("mavenJava")
    pkg(closureOf<BintrayExtension.PackageConfig> {
        repo = "maven"
        name = "flank"
        userOrg = "flank"
        setLicenses("Apache-2.0")
        vcsUrl = "https://github.com/Flank/flank.git"
        version(closureOf<BintrayExtension.VersionConfig> {
            name = System.getenv("MVN_VERSION")
            vcsTag = System.getenv("MVN_REVISION")
            released = Date().toString()
        })
    })
}

publishing {
    publications {
        register("mavenJava", MavenPublication::class) {
            from(components["java"])

            groupId = "flank"
            artifactId = "flank"
            version = System.getenv("MVN_VERSION")

            artifact(shadowJar)

            pom.withXml {
                // Remove deps since we're publishing a fat jar
                val pom = asNode()
                val depNode: NodeList = pom.get("dependencies") as NodeList
                for (child in depNode) {
                    pom.remove(child as Node)
                }
            }
        }
    }
}

detekt {
    input = files("src/main/kotlin", "src/test/kotlin")
    config = files("../config/detekt.yml")
    reports {
        xml {
            enabled = false
        }
        html {
            enabled = true
        }
    }
}

// http://www.eclemma.org/jacoco/
jacoco {
    toolVersion = "0.8.5"
}

tasks.jacocoTestReport {
    classDirectories.setFrom(
        fileTree("build/classes/kotlin/main").apply {
            exclude("**/*\$run$1.class")
            exclude("**/ftl/mock/*")
        })

    reports {
        xml.isEnabled = true
        html.isEnabled = true
    }
}

tasks.withType<KotlinCompile>().configureEach {
    // https://devcenter.bitrise.io/builds/available-environment-variables/
    val runningOnBitrise = System.getenv("BITRISE_IO") != null
    kotlinOptions.allWarningsAsErrors = runningOnBitrise
}

apply {
    plugin("kotlin")
}

application {
    mainClassName = "ftl.Main"
}

repositories {
    maven(url = "http://dl.bintray.com/kotlin/ktor")
    maven(url = "https://dl.bintray.com/kotlin/kotlinx")
    jcenter()
}

// Output full test results to console
// Avoids having to read the HTML report
tasks.withType<Test> {
    testLogging {
        events("passed", "skipped", "failed")
        exceptionFormat = TestExceptionFormat.FULL
    }
}

dependencies {
    implementation(Libs.BUGSNAG)

    implementation(Libs.DD_PLIST)
    implementation(Libs.DEX_TEST_PARSER)

{'fraction_non_alphanumeric': 0.12649763165227082, 'fraction_numerical': 0.0037614934522151016, 'mean_word_length': 2.4431654676258994, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, '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': '6932838', 'n_tokens_mistral': 2428, 'n_tokens_neox': 2311, 'n_words': 371}