apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'com.github.johnrengelman.shadow'

idea {
    project {
        jdkName = '11'
        languageLevel = '11'
        vcs = 'Git'
    }
}

group = 'org.aimlang'
version = '1.0-SNAPSHOT'

ext {
    junitVersion = '5.1.0'
    logbackVersion = '1.2.3'
    lombokVersion = '1.18.16'
    slf4jVersion = '1.7.25'
}

sourceCompatibility = 11
targetCompatibility = 11

tasks.withType(JavaCompile) {
    options.encoding = 'UTF-8'
}

jar {
    manifest.attributes("Main-Class": "org.aimlang.core.App")
    manifest.attributes("Manifest-Version": 1.0)
}

task fatJar(type: Jar) {
    manifest.attributes("Main-Class": "org.aimlang.core.App")
    manifest.attributes("Manifest-Version": 1.0)
    baseName = 'aiml'
    version = ''
    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
    with jar
}
repositories {
    mavenLocal()
    mavenCentral()
}
project.buildDir = 'target'
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
    }
}

dependencies {
    compile "ch.qos.logback:logback-classic:$logbackVersion"
    compile "org.projectlombok:lombok:$lombokVersion"
    testCompile "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
}