diff options
author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2023-11-10 11:46:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-10 11:46:54 +0100 |
commit | 8e5c63d035ef44a269b8c43430f43f5c8eebfb63 (patch) | |
tree | 1b915207b2b9f61951ddbf0ff2e687efd053d555 /build-logic/src/main/kotlin/dokkabuild.publish-gradle-plugin.gradle.kts | |
parent | a44efd4ba0c2e4ab921ff75e0f53fc9335aa79db (diff) | |
download | dokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.tar.gz dokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.tar.bz2 dokka-8e5c63d035ef44a269b8c43430f43f5c8eebfb63.zip |
Restructure the project to utilize included builds (#3174)
* Refactor and simplify artifact publishing
* Update Gradle to 8.4
* Refactor and simplify convention plugins and build scripts
Fixes #3132
---------
Co-authored-by: Adam <897017+aSemy@users.noreply.github.com>
Co-authored-by: Oleg Yukhnevich <whyoleg@gmail.com>
Diffstat (limited to 'build-logic/src/main/kotlin/dokkabuild.publish-gradle-plugin.gradle.kts')
-rw-r--r-- | build-logic/src/main/kotlin/dokkabuild.publish-gradle-plugin.gradle.kts | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/build-logic/src/main/kotlin/dokkabuild.publish-gradle-plugin.gradle.kts b/build-logic/src/main/kotlin/dokkabuild.publish-gradle-plugin.gradle.kts new file mode 100644 index 00000000..93718909 --- /dev/null +++ b/build-logic/src/main/kotlin/dokkabuild.publish-gradle-plugin.gradle.kts @@ -0,0 +1,36 @@ +/* + * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + */ + +import dokkabuild.PublicationName + +plugins { + id("dokkabuild.publish-base") + id("com.gradle.plugin-publish") +} + +@Suppress("UnstableApiUsage") +gradlePlugin { + website.set("https://kotl.in/dokka") + vcsUrl.set("https://github.com/kotlin/dokka.git") +} + +// com.gradle.plugin-publish configures publication in afterEvaluate block +// so to be able to configure it directly in build scripts (f.e. to change artifactId) we need to register it earlier +// more info: https://docs.gradle.org/current/userguide/java_gradle_plugin.html#maven_publish_plugin +publishing.publications.register<MavenPublication>(PublicationName.GRADLE_PLUGIN) + +// com.gradle.plugin-publish configures javadoc only for the main plugin artifact, +// so we need to link it manually to other publications +// specifically with artifact `org.jetbrains.dokka.gradle.plugin` +// which is used to resolve plugins via `plugins { id("org.jetbrains.dokka") }` +// it's not needed for gradle plugin portal, but needed for Maven Central +// NOTE: it should be configured in `afterEvaluate` +// because `javadocJar` task is created in `afterEvaluate` block in `com.gradle.plugin-publish` plugin +afterEvaluate { + publishing.publications.withType<MavenPublication>() + .matching { it.name != PublicationName.GRADLE_PLUGIN } + .configureEach { + artifact(tasks.named("javadocJar")) + } +} |