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,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,14 @@ internal fun Project.addBuildScanCustomValues() {
6767 }
6868}
6969
70+ internal fun Configuration.extendsFromCompat (vararg configurations : Provider <Configuration >) {
71+ if (GradleVersion .current() >= GradleVersion .version(" 9.4.0" )) {
72+ @Suppress(" UnstableApiUsage" ) extendsFrom(* configurations)
73+ } else {
74+ extendsFrom(* configurations.map { it.get() }.toTypedArray())
75+ }
76+ }
77+
7078/* * TODO: this could be removed after bumping the min Gradle requirement to 9.2 or above. */
7179@Suppress(" UnstableApiUsage" )
7280internal fun AdhocComponentWithVariants.addVariantsFromConfigurationCompat (
You can’t perform that action at this time.
0 commit comments