Merge branch 'javadocAndSourcesJar' into 'master'

Javadoc and sources jar

See merge request pheerai/rcdbquery!2
This commit is contained in:
Oliver Rümpelein 2021-03-06 21:26:38 +01:00
commit e7ba06b66e
2 changed files with 15 additions and 1 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 {
@ -33,12 +34,13 @@ repositories {
} }
} }
project.version = "0.0.2" project.version = "0.0.3-SNAPSHOT"
project.group = "de.pheerai.rcdb" 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"
} }
} }