Skip to content

Commit 727403d

Browse files
committed
Replace manifest.attribute calls
1 parent 74ae666 commit 727403d

File tree

10 files changed

+29
-29
lines changed

10 files changed

+29
-29
lines changed

docs/configuration/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ will propagate to the [`ShadowJar`][ShadowJar] tasks.
111111
```groovy
112112
tasks.named('jar', Jar) {
113113
manifest {
114-
attributes 'Class-Path': '/libs/foo.jar'
114+
attributes('Class-Path': '/libs/foo.jar')
115115
}
116116
}
117117
```
@@ -144,7 +144,7 @@ methods on the `shadowJar.manifest` object can be used to configure the upstream
144144
```groovy
145145
def testJar = tasks.register('testJar', Jar) {
146146
manifest {
147-
attributes 'Description': 'This is an application JAR'
147+
attributes('Description': 'This is an application JAR')
148148
}
149149
}
150150

docs/custom-tasks/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ the output.
4040

4141
manifest {
4242
// Optionally, set the main class for the JAR.
43-
attributes 'Main-Class': 'test.Main'
43+
attributes('Main-Class': 'test.Main')
4444
// You can also set other attributes here.
4545
}
4646
}

docs/groovy-and-scala-plugins/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ For Groovy:
4141
tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
4242
manifest {
4343
// Optionally, set the main class for the shadowed JAR.
44-
attributes 'Main-Class': 'com.example.Main'
44+
attributes('Main-Class': 'com.example.Main')
4545
}
4646
}
4747
```
@@ -85,7 +85,7 @@ For Scala:
8585
tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
8686
manifest {
8787
// Optionally, set the main class for the shadowed JAR.
88-
attributes 'Main-Class': 'com.example.Main'
88+
attributes('Main-Class': 'com.example.Main')
8989
}
9090
}
9191
```

docs/kotlin-plugins/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ automatically configure additional tasks for bundling the shadowed JAR for its `
140140
tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
141141
manifest {
142142
// Optionally, set the main class for the shadowed JAR.
143-
attributes 'Main-Class': 'com.example.MainKt'
143+
attributes('Main-Class': 'com.example.MainKt')
144144
}
145145
}
146146
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class ApplicationPluginTest : BasePluginTest() {
134134
projectBlock = """
135135
shadowJar {
136136
manifest {
137-
attributes '$mainClassAttributeKey': 'my.Main2'
137+
attributes('$mainClassAttributeKey': 'my.Main2')
138138
}
139139
}
140140
""".trimIndent(),

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ class CachingTest : BasePluginTest() {
148148
"""
149149
$jarTask {
150150
manifest {
151-
attributes 'Foo': 'Foo1'
151+
attributes('Foo': 'Foo1')
152152
}
153153
}
154154
$shadowJarTask {
155155
manifest {
156-
attributes 'Bar': 'Bar1'
156+
attributes('Bar': 'Bar1')
157157
}
158158
}
159159
""".trimIndent(),

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ class JavaPluginsTest : BasePluginTest() {
240240
"""
241241
$jarTask {
242242
manifest {
243-
attributes '$multiReleaseAttributeKey': 'true'
243+
attributes('$multiReleaseAttributeKey': 'true')
244244
}
245245
}
246246
""".trimIndent() + lineSeparator,
@@ -274,7 +274,7 @@ class JavaPluginsTest : BasePluginTest() {
274274
"""
275275
$jarTask {
276276
manifest {
277-
attributes '$multiReleaseAttributeKey': 'true'
277+
attributes('$multiReleaseAttributeKey': 'true')
278278
}
279279
}
280280
""".trimIndent() + lineSeparator,
@@ -427,7 +427,7 @@ class JavaPluginsTest : BasePluginTest() {
427427
}
428428
$jarTask {
429429
manifest {
430-
attributes '$classPathAttributeKey': '/libs/foo.jar'
430+
attributes('$classPathAttributeKey': '/libs/foo.jar')
431431
}
432432
}
433433
""".trimIndent(),
@@ -578,7 +578,7 @@ class JavaPluginsTest : BasePluginTest() {
578578
from sourceSets.named('test').map { it.output }
579579
configurations = project.configurations.named('testRuntimeClasspath').map { [it] }
580580
manifest {
581-
attributes '$mainClassAttributeKey': 'my.Main'
581+
attributes('$mainClassAttributeKey': 'my.Main')
582582
}
583583
}
584584
""".trimIndent(),
@@ -692,17 +692,17 @@ class JavaPluginsTest : BasePluginTest() {
692692
"""
693693
$jarTask {
694694
manifest {
695-
attributes 'Foo-Attr': 'Foo-Value'
695+
attributes('Foo-Attr': 'Foo-Value')
696696
}
697697
}
698698
def testJar = tasks.register('testJar', Jar) {
699699
manifest {
700-
attributes 'Bar-Attr': 'Bar-Value'
700+
attributes('Bar-Attr': 'Bar-Value')
701701
}
702702
}
703703
$shadowJarTask {
704704
manifest {
705-
attributes 'Baz-Attr': 'Baz-Value'
705+
attributes('Baz-Attr': 'Baz-Value')
706706
from(testJar.get().manifest)
707707
}
708708
}
@@ -725,7 +725,7 @@ class JavaPluginsTest : BasePluginTest() {
725725
"""
726726
$jarTask {
727727
manifest {
728-
attributes '$mainClassAttributeKey': 'my.Main'
728+
attributes('$mainClassAttributeKey': 'my.Main')
729729
}
730730
}
731731
$shadowJarTask {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class KotlinPluginsTest : BasePluginTest() {
177177
fun setMainClassAttributeFromMainRun(useShadowAttr: Boolean) {
178178
val mainClassName = "my.Main"
179179
val main2ClassName = "my.Main2"
180-
val mainAttr = if (useShadowAttr) "attributes '$mainClassAttributeKey': '$main2ClassName'" else ""
180+
val mainAttr = if (useShadowAttr) "attributes('$mainClassAttributeKey': '$main2ClassName')" else ""
181181
projectScript.appendText(
182182
"""
183183
kotlin {
@@ -205,15 +205,15 @@ class KotlinPluginsTest : BasePluginTest() {
205205
fun setManifestAttrsFromJvmTargetJar(useShadowAttr: Boolean) {
206206
val mainClassName = "my.Main"
207207
val main2ClassName = "my.Main2"
208-
val mainAttr = if (useShadowAttr) "attributes '$mainClassAttributeKey': '$main2ClassName'" else ""
208+
val mainAttr = if (useShadowAttr) "attributes('$mainClassAttributeKey': '$main2ClassName')" else ""
209209
projectScript.appendText(
210210
"""
211211
kotlin {
212212
jvm()
213213
}
214214
tasks.named('jvmJar', Jar) {
215215
manifest {
216-
attributes '$mainClassAttributeKey': '$mainClassName'
216+
attributes('$mainClassAttributeKey': '$mainClassName')
217217
}
218218
}
219219
$shadowJarTask {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ class RelocationTest : BasePluginTest() {
487487
"""
488488
$shadowJarTask {
489489
manifest {
490-
attributes '$mainClassAttributeKey': 'my.Main'
490+
attributes('$mainClassAttributeKey': 'my.Main')
491491
}
492492
relocate('foo', 'shadow.foo')
493493
}
@@ -515,7 +515,7 @@ class RelocationTest : BasePluginTest() {
515515
"""
516516
$shadowJarTask {
517517
manifest {
518-
attributes '$mainClassAttributeKey': 'my.Main'
518+
attributes('$mainClassAttributeKey': 'my.Main')
519519
}
520520
relocate('foo', 'shadow.foo') {
521521
skipStringConstants = $skipStringConstants
@@ -561,7 +561,7 @@ class RelocationTest : BasePluginTest() {
561561
"""
562562
$shadowJarTask {
563563
manifest {
564-
attributes '$mainClassAttributeKey': 'my.Main'
564+
attributes('$mainClassAttributeKey': 'my.Main')
565565
}
566566
relocate('org.package', 'shadow.org.package')
567567
}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class TransformersTest : BaseTransformerTest() {
3131
"""
3232
$jarTask {
3333
manifest {
34-
attributes '$mainClassAttributeKey': 'my.Main'
35-
attributes '$TEST_ENTRY_ATTR_KEY': 'PASSED'
34+
attributes('$mainClassAttributeKey': 'my.Main')
35+
attributes('$TEST_ENTRY_ATTR_KEY': 'PASSED')
3636
}
3737
}
3838
""".trimIndent(),
@@ -293,14 +293,14 @@ class TransformersTest : BaseTransformerTest() {
293293
val MANIFEST_ATTRS = """
294294
$jarTask {
295295
manifest {
296-
attributes '$mainClassAttributeKey': 'my.Main'
297-
attributes '$TEST_ENTRY_ATTR_KEY': 'FAILED'
296+
attributes('$mainClassAttributeKey': 'my.Main')
297+
attributes('$TEST_ENTRY_ATTR_KEY': 'FAILED')
298298
}
299299
}
300300
$shadowJarTask {
301301
manifest {
302-
attributes '$NEW_ENTRY_ATTR_KEY': 'NEW'
303-
attributes '$TEST_ENTRY_ATTR_KEY': 'PASSED'
302+
attributes('$NEW_ENTRY_ATTR_KEY': 'NEW')
303+
attributes('$TEST_ENTRY_ATTR_KEY': 'PASSED')
304304
}
305305
}
306306
""".trimIndent()

0 commit comments

Comments
 (0)