aboutsummaryrefslogtreecommitdiff
path: root/build.gradle.kts
diff options
context:
space:
mode:
authortherealbush <therealbush@users.noreply.github.com>2022-04-23 16:18:23 -0700
committertherealbush <therealbush@users.noreply.github.com>2022-04-23 16:18:23 -0700
commita6b58667dd3fd180595b478fe9d85d06a7c96f3e (patch)
tree8a64422510d2f239e75c6bf3bf8c642e5ac2b785 /build.gradle.kts
parentadc29fb685307385cfa9ebb813ad2bfb18bb7776 (diff)
downloadeventbus-kotlin-a6b58667dd3fd180595b478fe9d85d06a7c96f3e.tar.gz
eventbus-kotlin-a6b58667dd3fd180595b478fe9d85d06a7c96f3e.tar.bz2
eventbus-kotlin-a6b58667dd3fd180595b478fe9d85d06a7c96f3e.zip
gradle changes
Diffstat (limited to 'build.gradle.kts')
-rw-r--r--build.gradle.kts37
1 files changed, 31 insertions, 6 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index f65f62d..18cb877 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,15 +1,16 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
+ id("java")
+ id("maven-publish")
kotlin("jvm") version "1.6.20"
+ id("org.jetbrains.dokka") version "1.6.20"
}
group = "me.bush"
version = "1.0.0"
-repositories {
- mavenCentral()
-}
+repositories.mavenCentral()
dependencies {
testImplementation(kotlin("test"))
@@ -24,12 +25,36 @@ dependencies {
}
tasks.test {
- testLogging {
- showStandardStreams = true
- }
+ testLogging.showStandardStreams = true
useJUnitPlatform()
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
+
+val dokkaJavadocJar by tasks.register<Jar>("dokkaJavadocJar") {
+ dependsOn(tasks.dokkaJavadoc)
+ from(tasks.dokkaJavadoc.flatMap { it.outputDirectory })
+ archiveClassifier.set("javadoc")
+}
+
+val dokkaHtmlJar by tasks.register<Jar>("dokkaHtmlJar") {
+ dependsOn(tasks.dokkaHtml)
+ from(tasks.dokkaHtml.flatMap { it.outputDirectory })
+ archiveClassifier.set("html-doc")
+}
+
+publishing.publications.register<MavenPublication>("library") {
+ from(components["java"])
+ version = project.version as String
+ groupId = project.group as String
+ artifactId = rootProject.name
+ artifact(dokkaJavadocJar)
+ artifact(dokkaHtmlJar)
+}
+
+java {
+ withSourcesJar()
+ withJavadocJar()
+}