apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'corda.common-publishing'

description 'Corda serialization'

configurations {
    resolvableImplementation.extendsFrom implementation

    testArtifacts.extendsFrom testRuntimeClasspath
}

dependencies {
    implementation project(":core")
    implementation "io.reactivex:rxjava:$rxjava_version"
    implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
    implementation "org.apache.activemq:artemis-commons:${artemis_version}"
    implementation "org.ow2.asm:asm:$asm_version"
    implementation "com.google.guava:guava:$guava_version"
    // For AMQP serialisation.
    implementation "org.apache.qpid:proton-j:$protonj_version"
    // ClassGraph: classpath scanning
    implementation "io.github.classgraph:classgraph:$class_graph_version"
    // Pure-Java Snappy compression
    implementation "org.iq80.snappy:snappy:$snappy_version"
    // For caches rather than guava
    implementation "com.github.ben-manes.caffeine:caffeine:$caffeine_version"

    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}"
    testRuntimeOnly "org.slf4j:slf4j-simple:$slf4j_version"

    testImplementation "org.assertj:assertj-core:$assertj_version"
    testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
    testImplementation "org.mockito:mockito-core:$mockito_version"
    testImplementation 'org.hamcrest:hamcrest-library:2.1'
    testImplementation "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
}

tasks.withType(Javadoc).configureEach {
    // We have no public or protected Java classes to document.
    enabled = false
}

tasks.register('testJar', Jar) {
    archiveClassifier = 'tests'
    from sourceSets.test.output
}

artifacts {
    testArtifacts testJar
}

jar {
    archiveBaseName = 'corda-serialization'
    archiveClassifier = ''
}

publishing {
    publications {
        maven(MavenPublication) {
            artifactId 'corda-serialization'
            artifact(testJar)
            from components.java
        }
    }
}
