import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

/*
 * This file was generated by the Gradle 'init' task.
 *
 * This generated file contains a sample Kotlin application project to get you started.
 * For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
 * User Manual available at https://docs.gradle.org/7.4.2/userguide/building_java_projects.html
 */


plugins {
    // Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
    id 'org.jetbrains.kotlin.jvm' version '1.9.22'

    // Apply the application plugin to add support for building a CLI application in Java.
    id 'application'
    id 'com.github.johnrengelman.shadow' version '7.1.2'
}


repositories {
    // Use Maven Central for resolving dependencies.
    mavenCentral()
}

dependencies {
    // Align versions of all Kotlin components
    implementation platform('org.jetbrains.kotlin:kotlin-bom')

    // Use the Kotlin JDK 8 standard library.
    implementation 'org.jetbrains.kotlin:kotlin-stdlib'

    // This dependency is used by the application.
    implementation 'com.google.guava:guava:33.0.0-jre'

    // Use the Kotlin test library.
    testImplementation 'org.jetbrains.kotlin:kotlin-test'

    // Use the Kotlin JUnit integration.
    testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
    testImplementation "org.jetbrains.kotlin:kotlin-test:1.9.22"
}


application {
    // Define the main class for the application.
    mainClass = 'de.ids_mannheim.korapxml2conllu.AppKt'
}

jar {
    // Will include every single one of your dependencies, project or not
    def lowerCasedName = baseName.toLowerCase()
    def normalizedName = lowerCasedName.substring(0,1).toUpperCase() + lowerCasedName.substring(1)

    manifest.attributes(
            'Class-Path': configurations.compileClasspath.collect { it.getName() }.join(' '),
            'Main-Class': "de.ids_mannheim.korapxml2conllu.AppKt"
    )

}


configurations {
    runtimeLib.extendsFrom implementation
}

tasks.withType(KotlinCompile).configureEach {
    kotlinOptions {
        jvmTarget = '17'
    }
}