Configurable updater fix
This commit is contained in:
parent
1344471f40
commit
fdd5b11370
@ -1,15 +1,15 @@
|
|||||||
import org.jetbrains.dokka.gradle.DokkaTask
|
import org.jetbrains.dokka.gradle.DokkaTask
|
||||||
|
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
|
||||||
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
|
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
|
||||||
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformJvmPlugin
|
|
||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMultiplatformPlugin
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("org.jetbrains.dokka")
|
id("org.jetbrains.dokka")
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins.withType(KotlinMultiplatformPlugin::class){
|
afterEvaluate {
|
||||||
configure<KotlinMultiplatformExtension>{
|
|
||||||
|
extensions.findByType<KotlinMultiplatformExtension>()?.apply{
|
||||||
val dokka by tasks.getting(DokkaTask::class) {
|
val dokka by tasks.getting(DokkaTask::class) {
|
||||||
outputFormat = "html"
|
outputFormat = "html"
|
||||||
outputDirectory = "$buildDir/javadoc"
|
outputDirectory = "$buildDir/javadoc"
|
||||||
@ -33,42 +33,43 @@ plugins.withType(KotlinMultiplatformPlugin::class){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val javadocJar by tasks.registering(Jar::class) {
|
val kdocJar by tasks.registering(Jar::class) {
|
||||||
group = JavaBasePlugin.DOCUMENTATION_GROUP
|
group = JavaBasePlugin.DOCUMENTATION_GROUP
|
||||||
dependsOn(dokka)
|
dependsOn(dokka)
|
||||||
archiveClassifier.set("javadoc")
|
archiveClassifier.set("javadoc")
|
||||||
from("$buildDir/javadoc")
|
from("$buildDir/javadoc")
|
||||||
}
|
}
|
||||||
|
|
||||||
configure<PublishingExtension>{
|
configure<PublishingExtension> {
|
||||||
|
|
||||||
targets.all {
|
targets.all {
|
||||||
val publication = publications.findByName(name) as MavenPublication
|
val publication = publications.findByName(name) as MavenPublication
|
||||||
|
|
||||||
// Patch publications with fake javadoc
|
// Patch publications with fake javadoc
|
||||||
publication.artifact(javadocJar.get())
|
publication.artifact(kdocJar.get())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extensions.findByType<KotlinJvmProjectExtension>()?.apply{
|
||||||
|
val dokka by tasks.getting(DokkaTask::class) {
|
||||||
|
outputFormat = "html"
|
||||||
|
outputDirectory = "$buildDir/javadoc"
|
||||||
|
jdkVersion = 8
|
||||||
|
}
|
||||||
|
|
||||||
|
val kdocJar by tasks.registering(Jar::class) {
|
||||||
|
group = JavaBasePlugin.DOCUMENTATION_GROUP
|
||||||
|
dependsOn(dokka)
|
||||||
|
archiveClassifier.set("javadoc")
|
||||||
|
from("$buildDir/javadoc")
|
||||||
|
}
|
||||||
|
|
||||||
|
configure<PublishingExtension> {
|
||||||
|
publications.filterIsInstance<MavenPublication>().forEach { publication ->
|
||||||
|
publication.artifact(kdocJar.get())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins.withType(KotlinPlatformJvmPlugin::class){
|
|
||||||
val dokka by tasks.getting(DokkaTask::class) {
|
|
||||||
outputFormat = "html"
|
|
||||||
outputDirectory = "$buildDir/javadoc"
|
|
||||||
jdkVersion = 8
|
|
||||||
}
|
|
||||||
|
|
||||||
val javadocJar by tasks.registering(Jar::class) {
|
|
||||||
group = JavaBasePlugin.DOCUMENTATION_GROUP
|
|
||||||
dependsOn(dokka)
|
|
||||||
archiveClassifier.set("javadoc")
|
|
||||||
from("$buildDir/javadoc")
|
|
||||||
}
|
|
||||||
|
|
||||||
configure<PublishingExtension>{
|
|
||||||
publications.filterIsInstance<MavenPublication>().forEach {publication ->
|
|
||||||
publication.artifact(javadocJar.get())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -41,6 +41,6 @@ interface Configurable {
|
|||||||
|
|
||||||
fun <T : Configurable> T.configure(meta: Meta): T = this.apply { config.update(meta) }
|
fun <T : Configurable> T.configure(meta: Meta): T = this.apply { config.update(meta) }
|
||||||
|
|
||||||
fun <T : Configurable> T.configure(action: Config.() -> Unit): T = this.apply { config.apply(action) }
|
fun <T : Configurable> T.configure(action: MetaBuilder.() -> Unit): T = configure(buildMeta(action))
|
||||||
|
|
||||||
open class SimpleConfigurable(override val config: Config) : Configurable
|
open class SimpleConfigurable(override val config: Config) : Configurable
|
Loading…
Reference in New Issue
Block a user