Skip to content

Commit

Permalink
Fix publications for new locations
Browse files Browse the repository at this point in the history
  • Loading branch information
romtsn committed Feb 4, 2025
1 parent d6a1e99 commit 8ae3c3f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ object Config {
val gretty = "org.gretty"
val grettyVersion = "4.0.0"
val gradleMavenPublishPlugin = "com.vanniktech.maven.publish"
val gradleMavenPublishPluginVersion = "0.28.0"
val gradleMavenPublishPluginVersion = "0.30.0"
val dokkaPlugin = "org.jetbrains.dokka:dokka-gradle-plugin:1.9.20"
val dokkaPluginAlias = "org.jetbrains.dokka"
val composeGradlePlugin = "org.jetbrains.compose:compose-gradle-plugin:$composeVersion"
Expand Down
29 changes: 16 additions & 13 deletions buildSrc/src/main/java/Publication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ fun DistributionContainer.configureForMultiplatform(project: Project) {
}
from("build${sep}libs") {
include("*android*")
withJavadoc(renameTo = "compose-android")
include("*androidRelease-javadoc*")
rename {
it.replace("androidRelease-javadoc", "android")
}
}
}
this.getByName("main").contents {
Expand All @@ -38,8 +41,8 @@ fun DistributionContainer.configureForMultiplatform(project: Project) {
rename {
it.replace("-kotlin", "")
.replace("-metadata", "")
.replace("Multiplatform-javadoc", "")
}
withJavadoc()
}
}
this.maybeCreate("desktop").contents {
Expand All @@ -49,7 +52,10 @@ fun DistributionContainer.configureForMultiplatform(project: Project) {
}
from("build${sep}libs") {
include("*desktop*")
withJavadoc(renameTo = "compose-desktop")
include("*desktop-javadoc*")
rename {
it.replace("desktop-javadoc", "desktop")
}
}
}

Expand Down Expand Up @@ -77,16 +83,13 @@ fun DistributionContainer.configureForJvm(project: Project) {
from("build${sep}publications${sep}release") {
renameModule(project.name, version = version)
}
}
}

private fun CopySpec.withJavadoc(renameTo: String = "compose") {
include("*javadoc*")
rename {
if (it.contains("javadoc")) {
it.replace("compose", renameTo)
} else {
it
from("build${sep}intermediates${sep}java_doc_jar${sep}release") {
include("*javadoc*")
rename { it.replace("release", "${project.name}-$version") }
}
from("build${sep}intermediates${sep}source_jar${sep}release") {
include("*sources*")
rename { it.replace("release", "${project.name}-$version") }
}
}
}
Expand Down

0 comments on commit 8ae3c3f

Please sign in to comment.