plugins {
    id 'distribution'
    id 'org.jetbrains.kotlin.jvm'
    id 'org.jetbrains.kotlin.kapt'
    id 'corda.cli-plugin-packager'
}

ext {
    releasable = false
}

group 'net.corda.cli.deployment'

dependencies {
    implementation platform("net.corda:corda-api:$cordaApiVersion")
    compileOnly 'org.jetbrains.kotlin:kotlin-stdlib'

    compileOnly libs.pf4j
    compileOnly "net.corda.cli.host:api:$pluginHostVersion"

    kapt libs.pf4j
    kapt "info.picocli:picocli:$picocliVersion"

    implementation project(":libs:configuration:configuration-core")

    testImplementation libs.bundles.test
    testImplementation libs.pf4j
    testImplementation "com.github.stefanbirkner:system-lambda:$systemLambdaVersion"
    testImplementation "net.corda.cli.host:api:$pluginHostVersion"
}

cliPlugin {
    cliPluginClass = 'net.corda.cli.plugin.secretconfig.SecretConfigPlugin'
    cliPluginDescription = 'A CLI plug-in to create a configuration secret given a salt and passphrase'
}

tasks.named("installDist") {
    dependsOn cliPlugin
    def homePath = System.properties['user.home']
    from cliPlugin
    into "$homePath/.corda/cli/plugins"
}
