apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'idea'
apply plugin: 'net.corda.plugins.quasar-utils'
apply plugin: 'net.corda.plugins.cordapp'

configurations {
    demoArtifacts.extendsFrom testRuntimeOnlyClasspath
}

dependencies {
    // The irs demo CorDapp depends upon Cash CorDapp features
    cordapp project(':finance:contracts')
    cordapp project(':finance:workflows')

    // Corda integration dependencies
    cordaProvided project(':core')

    implementation "com.google.code.findbugs:jsr305:$jsr305_version"
    implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_kotlin_version")
    implementation "org.slf4j:slf4j-api:$slf4j_version"
    implementation "com.google.guava:guava-testlib:$guava_version"

    // only included to control the `DemoClock` as part of the demo application
    // normally `:node` should not be depended on in any CorDapps
    implementation project(':node')
    implementation project(':node-api')
    implementation project(':core-test-utils')
    implementation project(':test-utils')

    // Cordapp dependencies
    // Specify your cordapp's dependencies below, including dependent cordapps
    implementation "commons-io:commons-io:$commons_io_version"

    testImplementation project(':node-driver')
    
    testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}"
    testImplementation "junit:junit:$junit_version"

    testRuntimeOnly "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}"
    testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}"
    testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}"

    testImplementation "org.assertj:assertj-core:${assertj_version}"

    cordapp project(':samples:irs-demo:cordapp:contracts-irs')
}

cordapp {
    targetPlatformVersion corda_platform_version.toInteger()
    minimumPlatformVersion 1
    workflow {
        name "Corda IRS Demo"
        versionId 1
        vendor "R3"
        licence "Open Source (Apache 2)"
    }
}

jar {
    baseName 'corda-irs-demo-workflows'
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

task testJar(type: Jar) {
    classifier "tests"
    from sourceSets.main.output
    from sourceSets.test.output
}

artifacts {
    demoArtifacts testJar
}
