From 5e695d42bd062559214a458263f3269f2d31042f Mon Sep 17 00:00:00 2001 From: Robert Stupp Date: Fri, 10 Jan 2025 15:13:59 +0100 Subject: [PATCH] Fix deprecation warning for `ShadowExtension` (#651) The build-logic code checked for the _existence_ of the `ShadowExtension`, replacing with a check against the `ShadowPlugin`, yielding the same results. --- .../src/main/kotlin/publishing/PublishingHelperPlugin.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-logic/src/main/kotlin/publishing/PublishingHelperPlugin.kt b/build-logic/src/main/kotlin/publishing/PublishingHelperPlugin.kt index 7bb9960ee..aef2f4735 100644 --- a/build-logic/src/main/kotlin/publishing/PublishingHelperPlugin.kt +++ b/build-logic/src/main/kotlin/publishing/PublishingHelperPlugin.kt @@ -19,7 +19,7 @@ package publishing -import com.github.jengelman.gradle.plugins.shadow.ShadowExtension +import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin import javax.inject.Inject import org.gradle.api.* import org.gradle.api.component.SoftwareComponentFactory @@ -124,7 +124,7 @@ constructor(private val softwareComponentFactory: SoftwareComponentFactory) : Pl afterEvaluate { // This MUST happen in an 'afterEvaluate' to ensure that the Shadow*Plugin has // been applied. - if (project.extensions.findByType(ShadowExtension::class.java) != null) { + if (project.plugins.hasPlugin(ShadowPlugin::class.java)) { configureShadowPublishing(project, mavenPublication, softwareComponentFactory) } else { from(components.firstOrNull { c -> c.name == "javaPlatform" || c.name == "java" })