Skip to content

Commit 7279e90

Browse files
authored
Update configurations assignments and fix typos (#1361)
1 parent b525696 commit 7279e90

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

docs/configuration/dependencies/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ of the [`ShadowJar`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow
99

1010
```kotlin
1111
tasks.shadowJar {
12-
configurations = provider { listOf(project.configurations.runtimeClasspath.get()) }
12+
configurations = project.configurations.compileClasspath.map { listOf(it) }
1313
}
1414
```
1515

1616
=== "Groovy"
1717

1818
```groovy
1919
tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
20-
configurations = [project.configurations.compileClasspath]
20+
configurations = project.configurations.named('compileClasspath').map { [it] }
2121
}
2222
```
2323

@@ -26,7 +26,7 @@ This means any dependency declared in the `runtimeOnly` configuration would be *
2626

2727
> Note the literal use of `project.configurations` when setting the `configurations` attribute of a
2828
[`ShadowJar`](../../api/shadow/com.github.jengelman.gradle.plugins.shadow.tasks/-shadow-jar/index.html) task.
29-
This is **required**. It may be tempting to specify `configurations = [configurations.compile]` but this will not
29+
This is **required**. It may be tempting to specify `configurations = [configurations.compileClasspath]` but this will not
3030
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`
3131

3232
## Embedding Jar Files Inside Your Shadow Jar

docs/custom-tasks/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies to merge into the output.
1414

1515
archiveClassifier = "tests"
1616
from(sourceSets.test.map { it.output })
17-
configurations = provider { listOf(project.configurations["testRuntimeClasspath"]) }
17+
configurations = project.configurations.testRuntimeClasspath.map { listOf(it) }
1818

1919
manifest {
2020
// Optionally, set the main class for the JAR.
@@ -38,7 +38,7 @@ dependencies to merge into the output.
3838

3939
archiveClassifier = 'tests'
4040
from sourceSets.named('test').map { it.output }
41-
configurations = provider { [project.configurations.testRuntimeClasspath] }
41+
configurations = project.configurations.named('testRuntimeClasspath').map { [it] }
4242

4343
manifest {
4444
// Optionally, set the main class for the JAR.

docs/publishing/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ published artifact.
6060
No other dependencies are automatically configured for inclusion in the POM file.
6161
For example, excluded dependencies are **not** automatically added to the POM file or
6262
if the configuration for merging are modified by specifying
63-
`shadowJar.configurations = [configurations.myconfiguration]`, there is no automatic
63+
`shadowJar.configurations = [configurations.myConfiguration]`, there is no automatic
6464
configuration of the POM file.
6565

6666
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
167167
description = "Create a combined JAR of project and test dependencies"
168168
archiveClassifier = "tests"
169169
from(sourceSets.test.map { it.output })
170-
configurations = provider { listOf(project.configurations["testRuntimeClasspath"]) }
170+
configurations = project.configurations.testRuntimeClasspath.map { listOf(it) }
171171
}
172172

173173
dependencies {
@@ -200,7 +200,7 @@ It is possible to publish a custom `ShadowJar` task's output via the [`MavenPubl
200200
description = 'Create a combined JAR of project and test dependencies'
201201
archiveClassifier = 'tests'
202202
from sourceSets.named('test').map { it.output }
203-
configurations = provider { [project.configurations.testRuntimeClasspath] }
203+
configurations = project.configurations.named('testRuntimeClasspath').map { [it] }
204204
}
205205

206206
dependencies {

src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ class JavaPluginTest : BasePluginTest() {
479479
description = 'Create a combined JAR of project and test dependencies'
480480
archiveClassifier = 'tests'
481481
from sourceSets.named('test').map { it.output }
482-
configurations = provider { [project.configurations.testRuntimeClasspath] }
482+
configurations = project.configurations.named('testRuntimeClasspath').map { [it] }
483483
manifest {
484484
attributes '$mainClassAttributeKey': 'my.Main'
485485
}

src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/PublishingTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class PublishingTest : BasePluginTest() {
152152
description = 'Create a combined JAR of project and test dependencies'
153153
archiveClassifier = 'tests'
154154
from sourceSets.named('test').map { it.output }
155-
configurations = provider { [project.configurations.testRuntimeClasspath] }
155+
configurations = project.configurations.named('testRuntimeClasspath').map { [it] }
156156
}
157157
""".trimIndent(),
158158
dependenciesBlock = """

0 commit comments

Comments
 (0)