apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'corda.common-publishing'

description 'Network bootstrapper'

dependencies {
    implementation project(':core')
    implementation project(':node-api')
    implementation project(':tools:cliutils')
    implementation project(":common-logging")
    implementation project(':common-configuration-parsing')
    implementation project(':common-validation')

    implementation "org.apache.logging.log4j:log4j-slf4j2-impl:$log4j_version"
    implementation "com.typesafe:config:$typesafe_config_version"
    implementation "info.picocli:picocli:$picocli_version"

    testImplementation(project(':test-utils')) {
        exclude group: 'org.apache.logging.log4j', module: 'log4j-slf4j2-impl'
    }

    testImplementation(project(':core-test-utils'))
    testImplementation(project(':test-cli'))

    testImplementation "junit:junit:$junit_version"
    testImplementation "org.mockito.kotlin:mockito-kotlin:$mockito_kotlin_version"
    testImplementation "org.mockito:mockito-core:$mockito_version"
}

processResources {
    from file("$rootDir/config/dev/log4j2.xml")
}

jar {
    from(configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }) {
        exclude "META-INF/*.SF"
        exclude "META-INF/*.DSA"
        exclude "META-INF/*.RSA"
    }
    from(project(':node:capsule').tasks['buildCordaJAR']) {
        rename 'corda-(.*)', 'corda.jar'
    }
    baseName = "network-bootstrapper"
    manifest {
        attributes(
                'Main-Class': 'net.corda.bootstrapper.MainKt'
        )
    }
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

jar.dependsOn ':testing:testserver:testcapsule:buildWebserverJar'

publishing {
    publications {
        maven(MavenPublication) {
            artifactId 'corda-tools-network-bootstrapper'
            from components.java
        }
    }
}
