apply plugin: 'java'
apply plugin: 'application'

group = 'org.dkf.jed2k'
version = '2.0'

description = "jed2k console application"

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

applicationDefaultJvmArgs = ["-Djava.util.logging.config.file=/home/inkpot/dev/jed2k/core/src/main/resources/logging.properties", "-ea"]

application {
    mainClass = 'org.dkf.jed2k.Kad'
}

jar {
    manifest {
        attributes 'Main-Class': 'org.dkf.jed2k.Kad'
    }
}

task fatJar(type: Jar) {
    manifest.from jar.manifest
    classifier = 'all'
    from {
        configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
    } {
        exclude "META-INF/*.SF"
        exclude "META-INF/*.DSA"
        exclude "META-INF/*.RSA"
    }
    with jar
}

artifacts {
    archives fatJar
}

repositories {
    mavenCentral()
    jcenter()
}

run {
    standardInput = System.in
}

dependencies {
    implementation project(':core')
    implementation 'com.google.code.gson:gson:2.7'
}
