From d6278aee3940f6e4d86c551b428b9c20ff37bb68 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sun, 22 Dec 2024 20:11:53 -0800 Subject: [PATCH] Fix SpongeGradleConfigurationSource configuration cache compatibility --- .../gradle/ore/SpongeGradleConfigurationSource.groovy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ore/src/main/groovy/org/spongepowered/gradle/ore/SpongeGradleConfigurationSource.groovy b/ore/src/main/groovy/org/spongepowered/gradle/ore/SpongeGradleConfigurationSource.groovy index acb7592..d335e5c 100644 --- a/ore/src/main/groovy/org/spongepowered/gradle/ore/SpongeGradleConfigurationSource.groovy +++ b/ore/src/main/groovy/org/spongepowered/gradle/ore/SpongeGradleConfigurationSource.groovy @@ -26,6 +26,7 @@ package org.spongepowered.gradle.ore import groovy.transform.PackageScope import org.gradle.api.Project +import org.spongepowered.gradle.ore.internal.OrePublicationImpl @PackageScope class SpongeGradleConfigurationSource { @@ -36,12 +37,15 @@ class SpongeGradleConfigurationSource { static def configureSpongeGradle(Project project, OreDeploymentExtension extension) { project.plugins.withId('org.spongepowered.gradle.plugin') { def first = true + def jar = project.tasks.named('jar').flatMap { it.archiveFile } + extension.defaultPublication {} + def defPub = extension.publications().named(OrePublicationImpl.DEFAULT_NAME) project.sponge.plugins.whenObjectAdded { plugin -> if (first) { first = false - extension.defaultPublication { + defPub.configure { projectId.set(plugin.name) - publishArtifacts.from(project.tasks.named('jar').map { it.outputs }) + publishArtifacts.from(jar) } } }