apply plugin: "java"
apply plugin: "maven"
apply plugin: "kotlin"
apply plugin: "com.github.johnrengelman.shadow"

group = "com.bajdcc"
version = "2.3.6"

description = """
GLR Compiler and Virtual Machine (Kotlin)
"""

sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
    options.encoding = "UTF-8"
}

repositories {
    mavenLocal()
    maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
    maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
}

dependencies {
    ext {
        kotlinVersion = "1.3.11"
    }
    compile "com.alibaba:fastjson:1.2.54"
    compile "log4j:log4j:1.2.17"
    compile "io.netty:netty-all:4.1.32.Final"
    compile "dom4j:dom4j:1.6.1"
    compile "jaxen:jaxen:1.1.6"
    compile "org.springframework.boot:spring-boot-starter-web:2.1.1.RELEASE"
    compile "org.springframework.boot:spring-boot-starter-thymeleaf:2.1.1.RELEASE"
    compile "nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:2.3.0"
    compile "org.webjars:webjars-locator:0.34"
    compile "org.webjars:vue:2.5.16"
    compile "org.webjars:layui:2.4.5"
    compile "org.webjars.npm:vue-resource:1.5.1"
    compile "org.webjars.bower:datatables:1.10.19"
    compile "com.vladsch.flexmark:flexmark-all:0.40.0"
    compile "net.java.dev.jna:jna:5.2.0"
    compile "net.java.dev.jna:jna-platform:5.2.0"
    compile "org.apache.commons:commons-text:1.6"
    compile "com.google.guava:guava:27.0.1-jre"
    compile "com.fasterxml.jackson.module:jackson-module-kotlin:2.9.8"
    compile 'com.squareup.okhttp3:okhttp:3.12.1'
    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
    compile "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
    testCompile "org.jetbrains.kotlin:kotlin-test:$kotlinVersion"
}

buildscript {
    ext {
        kotlinVersion = "1.3.11"
    }
    repositories {
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
        classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion"
        classpath "com.github.jengelman.gradle.plugins:shadow:4.0.3"
    }
}

allprojects {
    repositories {
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
    }
}

compileKotlin {
    kotlinOptions {
        freeCompilerArgs = ["-Xjsr305=strict"]
        jvmTarget = "1.8"
    }
}

compileTestKotlin {
    kotlinOptions {
        freeCompilerArgs = ["-Xjsr305=strict"]
        jvmTarget = "1.8"
    }
}

compileKotlin.destinationDir = compileJava.destinationDir
compileTestKotlin.destinationDir = compileJava.destinationDir

jar {
    duplicatesStrategy = "EXCLUDE"
    manifest {
        attributes(
                "Manifest-Version": 1.0,
                "Main-Class": "com.bajdcc.LALR1.ui.UIMainFrame"
        )
    }
}
