buildscript {
    ext.kotlin_version = '1.3.40'

    repositories {
        mavenCentral()
        jcenter()
    }

    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.github.jengelman.gradle.plugins:shadow:5.0.0'
    }
}

repositories {
    mavenCentral()
    jcenter()
}

apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'kotlin'
mainClassName = 'com.github.angrypotato.kotato.MainKt'

group = GROUP
version = VERSION_NAME

repositories {
    mavenCentral()
    jcenter()
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'com.github.ajalt:clikt:2.0.0'
    implementation 'com.github.ajalt:mordant:1.2.1'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
    implementation "org.jetbrains.kotlin:kotlin-compiler-embeddable:$kotlin_version"
}

compileKotlin {
    kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
    kotlinOptions.jvmTarget = "1.8"
}

task fatJar(type: Jar) {
	manifest {
        attributes 'Implementation-Title': 'Executable Jar File',
        	'Implementation-Version': VERSION_NAME,
        	'Main-Class': 'com.github.angrypotato.kotato.MainKt'
    }
    baseName = project.name + '-all'
    from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
    with jar
}
