diff options
author | Kamil Doległo <9080183+kamildoleglo@users.noreply.github.com> | 2021-06-23 12:33:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-23 12:33:19 +0200 |
commit | c2182b766a65619c859c0fc871a8a6334d66f199 (patch) | |
tree | 41624b51bcdb79f7f48fc436878b35120d77197d /runners/gradle-plugin | |
parent | 522775119b1f31d5f478662402eb29a5de9e0f12 (diff) | |
download | dokka-c2182b766a65619c859c0fc871a8a6334d66f199.tar.gz dokka-c2182b766a65619c859c0fc871a8a6334d66f199.tar.bz2 dokka-c2182b766a65619c859c0fc871a8a6334d66f199.zip |
Add maven central publication (#1688)
* Add OSSRH repositories
* Rewrite Gradle plugin publication
* Add publication version assertion
* Use Nexus publish plugin for publishing to Sonatype
* Remove explicit publishing from s3 tests
* Don't document Dokka for local publication
* Fix a bug with closing Sonatype repository
* Bump internal Dokka version
* Move publication version check to the validate task
* Fix Gradle plugin publication
* Bump Dokka and gradle plugin-publish versions
* Do not run Dokka for test tasks
* Do not fail all runs in a workflow
* Reduce JVM memory limit
Diffstat (limited to 'runners/gradle-plugin')
-rw-r--r-- | runners/gradle-plugin/build.gradle.kts | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts index 8d374a35..d44a2a4a 100644 --- a/runners/gradle-plugin/build.gradle.kts +++ b/runners/gradle-plugin/build.gradle.kts @@ -1,11 +1,8 @@ -import org.jetbrains.configureBintrayPublicationIfNecessary -import org.jetbrains.configureSpacePublicationIfNecessary -import org.jetbrains.createDokkaPublishTaskIfNecessary -import org.jetbrains.dokkaVersion +import org.jetbrains.* plugins { `java-gradle-plugin` - id("com.gradle.plugin-publish") version "0.10.1" + id("com.gradle.plugin-publish") version "0.15.0" } repositories { @@ -43,8 +40,11 @@ gradlePlugin { plugins { create("dokkaGradlePlugin") { id = "org.jetbrains.dokka" + displayName = "Dokka plugin" + description = "Dokka, the Kotlin documentation tool" implementationClass = "org.jetbrains.dokka.gradle.DokkaPlugin" version = dokkaVersion + isAutomatedPublishing = true } } } @@ -52,14 +52,7 @@ gradlePlugin { pluginBundle { website = "https://www.kotlinlang.org/" vcsUrl = "https://github.com/kotlin/dokka.git" - description = "Dokka, the Kotlin documentation tool" - tags = listOf("dokka", "kotlin", "kdoc", "android") - - plugins { - getByName("dokkaGradlePlugin") { - displayName = "Dokka plugin" - } - } + tags = listOf("dokka", "kotlin", "kdoc", "android", "documentation") mavenCoordinates { groupId = "org.jetbrains.dokka" @@ -69,20 +62,26 @@ pluginBundle { publishing { publications { - register<MavenPublication>("pluginMaven") { - artifactId = "dokka-gradle-plugin" - } - register<MavenPublication>("dokkaGradlePluginForIntegrationTests") { artifactId = "dokka-gradle-plugin" from(components["java"]) version = "for-integration-tests-SNAPSHOT" } + + register<MavenPublication>("pluginMaven") { + configurePom("Dokka ${project.name}") + artifactId = "dokka-gradle-plugin" + } } } +tasks.withType<PublishToMavenRepository>().configureEach { + onlyIf { publication != publishing.publications["dokkaGradlePluginForIntegrationTests"] } +} -configureSpacePublicationIfNecessary("dokkaGradlePluginPluginMarkerMaven", "pluginMaven") -configureBintrayPublicationIfNecessary("dokkaGradlePluginPluginMarkerMaven", "pluginMaven") -createDokkaPublishTaskIfNecessary() - +afterEvaluate { // Workaround for interesting design choice https://github.com/gradle/gradle/blob/c4f935f77377f1783f70ec05381c8182b3ade3ea/subprojects/plugin-development/src/main/java/org/gradle/plugin/devel/plugins/MavenPluginPublishPlugin.java#L49 + configureBintrayPublicationIfNecessary("pluginMaven", "dokkaGradlePluginPluginMarkerMaven") + configureSpacePublicationIfNecessary("pluginMaven", "dokkaGradlePluginPluginMarkerMaven") + configureSonatypePublicationIfNecessary("pluginMaven", "dokkaGradlePluginPluginMarkerMaven") + createDokkaPublishTaskIfNecessary() +} |