Skip to content

Commit

Permalink
feat: add task to save the generated bundle deployment id
Browse files Browse the repository at this point in the history
  • Loading branch information
DanySK committed Dec 7, 2024
1 parent 6d75df2 commit 1b87836
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,17 @@ internal object ProjectExtensions {
},
zipTask = zipMavenCentralPortal,
)
tasks.register("saveMavenCentralPortalDeploymentId") { save ->
val fileName = "maven-central-portal-bundle-id"
val file = rootProject.layout.buildDirectory.map { it.asFile.resolve(fileName) }
save.group = PublishingPlugin.PUBLISH_TASK_GROUP
save.description = "Saves the Maven Central Portal deployment ID locally in ${file.get().absolutePath}"
save.dependsOn(zipMavenCentralPortal)
save.outputs.file(file)
save.doLast {
file.get().writeText("${portalDeployment.fileToUpload}=${portalDeployment.deploymentId}\n")
}
}
val validate =
tasks.register(PublishPortalDeployment.VALIDATE_TASK_NAME) { validate ->
validate.group = PublishingPlugin.PUBLISH_TASK_GROUP
Expand Down

0 comments on commit 1b87836

Please sign in to comment.