diff --git a/api/shadow.api b/api/shadow.api index 5ce64b4d7..02e5170e7 100644 --- a/api/shadow.api +++ b/api/shadow.api @@ -167,6 +167,7 @@ public abstract interface class com/github/jengelman/gradle/plugins/shadow/tasks public abstract fun project (Ljava/lang/Object;)Lorg/gradle/api/specs/Spec; public abstract fun resolve (Ljava/util/Collection;)Lorg/gradle/api/file/FileCollection; public abstract fun resolve (Lorg/gradle/api/artifacts/Configuration;)Lorg/gradle/api/file/FileCollection; + public abstract fun resolve (Lorg/gradle/api/file/ConfigurableFileCollection;)Lorg/gradle/api/file/FileCollection; } public abstract class com/github/jengelman/gradle/plugins/shadow/tasks/DependencyFilter$AbstractDependencyFilter : com/github/jengelman/gradle/plugins/shadow/tasks/DependencyFilter { @@ -182,6 +183,7 @@ public abstract class com/github/jengelman/gradle/plugins/shadow/tasks/Dependenc public fun resolve (Ljava/util/Collection;)Lorg/gradle/api/file/FileCollection; protected abstract fun resolve (Ljava/util/Set;Ljava/util/Set;Ljava/util/Set;)V public fun resolve (Lorg/gradle/api/artifacts/Configuration;)Lorg/gradle/api/file/FileCollection; + public fun resolve (Lorg/gradle/api/file/ConfigurableFileCollection;)Lorg/gradle/api/file/FileCollection; } public abstract class com/github/jengelman/gradle/plugins/shadow/tasks/FindResourceInClasspath : org/gradle/api/DefaultTask, org/gradle/api/tasks/util/PatternFilterable { @@ -273,6 +275,7 @@ public abstract class com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar public fun getMainClass ()Lorg/gradle/api/provider/Property; public fun getManifest ()Lcom/github/jengelman/gradle/plugins/shadow/tasks/InheritManifest; public synthetic fun getManifest ()Lorg/gradle/api/java/archives/Manifest; + public fun getMergedDependencies ()Lorg/gradle/api/file/ConfigurableFileCollection; public fun getMinimizeJar ()Lorg/gradle/api/provider/Property; public fun getMinimizeSpec ()Lcom/github/jengelman/gradle/plugins/shadow/tasks/MinimizeSpec; public fun getR8Classpath ()Lorg/gradle/api/file/ConfigurableFileCollection; diff --git a/docs/configuration/README.md b/docs/configuration/README.md index 07f3475eb..f426dd16b 100644 --- a/docs/configuration/README.md +++ b/docs/configuration/README.md @@ -40,7 +40,7 @@ flowchart TD D4 -->|"No"| D6 end - click A2 href "../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/configurations.html" "ShadowJar.configurations" + click A2 href "../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/merged-dependencies.html" "ShadowJar.mergedDependencies" click A3 href "../api/shadow/com.github.jengelman.gradle.plugins.shadow/-shadow-base-plugin/-companion/-c-o-n-f-i-g-u-r-a-t-i-o-n_-n-a-m-e.html" "ShadowBasePlugin.CONFIGURATION_NAME" click A5 href "../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/included-dependencies.html" "ShadowJar.includedDependencies" click A4 href "../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/dependencies.html" "ShadowJar.dependencies" diff --git a/docs/configuration/dependencies/README.md b/docs/configuration/dependencies/README.md index 6ff120ecf..d747059b1 100644 --- a/docs/configuration/dependencies/README.md +++ b/docs/configuration/dependencies/README.md @@ -1,15 +1,15 @@ # Configuring Shadowed Dependencies Shadow configures the default [`ShadowJar`][ShadowJar] task to merge all dependencies from the project's -`runtimeClasspath` configuration into the final JAR. The configurations from which to source dependencies for the -merging can be configured using the [`configurations`][ShadowJar.configurations] property of the +`runtimeClasspath` configuration into the final JAR. The dependencies and files from which to source dependencies for the +merging can be configured using the [`mergedDependencies`][ShadowJar.mergedDependencies] property of the [`ShadowJar`][ShadowJar] task type. === ":material-language-kotlin: build.gradle.kts" ```kotlin tasks.shadowJar { - configurations = project.configurations.compileClasspath.map { listOf(it) } + mergedDependencies.setFrom(project.configurations.compileClasspath) } ``` @@ -17,7 +17,7 @@ merging can be configured using the [`configurations`][ShadowJar.configurations] ```groovy tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) { - configurations = project.configurations.named('compileClasspath').map { [it] } + mergedDependencies.setFrom project.configurations.named('compileClasspath') } ``` @@ -25,17 +25,6 @@ The above code sample would configure the [`ShadowJar`][ShadowJar] task to merge `compileClasspath` configuration. This means any dependency declared in the `runtimeOnly` configuration would be **not** be included in the final JAR. -> [!WARNING] -> **Required Configuration** -> -> Note the literal use of [`project.configurations`][Project.configurations] when setting the -> [`configurations`][ShadowJar.configurations] attribute of a [`ShadowJar`][ShadowJar] task. -> -> This is **required**. It may be tempting to specify `configurations = [configurations.compileClasspath]` but -> this will not have the intended effect, as `configurations.compile` will try to delegate to the -> [`configurations`][ShadowJar.configurations] property of the [`ShadowJar`][ShadowJar] task instead of the -> `project`. - ## Embedding Local Jar Files into Your Shadowed JAR The [`ShadowJar`][ShadowJar] task is a subclass of the [`Jar`][Jar] task, which means that the [`Jar.from`][Jar.from] @@ -486,7 +475,7 @@ block provides a method that accepts a `Closure` for selecting dependencies. [Jar.from]: https://docs.gradle.org/current/dsl/org.gradle.jvm.tasks.Jar.html#org.gradle.jvm.tasks.Jar:from(java.lang.Object,%20org.gradle.api.Action) [Jar]: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.Jar.html -[ShadowJar.configurations]: ../../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/configurations.html +[ShadowJar.mergedDependencies]: ../../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/merged-dependencies.html [ShadowJar.dependencies]: ../../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/dependencies.html [ShadowJar]: ../../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html [Project.configurations]: https://docs.gradle.org/current/dsl/org.gradle.api.Project.html#org.gradle.api.Project:configurations diff --git a/docs/configuration/relocation/README.md b/docs/configuration/relocation/README.md index 8358ca62a..5528dbc76 100644 --- a/docs/configuration/relocation/README.md +++ b/docs/configuration/relocation/README.md @@ -231,8 +231,8 @@ relocating), you can try out the trick like: ```kotlin tasks.shadowJar { - // Empty configurations list will exclude all dependencies. - configurations = emptyList() + // Empty mergedDependencies will exclude all dependencies. + mergedDependencies.setFrom() relocate("com.example", "shadow.com.example") } ``` @@ -241,14 +241,14 @@ relocating), you can try out the trick like: ```groovy tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) { - // Empty configurations list will exclude all dependencies. - configurations = [] + // Empty mergedDependencies will exclude all dependencies. + mergedDependencies.setFrom() relocate 'com.example', 'shadow.com.example' } ``` This is useful in some cases, as mentioned in [#759]. See -[Configuring Shadowed Dependencies][configuring-shadowed-dependencies] for more information about `configurations`. +[Configuring Shadowed Dependencies][configuring-shadowed-dependencies] for more information about `mergedDependencies`. ## Relocating with R8 diff --git a/docs/custom-tasks/README.md b/docs/custom-tasks/README.md index cf625d1d5..b10051090 100644 --- a/docs/custom-tasks/README.md +++ b/docs/custom-tasks/README.md @@ -2,7 +2,7 @@ The built in [`ShadowJar`][ShadowJar] task only provides an output for the `main` source set of the project. It is possible to add arbitrary [`ShadowJar`][ShadowJar] tasks to a project. When doing so, ensure that the -[`configurations`][ShadowJar.configurations] property is specified to inform Shadow which dependencies to merge into the +[`mergedDependencies`][ShadowJar.mergedDependencies] property is specified to inform Shadow which dependencies to merge into the output. === ":material-language-kotlin: build.gradle.kts" @@ -13,7 +13,7 @@ output. archiveClassifier = "test" from(sourceSets.test.map { it.output }) - configurations = project.configurations.testRuntimeClasspath.map { listOf(it) } + mergedDependencies.setFrom(project.configurations.testRuntimeClasspath) manifest { // Optionally, set the main class for the JAR. @@ -36,7 +36,7 @@ output. archiveClassifier = 'test' from sourceSets.named('test').map { it.output } - configurations = project.configurations.named('testRuntimeClasspath').map { [it] } + mergedDependencies.setFrom project.configurations.named('testRuntimeClasspath') manifest { // Optionally, set the main class for the JAR. @@ -59,7 +59,7 @@ The code snippet above will generate a shadowed JAR containing both the `main` a It is also possible to create a shadow JAR that contains *only* the dependencies and none of the project's own source code. This is accomplished by creating a custom [`ShadowJar`][ShadowJar] task and configuring the -[`configurations`][ShadowJar.configurations] property, but **not** adding any project sources with `from(...)`. +[`mergedDependencies`][ShadowJar.mergedDependencies] property, but **not** adding any project sources with `from(...)`. === ":material-language-kotlin: build.gradle.kts" @@ -67,7 +67,7 @@ code. This is accomplished by creating a custom [`ShadowJar`][ShadowJar] task an val dependencyShadowJar = tasks.register("dependencyShadowJar") { description = "Create a shadow JAR of all dependencies" archiveClassifier = "dep" - configurations = project.configurations.runtimeClasspath.map { listOf(it) } + mergedDependencies.setFrom(project.configurations.runtimeClasspath) } ``` @@ -77,7 +77,7 @@ code. This is accomplished by creating a custom [`ShadowJar`][ShadowJar] task an tasks.register('dependencyShadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) { description = 'Create a shadow JAR of all dependencies' archiveClassifier = 'dep' - configurations = project.configurations.named('runtimeClasspath').map { [it] } + mergedDependencies.setFrom project.configurations.named('runtimeClasspath') } ``` @@ -86,5 +86,5 @@ configuration. The standard `jar` task will still produce a JAR with only the pr [Jar]: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.Jar.html -[ShadowJar.configurations]: ../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/configurations.html +[ShadowJar.mergedDependencies]: ../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/merged-dependencies.html [ShadowJar]: ../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html diff --git a/docs/publishing/README.md b/docs/publishing/README.md index 2ec088dfd..34303520b 100644 --- a/docs/publishing/README.md +++ b/docs/publishing/README.md @@ -156,7 +156,7 @@ The Shadow plugin provides a custom configuration (`configurations.shadow`) to s No other dependencies are automatically configured for inclusion in the POM file. For example, excluded dependencies are **not** automatically added to the POM file or if the configuration for merging are modified by specifying -`shadowJar.configurations = [configurations.myConfiguration]`, there is no automatic configuration of the POM file. +`shadowJar.mergedDependencies.setFrom(configurations.myConfiguration)`, there is no automatic configuration of the POM file. This automatic configuration occurs _only_ when using the above methods for configuring publishing. If this behavior is not desirable, then publishing **must** be manually configured. @@ -392,7 +392,7 @@ It is possible to publish a custom [`ShadowJar`][ShadowJar] task's output via th description = "Create a combined JAR of project and test dependencies" archiveClassifier = "tests" from(sourceSets.test.map { it.output }) - configurations = project.configurations.testRuntimeClasspath.map { listOf(it) } + mergedDependencies.setFrom(project.configurations.testRuntimeClasspath) } dependencies { @@ -424,7 +424,7 @@ It is possible to publish a custom [`ShadowJar`][ShadowJar] task's output via th description = 'Create a combined JAR of project and test dependencies' archiveClassifier = 'tests' from sourceSets.named('test').map { it.output } - configurations = project.configurations.named('testRuntimeClasspath').map { [it] } + mergedDependencies.setFrom project.configurations.named('testRuntimeClasspath') } dependencies { diff --git a/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginsTest.kt b/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginsTest.kt index 490847aba..10b06965f 100644 --- a/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginsTest.kt +++ b/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginsTest.kt @@ -693,7 +693,7 @@ class JavaPluginsTest : BasePluginTest() { | description = 'Create a combined JAR of project and test dependencies' | archiveClassifier = 'test' | from sourceSets.named('test').map { it.output } - | configurations = project.configurations.named('testRuntimeClasspath').map { [it] } + | mergedDependencies.from project.configurations.named('testRuntimeClasspath') | manifest { | attributes '$mainClassAttributeKey': 'my.Main' | } @@ -729,7 +729,7 @@ class JavaPluginsTest : BasePluginTest() { | description = 'Create a combined JAR of project and test dependencies' | archiveClassifier = 'test' | from sourceSets.named('test').map { it.output } - | configurations = project.configurations.named('testRuntimeClasspath').map { [it] } + | mergedDependencies.from project.configurations.named('testRuntimeClasspath') | manifest { | attributes '$mainClassAttributeKey': 'my.Main' | } @@ -772,7 +772,7 @@ class JavaPluginsTest : BasePluginTest() { |def $dependencyShadowJar = tasks.register('$dependencyShadowJar', ${ShadowJar::class.java.name}) { | description = 'Create a shadow JAR of all dependencies' | archiveClassifier = 'dep' - | configurations = project.configurations.named('runtimeClasspath').map { [it] } + | mergedDependencies.from project.configurations.named('runtimeClasspath') |} """ .trimMargin() @@ -790,6 +790,33 @@ class JavaPluginsTest : BasePluginTest() { } } + @Test + fun registerCustomShadowJarUsingDeprecatedConfigurations() { + val mainClassEntry = writeClass() + val legacyShadowJar = "legacyShadowJar" + + projectScript.appendText( + """ + |dependencies { + | implementation 'junit:junit:3.8.2' + |} + |def $legacyShadowJar = tasks.register('$legacyShadowJar', ${ShadowJar::class.java.name}) { + | description = 'Create a shadow JAR of all dependencies using deprecated configurations' + | archiveClassifier = 'legacy' + | configurations = project.configurations.named('runtimeClasspath').map { [it] } + |} + """ + .trimMargin() + ) + + runWithSuccess("jar", legacyShadowJar) + + assertThat(jarPath("build/libs/my-1.0-legacy.jar")).useAll { + containsOnly(*junitEntries, *manifestEntries) + transform { it.mainAttrSize }.isEqualTo(1) + } + } + @Test fun registerCustomShadowJarWithoutShadowR8Configuration() { val customShadowJar = "customShadowJar" @@ -1180,7 +1207,7 @@ class JavaPluginsTest : BasePluginTest() { |} | |$shadowJarTask { - | configurations = [project.configurations.runtimeClasspath] + | mergedDependencies.from project.configurations.runtimeClasspath |} | |configurations.runtimeClasspath { diff --git a/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/PublishingTest.kt b/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/PublishingTest.kt index 2f8aa4b6c..4fe103880 100644 --- a/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/PublishingTest.kt +++ b/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/PublishingTest.kt @@ -295,7 +295,7 @@ class PublishingTest : BasePluginTest() { | description = 'Create a combined JAR of project and test dependencies' | archiveClassifier = 'tests' | from sourceSets.named('test').map { it.output } - | configurations = project.configurations.named('testRuntimeClasspath').map { [it] } + | mergedDependencies.from project.configurations.named('testRuntimeClasspath') |} """ .trimMargin(), diff --git a/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/RelocationTest.kt b/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/RelocationTest.kt index d228a96a4..a6b50d9bc 100644 --- a/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/RelocationTest.kt +++ b/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/RelocationTest.kt @@ -460,7 +460,7 @@ class RelocationTest : BasePluginTest() { | implementation 'junit:junit:3.8.2' |} |$shadowJarTask { - | configurations = [] + | mergedDependencies.setFrom() | relocate('', 'foo/') |} """ diff --git a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowJavaPlugin.kt b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowJavaPlugin.kt index 20fd5182c..2c8e8e6a5 100644 --- a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowJavaPlugin.kt +++ b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowJavaPlugin.kt @@ -39,6 +39,7 @@ constructor(private val softwareComponentFactory: SoftwareComponentFactory) : Pl val taskProvider = registerShadowJarCommon(tasks.named("jar", Jar::class.java)) { task -> task.from(sourceSets.named("main").map { it.output }) + @Suppress("DEPRECATION") task.configurations.convention(provider { listOf(runtimeConfiguration) }) } artifacts.add(configurations.shadow.name, taskProvider) diff --git a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowKmpPlugin.kt b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowKmpPlugin.kt index c8bb3a257..c066de1ff 100644 --- a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowKmpPlugin.kt +++ b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowKmpPlugin.kt @@ -36,6 +36,7 @@ public abstract class ShadowKmpPlugin : Plugin { val kotlinJvmMain = target.compilations.named("main") registerShadowJarCommon(tasks.named(target.artifactsTaskName, Jar::class.java)) { task -> task.from(kotlinJvmMain.map { it.output.allOutputs }) + @Suppress("DEPRECATION") task.configurations.convention( kotlinJvmMain .flatMap { configurations.named(it.runtimeDependencyConfigurationName) } diff --git a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/DependencyFilter.kt b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/DependencyFilter.kt index 64a3007a0..b79f259e7 100644 --- a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/DependencyFilter.kt +++ b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/DependencyFilter.kt @@ -7,6 +7,7 @@ import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.ProjectDependency import org.gradle.api.artifacts.ResolvedArtifact import org.gradle.api.artifacts.ResolvedDependency +import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.FileCollection import org.gradle.api.provider.Provider import org.gradle.api.specs.Spec @@ -23,6 +24,13 @@ public interface DependencyFilter { */ public fun resolve(configurations: Collection): FileCollection + /** + * Resolve a [ConfigurableFileCollection] against the [include]/[exclude] rules in the filter. + * + * Any [Configuration] sources within the collection are resolved individually and combined. + */ + public fun resolve(dependencies: ConfigurableFileCollection): FileCollection + /** Exclude dependencies that match the provided [spec]. */ public fun exclude(spec: Spec) @@ -73,6 +81,39 @@ public interface DependencyFilter { .reduceOrNull { acc, fileCollection -> acc + fileCollection } ?: project.files() } + override fun resolve(dependencies: ConfigurableFileCollection): FileCollection { + val extracted = dependencies.from.flatMap { source -> extractConfigurations(source) } + val excludedFiles = + project.files( + project.provider { + val includes = mutableSetOf() + val excludes = mutableSetOf() + extracted.forEach { config -> + resolve( + dependencies = config.resolvedConfiguration.firstLevelModuleDependencies, + includedDependencies = includes, + excludedDependencies = excludes, + ) + } + excludes.flatMap { it.moduleArtifacts.map(ResolvedArtifact::getFile) } + } + ) + return dependencies - excludedFiles + } + + private fun extractConfigurations(source: Any): List = + when (source) { + is Configuration -> listOf(source) + is Provider<*> -> + when (val value = source.orNull) { + is Configuration -> listOf(value) + is Iterable<*> -> value.filterIsInstance() + else -> emptyList() + } + is Iterable<*> -> source.filterIsInstance() + else -> emptyList() + } + override fun exclude(spec: Spec) { excludeSpecs.add(spec) } diff --git a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.kt b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.kt index 9eae97c3b..1a60c0275 100644 --- a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.kt +++ b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.kt @@ -119,7 +119,7 @@ public abstract class ShadowJar : Jar() { @get:Classpath public open val toMinimize: ConfigurableFileCollection = objectFactory.fileCollection { _minimizeJar.map { - if (it) (_minimizeSpec.resolve(configurations.get()) - apiJars) else emptySet() + if (it) (_minimizeSpec.resolve(mergedDependencies) - apiJars) else emptySet() } } @@ -175,9 +175,23 @@ public abstract class ShadowJar : Jar() { * * Defaults to a set that contains `runtimeClasspath` or `runtime` configuration. */ + @Deprecated( + message = "Use `mergedDependencies` instead. This property will be removed in Shadow 10.", + replaceWith = ReplaceWith("mergedDependencies.from(configurations)"), + ) @get:Classpath public open val configurations: SetProperty = objectFactory.setProperty() + /** + * The dependencies and files to be merged into the shadow JAR. + * + * Defaults to a file collection that contains `runtimeClasspath` or `runtime` configuration. + */ + @get:Classpath + public open val mergedDependencies: ConfigurableFileCollection = objectFactory.fileCollection { + @Suppress("DEPRECATION") configurations + } + @get:Internal // The resolved result is tracked by includedDependencies. public open val dependencyFilter: Property = objectFactory.property(DefaultDependencyFilter(project)) @@ -185,7 +199,7 @@ public abstract class ShadowJar : Jar() { /** Final dependencies to be shadowed. */ @get:Classpath public open val includedDependencies: ConfigurableFileCollection = objectFactory.fileCollection { - dependencyFilter.zip(configurations) { df, cs -> df.resolve(cs) } + dependencyFilter.map { df -> df.resolve(mergedDependencies) } } /** diff --git a/src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowPropertiesTest.kt b/src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowPropertiesTest.kt index 91c70e5ab..c3004ca85 100644 --- a/src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowPropertiesTest.kt +++ b/src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowPropertiesTest.kt @@ -161,7 +161,9 @@ class ShadowPropertiesTest { ) assertThat(relocationPrefix.get()).isEqualTo(ShadowBasePlugin.SHADOW) - assertThat(configurations.get()).containsOnly(runtimeConfiguration) + assertThat(mergedDependencies.files) + .containsOnly(*runtimeConfiguration.files.toTypedArray()) + assertThat(@Suppress("DEPRECATION") configurations.get()).containsOnly(runtimeConfiguration) } }