diff options
Diffstat (limited to 'build.gradle.kts')
-rw-r--r-- | build.gradle.kts | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index e0db575..86f617a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,4 @@ +import org.jetbrains.dokka.gradle.DokkaTask import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { @@ -24,6 +25,11 @@ dependencies { implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1") } +java { + withSourcesJar() + withJavadocJar() +} + tasks.test { testLogging.showStandardStreams = true useJUnitPlatform() @@ -33,28 +39,8 @@ 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") +val javadocJar = tasks.named<Jar>("javadocJar") { + from(tasks.named("dokkaJavadoc")) } -publishing.publications.create<MavenPublication>("maven") { - from(components["java"]) - version = project.version as String - groupId = project.group as String - artifactId = rootProject.name - artifact(dokkaJavadocJar) - artifact(dokkaHtmlJar) -} - -java { - withSourcesJar() - withJavadocJar() -} +publishing.publications.create<MavenPublication>("maven").from(components["java"]) |