Skip to content

Commit

Permalink
Merge pull request #96 from jpenilla/fix/configuration-cache
Browse files Browse the repository at this point in the history
Fix SpongeGradleConfigurationSource configuration cache compatibility
  • Loading branch information
zml2008 authored Dec 23, 2024
2 parents 2e75a71 + d6278ae commit 84b44c2
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
}
}
}
Expand Down

0 comments on commit 84b44c2

Please sign in to comment.