plugins {
    id 'java'
}

sourceCompatibility=JavaVersion.VERSION_1_8
targetCompatibility=JavaVersion.VERSION_1_8

repositories {
    mavenCentral()
}

dependencies {
    // https://mvnrepository.com/artifact/cn.hutool/hutool-all
    implementation group: 'cn.hutool', name: 'hutool-all', version: '5.8.12'
// https://mvnrepository.com/artifact/commons-cli/commons-cli
    implementation group: 'commons-cli', name: 'commons-cli', version: '1.5.0'
// https://mvnrepository.com/artifact/com.alibaba/fastjson
    implementation group: 'com.alibaba', name: 'fastjson', version: '2.0.24'

    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}

test {
    useJUnitPlatform()
}

task customFatJar(type: Jar) {
    manifest {
        attributes 'Main-Class': 'Main'
    }
    baseName = 'apisixconf'
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
    from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
    with jar
}