From a6b58667dd3fd180595b478fe9d85d06a7c96f3e Mon Sep 17 00:00:00 2001 From: therealbush Date: Sat, 23 Apr 2022 16:18:23 -0700 Subject: gradle changes --- build.gradle.kts | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) (limited to 'build.gradle.kts') 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 { kotlinOptions.jvmTarget = "1.8" } + +val dokkaJavadocJar by tasks.register("dokkaJavadocJar") { + dependsOn(tasks.dokkaJavadoc) + from(tasks.dokkaJavadoc.flatMap { it.outputDirectory }) + archiveClassifier.set("javadoc") +} + +val dokkaHtmlJar by tasks.register("dokkaHtmlJar") { + dependsOn(tasks.dokkaHtml) + from(tasks.dokkaHtml.flatMap { it.outputDirectory }) + archiveClassifier.set("html-doc") +} + +publishing.publications.register("library") { + from(components["java"]) + version = project.version as String + groupId = project.group as String + artifactId = rootProject.name + artifact(dokkaJavadocJar) + artifact(dokkaHtmlJar) +} + +java { + withSourcesJar() + withJavadocJar() +} -- cgit