import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar

plugins {
    id 'java-library'
    id 'kotlin'
    id 'com.vanniktech.maven.publish'
}

kotlin {
    jvmToolchain(17)
}

// Need to apply to all tasks like this so test tasks also get these compiler args
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
    kotlinOptions {
        freeCompilerArgs += [
                '-Xopt-in=kotlin.RequiresOptIn',
                "-Xopt-in=kotlin.contracts.ExperimentalContracts",
                "-Xopt-in=androidx.room.compiler.processing.ExperimentalProcessingApi",
                "-Xopt-in=com.squareup.kotlinpoet.javapoet.KotlinPoetJavaPoetPreview",
        ]
    }
}

kotlin {
    jvmToolchain(17)
}

dependencies {
    implementation project(':showkase-annotation')

    implementation deps.kotlinPoet
    implementation deps.kotlinJavaPoetInterop
    implementation deps.kotlinXMetadata
    implementation deps.ksp
    implementation deps.xprocessing

    testImplementation deps.test.strikt
    testImplementation deps.test.junit
    testImplementation deps.xprocessingTesting
}

mavenPublishing {
    configure(new JavaLibrary(new JavadocJar.Javadoc(), true))
}
