Skip to content

Commit

Permalink
Fix deprecation warning for ShadowExtension (#651)
Browse files Browse the repository at this point in the history
The build-logic code checked for the _existence_ of the `ShadowExtension`, replacing with a check against the `ShadowPlugin`, yielding the same results.
  • Loading branch information
snazy authored Jan 10, 2025
1 parent afff059 commit 5e695d4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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" })
Expand Down

0 comments on commit 5e695d4

Please sign in to comment.