File tree Expand file tree Collapse file tree
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow Expand file tree Collapse file tree 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,13 @@ constructor(private val softwareComponentFactory: SoftwareComponentFactory) : Pl
4748 }
4849
4950 protected open fun Project.configureConfigurations () {
50- val shadowConfiguration = configurations.shadow.get()
51+ val shadowConfiguration = configurations.shadow
5152 configurations.named(COMPILE_CLASSPATH_CONFIGURATION_NAME ) { compileClasspath ->
52- compileClasspath.extendsFrom (shadowConfiguration)
53+ compileClasspath.extendsFromCompat (shadowConfiguration)
5354 }
5455 val shadowRuntimeElements =
5556 configurations.register(SHADOW_RUNTIME_ELEMENTS_CONFIGURATION_NAME ) {
56- it.extendsFrom (shadowConfiguration)
57+ it.extendsFromCompat (shadowConfiguration)
5758 it.isCanBeConsumed = true
5859 it.isCanBeResolved = false
5960 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+ /* * TODO: this could be removed after bumping the min Gradle requirement to 9.4 or above. */
71+ internal fun Configuration.extendsFromCompat (vararg superConfigs : Provider <out Configuration >) {
72+ if (GradleVersion .current() >= GradleVersion .version(" 9.4.0" )) {
73+ @Suppress(" UnstableApiUsage" ) extendsFrom(* superConfigs)
74+ } else {
75+ extendsFrom(* superConfigs.map { it.get() }.toTypedArray())
76+ }
77+ }
78+
7079/* * TODO: this could be removed after bumping the min Gradle requirement to 9.2 or above. */
7180internal fun AdhocComponentWithVariants.addVariantsFromConfigurationCompat (
7281 outgoingConfiguration : NamedDomainObjectProvider <Configuration >,
You can’t perform that action at this time.
0 commit comments