import org.jetbrains.dokka.gradle.DokkaTask

plugins {
    id 'org.jetbrains.kotlin.jvm' version '1.4.21'
    id 'org.jetbrains.dokka' version '1.4.20'
}

kotlin {
    explicitApi()
}

compileKotlin {
    kotlinOptions {
        jvmTarget = "1.8"
    }
}

compileTestKotlin {
    kotlinOptions {
        jvmTarget = "1.8"
    }
}

dependencies {
    api project(':cloud-core')
    testImplementation "org.jetbrains.kotlin:kotlin-test-junit5"
}

javadocJar {
    from dokkaHtml
}

tasks.withType(DokkaTask).configureEach {
    dokkaSourceSets {
        main {
            includes.from(layout.projectDirectory.file("src/main/descriptions.md").toString())
            externalDocumentationLink {
                url.set(new URL("https://javadoc.commandframework.cloud/")) //todo fix KDoc linking to JavaDoc
                packageListUrl.set(new URL("https://javadoc.commandframework.cloud/allpackages-index.html"))
            }
        }
    }
}
