Open ScottPierce opened 4 years ago
Happy to incorporate any pull requests that tighten it up. I don't use the Kotlin DSL though, so I'm not likely to do this myself any time soon.
+1 for Kotlin Gradle DSL.
@ScottPierce I'm doing this (more readable):
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
tasks.withType<ShadowJar> {
archiveFileName.set("my-app.jar") // Use other properties as well
}
Due to how even the Kotlin compile task requires the tasks.withType
syntax, I doubt anything extra would be the norm.
I'm usually defining typealias ShadowJar = com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
in my multi-module projects to get rid of the import, but it can't get much crisper.
Having some kind of an auto import for fun shadowJar(configure: Action<ShadowJar>): Unit
would be nice.
Also please put examples in the publishing doc with Kotlin DSL syntax.
^ again, contributions welcome. I don’t use Kotlin.
Anyone figured out how to use this with maven-publish
plugin in kotlin-dsl?
@johnrengelman I offer:
What might you be interested in?
+1 for Kotlin Gradle DSL.
@ScottPierce I'm doing this (more readable):
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar tasks.withType<ShadowJar> { archiveFileName.set("my-app.jar") // Use other properties as well }
This should be in the docs. Thanks a lot!
Shadow Version
5.2.0
Gradle Version
6.0.1
Expected Behavior
The DSL for this plugin is strongly typed and easy to use.
Actual Behavior
The DSL for this plugin is difficult to use, and weakly typed. I spent a few hours before I found someone who had deconstructed it on stack overflow.
Gradle Build Script(s)
In order to use this plugin, this is what we have to do. Obviously it should be easier than this: