Provide Gradle Kotlin DSL examples in documentation
eriwen opened this issue · 3 comments
As a Gradle Kotlin DSL adopter, I'd like to know how to configure this plugin using the Kotlin DSL.
This plugin was identified as one of the most useful Gradle plugins. With Kotlin DSL 1.0 approaching shortly, it'd be wonderful if the documentation provided Kotlin and Groovy DSL samples. Blog post with suggestions.
Here are a couple additional resources:
- Migrating build logic from Groovy to Kotlin guide
- Exemplar for automated samples testing
- Join #kotlin-dsl channel in Gradle Community Slack for personalized help
Thank you for providing a great Gradle plugin! —The Gradle Team
Is this solved?
I can't figure out how to convert this part to kotlin:
publishing {
publications {
shadow(MavenPublication) { publication ->
project.shadow.component(publication)
}
}
}
See https://imperceptiblethoughts.com/shadow/publishing/#publishing-with-maven-publish-plugin
I can't figure out how to convert this part to kotlin:
publishing { publications { shadow(MavenPublication) { publication -> project.shadow.component(publication) } } }See https://imperceptiblethoughts.com/shadow/publishing/#publishing-with-maven-publish-plugin
It has been 3 months since your comment but I also had trouble figuring this one out. So I am sharing the solution with everyone for future use:
subprojects {
publishing {
publications {
create<MavenPublication>("shadow") {
project.extensions.configure<com.github.jengelman.gradle.plugins.shadow.ShadowExtension>() {
component(this@create)
}
}
}
}
}