Skip to content

Commit

Permalink
Fix Gradle plugin publication
Browse files Browse the repository at this point in the history
  • Loading branch information
kamildoleglo committed Apr 22, 2021
1 parent 671c914 commit 57adf51
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
@@ -1,6 +1,6 @@
# Project Settings
dokka_version_base=1.4.32
dokka_publication_channels=bintray-kotlin-dev&space-dokka-dev
dokka_publication_channels=maven-central-snapshot&space-dokka-dev
dokka_integration_test_parallelism=2
# Versions
kotlin_version=1.4.32
Expand All @@ -13,4 +13,4 @@ language_version=1.4
kotlin.code.style=official
# Gradle settings
org.gradle.jvmargs=-Xmx10g -XX:MaxMetaspaceSize=2g
org.gradle.parallel=true
org.gradle.parallel=true
14 changes: 11 additions & 3 deletions runners/gradle-plugin/build.gradle.kts
Expand Up @@ -44,7 +44,7 @@ gradlePlugin {
description = "Dokka, the Kotlin documentation tool"
implementationClass = "org.jetbrains.dokka.gradle.DokkaPlugin"
version = dokkaVersion
isAutomatedPublishing = false // This will probably have to be fixed for Gradle Plugin Portal release
isAutomatedPublishing = true
}
}
}
Expand All @@ -67,13 +67,21 @@ publishing {
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"] }
}

registerDokkaArtifactPublication("dokkaGradleMavenPlugin") {
artifactId = "dokka-gradle-plugin"
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()
}

0 comments on commit 57adf51

Please sign in to comment.