Skip to content

Commit fa1fe31

Browse files
authored
Prefer using from over inheritFrom (#1723)
1 parent f7d8d1b commit fa1fe31

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

docs/configuration/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Inspecting the `META-INF/MANIFEST.MF` entry in the JAR file will reveal the foll
122122
Class-Path: /libs/foo.jar
123123
```
124124

125-
If it is desired to inherit a manifest from a JAR task other than the standard [`Jar`][Jar] task, the `inheritFrom`
125+
If it is desired to inherit a manifest from a JAR task other than the standard [`Jar`][Jar] task, the `from`
126126
methods on the `shadowJar.manifest` object can be used to configure the upstream.
127127

128128
=== "Kotlin"
@@ -135,7 +135,7 @@ methods on the `shadowJar.manifest` object can be used to configure the upstream
135135
}
136136

137137
tasks.shadowJar {
138-
manifest.inheritFrom(testJar.get().manifest)
138+
manifest.from(testJar.get().manifest)
139139
}
140140
```
141141

@@ -149,7 +149,7 @@ methods on the `shadowJar.manifest` object can be used to configure the upstream
149149
}
150150

151151
tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
152-
manifest.inheritFrom(testJar.get().manifest)
152+
manifest.from(testJar.get().manifest)
153153
}
154154
```
155155

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ class JavaPluginsTest : BasePluginTest() {
724724
}
725725
}
726726
$shadowJarTask {
727-
manifest.inheritFrom(testJar.get().manifest)
727+
manifest.from(testJar.get().manifest)
728728
}
729729
""".trimIndent(),
730730
)

src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/InheritManifest.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ import org.gradle.api.java.archives.Manifest
55
import org.gradle.api.java.archives.ManifestMergeSpec
66

77
@Deprecated(
8-
message = "This is deprecated and will be removed in a future release. `inheritFrom` should be replaced by `from`.",
8+
message = "This is deprecated and will be removed in a future release.",
99
replaceWith = ReplaceWith("Manifest", "org.gradle.api.java.archives.Manifest"),
1010
)
1111
public interface InheritManifest : Manifest {
12+
@Deprecated(
13+
message = "This is deprecated and will be removed in a future release.",
14+
replaceWith = ReplaceWith("from"),
15+
)
1216
public fun inheritFrom(vararg inheritPaths: Any) {
1317
inheritFrom(inheritPaths = inheritPaths, action = {})
1418
}

0 commit comments

Comments
 (0)