apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'java-gradle-plugin'
apply plugin: 'net.corda.plugins.publish-utils'
apply plugin: 'com.jfrog.artifactory'

description "Generates a summary of the artifact's public API"

repositories {
    mavenLocal()
    mavenCentral()
    jcenter()
}

gradlePlugin {
    plugins {
        apiScannerPlugin {
            id = 'net.corda.plugins.api-scanner'
            implementationClass = 'net.corda.plugins.ApiScanner'
        }
    }
}

configurations {
    jacocoRuntime
}

dependencies {
    compile "io.github.lukehutch:fast-classpath-scanner:2.18.2"
    testCompile project(':api-scanner:annotations')
    testCompile "org.assertj:assertj-core:$assertj_version"
    testCompile "junit:junit:$junit_version"

    // This dependency is only to prevent IntelliJ from choking
    // on the Kotlin classes in the test/resources directory.
    testCompile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
    testCompile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
    jacocoRuntime "org.jacoco:org.jacoco.agent:${jacoco.toolVersion}:runtime"
}

processTestResources {
    filesMatching('**/kotlin-*/build.gradle') {
        expand(['kotlin_version': kotlin_version])
    }
    filesMatching('gradle.properties') {
        expand(['jacocoAgent': configurations.jacocoRuntime.asPath.replace('\\', '/'),
                'buildDir': buildDir])
    }
}

publish {
    name project.name
}
