plugins {
    id 'corda.common-publishing'
    id 'corda.common-library'
}

description 'Common crypto implementation'

dependencies {
    api project(":libs:crypto:crypto-core")

    compileOnly "org.osgi:org.osgi.service.component.annotations"
    compileOnly "org.osgi:osgi.annotation"

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

    implementation project(":libs:configuration:configuration-core")
    implementation project(':libs:layered-property-map')
    implementation project(":libs:metrics")
    implementation project(":libs:utilities")

    implementation 'net.corda:corda-application'
    implementation "net.corda:corda-avro-schema"
    implementation "net.corda:corda-config-schema"
    implementation "net.corda:corda-serialization"
    implementation 'org.jetbrains.kotlin:kotlin-osgi-bundle'
    implementation "org.apache.commons:commons-lang3:$commonsLangVersion"

    testRuntimeOnly libs.slf4j.simple

    testImplementation project(":testing:layered-property-map-testkit")
    testImplementation "javax.persistence:javax.persistence-api"
    testImplementation "org.hibernate:hibernate-core:$hibernateVersion"
}

tasks.named('jar', Jar) {
    bundle {
        bnd """\
Import-Package:\
    org.bouncycastle.jcajce.provider.config,\
    org.bouncycastle.jcajce.provider.digest,\
    org.bouncycastle.jcajce.provider.drbg,\
    org.bouncycastle.jcajce.provider.keystore,\
    org.bouncycastle.jcajce.provider.keystore.bc,\
    org.bouncycastle.jcajce.provider.keystore.bcfks,\
    org.bouncycastle.jcajce.provider.keystore.pkcs12,\
    org.bouncycastle.jcajce.provider.keystore.util,\
    org.bouncycastle.jcajce.provider.symmetric,\
    org.bouncycastle.jcajce.provider.symmetric.util,\
    org.bouncycastle.jcajce.provider.util,\
    *
"""
    }
}
