File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package com.github.jengelman.gradle.plugins.shadow
33import com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin.Companion.SHADOW
44import com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin.Companion.shadow
55import com.github.jengelman.gradle.plugins.shadow.internal.addVariantsFromConfigurationCompat
6+ import com.github.jengelman.gradle.plugins.shadow.internal.extendsFromCompat
67import com.github.jengelman.gradle.plugins.shadow.internal.javaPluginExtension
78import com.github.jengelman.gradle.plugins.shadow.internal.moveGradleApiIntoCompileOnly
89import com.github.jengelman.gradle.plugins.shadow.internal.runtimeConfiguration
@@ -47,13 +48,12 @@ constructor(private val softwareComponentFactory: SoftwareComponentFactory) : Pl
4748 }
4849
4950 protected open fun Project.configureConfigurations () {
50- val shadowConfiguration = configurations.shadow.get()
5151 configurations.named(COMPILE_CLASSPATH_CONFIGURATION_NAME ) { compileClasspath ->
52- compileClasspath.extendsFrom(shadowConfiguration )
52+ compileClasspath.extendsFromCompat(configurations.shadow )
5353 }
5454 val shadowRuntimeElements =
5555 configurations.register(SHADOW_RUNTIME_ELEMENTS_CONFIGURATION_NAME ) {
56- it.extendsFrom(shadowConfiguration )
56+ it.extendsFromCompat(configurations.shadow )
5757 it.isCanBeConsumed = true
5858 it.isCanBeResolved = false
5959 it.attributes { attrs ->
Original file line number Diff line number Diff line change @@ -67,6 +67,15 @@ internal fun Project.addBuildScanCustomValues() {
6767 }
6868}
6969
70+ internal fun Configuration.extendsFromCompat (configuration : Any ) {
71+ if (GradleVersion .current() >= GradleVersion .version(" 9.4.0" )) {
72+ @Suppress(" UNCHECKED_CAST" , " UnstableApiUsage" )
73+ extendsFrom(configuration as Provider <Configuration >)
74+ } else {
75+ extendsFrom(configuration as Configuration )
76+ }
77+ }
78+
7079/* * TODO: this could be removed after bumping the min Gradle requirement to 9.2 or above. */
7180@Suppress(" UnstableApiUsage" )
7281internal fun AdhocComponentWithVariants.addVariantsFromConfigurationCompat (
You can’t perform that action at this time.
0 commit comments