Repository: GradleUp/shadow
Pull request #1361 (2025-03-24 08:10:46)

Update configurations assignments and fix typos
Follow up https://github.com/GradleUp/shadow/pull/1306#discussion_r2009683131.


Patch:
diff --git a/docs/configuration/dependencies/README.md b/docs/configuration/dependencies/README.md
index 834ffe3a..eab1e43b 100644
--- a/docs/configuration/dependencies/README.md
+++ b/docs/configuration/dependencies/README.md
@@ -9,7 +9,7 @@ of the [`ShadowJar`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow
 
     ```kotlin
     tasks.shadowJar {
-      configurations = provider { listOf(project.configurations.runtimeClasspath.get()) }
+      configurations = project.configurations.compileClasspath.map { listOf(it) }
     }
     ```
 
@@ -17,7 +17,7 @@ of the [`ShadowJar`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow
 
     ```groovy
     tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
-      configurations = [project.configurations.compileClasspath]
+      configurations = project.configurations.named('compileClasspath').map { [it] }
     }
     ```
 
@@ -26,7 +26,7 @@ This means any dependency declared in the `runtimeOnly` configuration would be *
 
 > Note the literal use of `project.configurations` when setting the `configurations` attribute of a
 [`ShadowJar`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html) task.
-This is **required**. It may be tempting to specify `configurations = [configurations.compile]` but this will not
+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` property of the [`ShadowJar`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html) task instead of the `project`
 
 ## Embedding Jar Files Inside Your Shadow Jar
diff --git a/docs/custom-tasks/README.md b/docs/custom-tasks/README.md
index 261985cb..11e31795 100644
--- a/docs/custom-tasks/README.md
+++ b/docs/custom-tasks/README.md
@@ -14,7 +14,7 @@ dependencies to merge into the output.
 
       archiveClassifier = "tests"
       from(sourceSets.test.map { it.output })
-      configurations = provider { listOf(project.configurations["testRuntimeClasspath"]) }
+      configurations = project.configurations.testRuntimeClasspath.map { listOf(it) }
 
       manifest {
         // Optionally, set the main class for the JAR.
@@ -38,7 +38,7 @@ dependencies to merge into the output.
 
       archiveClassifier = 'tests'
       from sourceSets.named('test').map { it.output }
-      configurations = provider { [project.configurations.testRuntimeClasspath] }
+      configurations = project.configurations.named('testRuntimeClasspath').map { [it] }
 
       manifest {
         // Optionally, set the main class for the JAR.
diff --git a/docs/publishing/README.md b/docs/publishing/README.md
index da614655..e888b53f 100644
--- a/docs/publishing/README.md
+++ b/docs/publishing/README.md
@@ -60,7 +60,7 @@ published artifact.
 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
+`shadowJar.configurations = [configurations.myConfiguration]`, there is no automatic
 configuration of the POM file.
 
 This automatic configuration occurs _only_ when using the above methods for
@@ -167,7 +167,7 @@ It is possible to publish a custom `ShadowJar` task's output via the [`MavenPubl
       description = "Create a combined JAR of project and test dependencies"
       archiveClassifier = "tests"
       from(sourceSets.test.map { it.output })
-      configurations = provider { listOf(project.configurations["testRuntimeClasspath"]) }
+      configurations = project.configurations.testRuntimeClasspath.map { listOf(it) }
     }
 
     dependencies {
@@ -200,7 +200,7 @@ It is possible to publish a custom `ShadowJar` task's output via the [`MavenPubl
       description = 'Create a combined JAR of project and test dependencies'
       archiveClassifier = 'tests'
       from sourceSets.named('test').map { it.output }
-      configurations = provider { [project.configurations.testRuntimeClasspath] }
+      configurations = project.configurations.named('testRuntimeClasspath').map { [it] }
     }
 
     dependencies {


Test patch:
diff --git a/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginTest.kt b/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginTest.kt
index aa9014ee..f2c76ff1 100644
--- a/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginTest.kt
+++ b/src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginTest.kt
@@ -479,7 +479,7 @@ class JavaPluginTest : BasePluginTest() {
           description = 'Create a combined JAR of project and test dependencies'
           archiveClassifier = 'tests'
           from sourceSets.named('test').map { it.output }
-          configurations = provider { [project.configurations.testRuntimeClasspath] }
+          configurations = project.configurations.named('testRuntimeClasspath').map { [it] }
           manifest {
             attributes '$mainClassAttributeKey': 'my.Main'
           }
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 a87c2371..f907c404 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
@@ -152,7 +152,7 @@ class PublishingTest : BasePluginTest() {
             description = 'Create a combined JAR of project and test dependencies'
             archiveClassifier = 'tests'
             from sourceSets.named('test').map { it.output }
-            configurations = provider { [project.configurations.testRuntimeClasspath] }
+            configurations = project.configurations.named('testRuntimeClasspath').map { [it] }
           }
         """.trimIndent(),
         dependenciesBlock = """