forked from kotest/kotest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish-mpp.gradle.kts
38 lines (30 loc) · 1.01 KB
/
publish-mpp.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
apply(plugin = "java")
apply(plugin = "java-library")
apply(plugin = "org.jetbrains.dokka")
apply(from = "$rootDir/signing-pom-details.gradle.kts")
//val dokka = tasks.named("dokka")
val javadoc = tasks.named("javadoc")
// Create dokka Jar task from dokka task output
//val dokkaJar by tasks.creating(Jar::class) {
// group = JavaBasePlugin.DOCUMENTATION_GROUP
// description = "Assembles Kotlin docs with Dokka"
// archiveClassifier.set("javadoc")
// from(dokka)
//}
val javadocJar by tasks.creating(Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Assembles java doc to jar"
archiveClassifier.set("javadoc")
from(javadoc)
}
fun Project.publishing(action: PublishingExtension.() -> Unit) =
configure(action)
val publications: PublicationContainer = (extensions.getByName("publishing") as PublishingExtension).publications
publishing {
publications.withType<MavenPublication>().forEach {
it.apply {
//if (Ci.isRelease)
artifact(javadocJar)
}
}
}