Repository: GradleUp/shadow (kotlin)

Issue:
"inheritFrom" not directly accessible in kotlin dsl
### Expected and Results

I'm not sure if this is considered a bug or feature request.

As specified here: https://gradleup.com/shadow/configuration/#configuring-the-jar-manifest
This works with groovy syntax, but isn't really accessible with kotlin dsl directly, and this workaround has to be used instead:

```kotlin
tasks.named("shadowJar", com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar::class) {
    manifest {
        withGroovyBuilder {
            "inheritFrom"(project.tasks.getByName("testJar", Jar::class).manifest)
        }
    }
}
```

### Related environent and versions

_No response_

### Reproduction steps

_No response_

### Anything else?

_No response_

Pull request description:
Closes #1260.

---

- [ ] [CHANGELOG](https://github.com/GradleUp/shadow/blob/main/src/docs/changes/README.md)'s "Unreleased" section has been updated, if applicable.

Patch:
diff --git a/src/docs/configuration/README.md b/src/docs/configuration/README.md
index 94660b90a..2b4f202a5 100644
--- a/src/docs/configuration/README.md
+++ b/src/docs/configuration/README.md
@@ -89,15 +89,13 @@ If it is desired to inherit a manifest from a JAR task other than the standard `
 on the `shadowJar.manifest` object can be used to configure the upstream.
 
 ```groovy
-tasks.register('testJar', Jar) {
+def testJar = tasks.register('testJar', Jar) {
   manifest {
     attributes 'Description': 'This is an application JAR'
   }
 }
 
 tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
-  manifest {
-    inheritFrom(project.tasks.testJar.manifest)
-  }
+  manifest.inheritFrom(testJar.get().manifest)
 }
 ```


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 69bef1588..00b3a1e8b 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
@@ -619,4 +619,33 @@ class JavaPluginTest : BasePluginTest() {
       )
     }
   }
+
+  @Test
+  fun canInheritFromOtherManifest() {
+    projectScriptPath.appendText(
+      """
+        jar {
+          manifest {
+            attributes 'Foo-Attr': 'Foo-Value'
+          }
+        }
+        def testJar = tasks.register('testJar', Jar) {
+          manifest {
+            attributes 'Bar-Attr': 'Bar-Value'
+          }
+        }
+        $shadowJar {
+          manifest.inheritFrom(testJar.get().manifest)
+        }
+      """.trimIndent(),
+    )
+
+    run(shadowJarTask)
+
+    assertThat(outputShadowJar).useAll {
+      transform { it.manifest.mainAttributes }.isNotEmpty()
+      getMainAttr("Foo-Attr").isEqualTo("Foo-Value")
+      getMainAttr("Bar-Attr").isEqualTo("Bar-Value")
+    }
+  }
 }