plugins {
    id 'java-module' // buildSrc/src/main/groovy/java-module.gradle
    id 'application'
    id 'com.github.johnrengelman.shadow'
}

defaultTasks 'shadowJar'

mainClassName = "com.emc.ecs.sync.ctl.EcsSyncCtl"

dependencies {
    internal platform(project(":platform")) // all library versions should be specified in the platform project
    implementation "org.slf4j:slf4j-api"
    implementation "commons-cli:commons-cli"
    implementation 'org.apache.logging.log4j:log4j-core'
    implementation "com.sun.jersey:jersey-client"
    // jaxb was removed from Java 11 - jaxb dependencies are provided with Java 8
    implementation "javax.xml.bind:jaxb-api"
    implementation project(':ecs-sync-model')
    file("${rootProject.projectDir}/storage-plugins").eachDir {
        if (it.name.endsWith("-model"))
            implementation project(":storage-plugins:${it.name}")
    }
    file("${rootProject.projectDir}/filter-plugins").eachDir {
        if (it.name.endsWith("-model"))
            implementation project(":filter-plugins:${it.name}")
    }
    implementation project(':ecs-sync-jaxrs')

    runtimeOnly "org.apache.logging.log4j:log4j-slf4j-impl"

    testImplementation 'org.junit.jupiter:junit-jupiter-api'

    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
    testRuntimeOnly 'org.apache.logging.log4j:log4j-slf4j-impl'
}

test {
    useJUnitPlatform()
}

shadowJar {
    classifier ''
    manifest {
        attributes(
                'Multi-Release': true
        )
    }
}