plugins {
    id 'corda.common-publishing'
    id 'corda.common-library'
}
description 'Corda REST Client'

ext.cordaEnableFormatting = true

dependencies {

    compileOnly "org.osgi:osgi.annotation"

    implementation platform("net.corda:corda-api:$cordaApiVersion")
    implementation "net.corda:corda-base"
    implementation "net.corda:corda-application"

    implementation 'org.jetbrains.kotlin:kotlin-osgi-bundle'
    implementation "org.apache.commons:commons-lang3:$commonsLangVersion"
    implementation "net.corda:corda-crypto"

    api project(":libs:rest:rest")
    implementation project(':libs:crypto:crypto-core')
    implementation project(":libs:rest:rest-common")
    implementation project(":libs:rest:rest-tools")
    implementation project(":libs:rest:json-serialization")
    implementation project(":libs:utilities")

    implementation libs.unirest.java
    implementation libs.unirest.objectmapper.jackson
    implementation libs.jackson.module.kotlin

    testImplementation project(":testing:test-utilities")

    testImplementation project(":libs:rest:rest-test-common")

    testRuntimeOnly 'org.osgi:osgi.core'

    integrationTestImplementation project(":libs:rest:rest-server")
    integrationTestImplementation project(":libs:rest:rest-server-impl")
    integrationTestImplementation project(':libs:utilities')
    integrationTestImplementation project(':libs:rest:ssl-cert-read')
    integrationTestImplementation project(':libs:rest:ssl-cert-read-impl')
}

tasks.withType(Test).configureEach {
    jvmArgs '--add-opens', 'java.base/java.net=ALL-UNNAMED'
}
