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

View file

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