buildscript {
    repositories {
        mavenLocal()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.github.jengelman.gradle.plugins:shadow:5.1.0'
    }
}

apply plugin: 'groovy'
apply plugin: 'com.github.johnrengelman.shadow'

if (!JavaVersion.current().java8Compatible) {
    throw new IllegalStateException('''Please install Java 8!'''.stripMargin())
}

sourceSets.main.java.srcDirs = []
sourceSets.main.groovy.srcDirs += ["src/main/java"]

repositories {
    mavenLocal()
    jcenter()
    mavenCentral()
}

dependencies {
    implementation "org.codehaus.groovy:groovy:${GROOVY_VER}"
    implementation "io.vertx:vertx-core:${VERTX_VER}"
    implementation "io.vertx:vertx-web:${VERTX_VER}"
    implementation "io.vertx:vertx-auth-jwt:${VERTX_VER}"
    implementation "io.vertx:vertx-circuit-breaker:${VERTX_VER}"
    implementation "io.vertx:vertx-ignite:${VERTX_VER}"
    implementation "ch.qos.logback:logback-classic:${LOGBACK_VER}"

    testImplementation "org.spockframework:spock-core:${SPOCK_VER}"
}

version = '0.1.5'

shadowJar {
    classifier = 'fat'
    baseName = 'dgate'
    manifest {
        attributes 'Main-Class': 'top.dteam.dgate.Launcher'
        attributes 'Main-Verticle': 'top.dteam.dgate.MainVerticle'
    }
    mergeServiceFiles {
        include 'META-INF/services/io.vertx.core.spi.VerticleFactory'
    }
}
