Skip to content

Commit

Permalink
fix: dynamically create a maven publish config on subproject
Browse files Browse the repository at this point in the history
  • Loading branch information
DuoDuoJuZi committed Dec 25, 2024
1 parent f574eba commit 33d2108
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,14 @@ publishing {
if (isGitHubActions) {
publications {
modules.forEach { module ->
create<MavenPublication>("maven-${module.capitalize()}") {
from(components["shadow"])
groupId = group.toString()
artifactId = "$module"
version = "${properties("version")}-${LocalDateTime.now().format(DateTimeFormatter.ofPattern("dd-MM-yy-hhmmss"))}"
val subproject = rootProject.subprojects.find { it.name == module }
subproject?.let {
create<MavenPublication>("maven-${module.capitalize()}") {
from(components["shadow"])
groupId = group.toString()
artifactId = "$module"
version = "${properties("version")}-${LocalDateTime.now().format(DateTimeFormatter.ofPattern("dd-MM-yy-hhmmss"))}"
}
}
}
}
Expand Down

0 comments on commit 33d2108

Please sign in to comment.