Add javadoc & sources generation and publishing (locally)

This commit is contained in:
Oliver Rümpelein 2021-03-06 21:24:50 +01:00
parent dd5147353f
commit 1a947a430f
2 changed files with 14 additions and 0 deletions

View file

@ -18,6 +18,7 @@ inline fun <reified T> getFromExtra(prop: String) = project.extra[prop] as T
plugins {
kotlin("jvm")
`maven-publish`
id("org.jetbrains.dokka")
}
repositories {
@ -39,6 +40,7 @@ project.group = "de.pheerai.rcdb"
java {
targetCompatibility = getFromExtra("javaVersion")
sourceCompatibility = getFromExtra("javaVersion")
withSourcesJar()
}
kotlin {
@ -64,12 +66,23 @@ tasks {
test {
useJUnitPlatform()
}
val javadocJar by registering(Jar::class) {
from("dokkaJavadoc")
archiveClassifier.set("javadoc")
}
artifacts {
archives(javadocJar)
archives(jar)
}
}
publishing {
publications {
create<MavenPublication>("QueryBuilder") {
from(components["java"])
artifact(tasks["javadocJar"])
}
repositories {
maven {

View file

@ -1,6 +1,7 @@
pluginManagement {
plugins {
kotlin("jvm") version "1.4.30"
id("org.jetbrains.dokka") version "1.4.20"
}
}