What is the Kotlin DSL equivalent of the following...
# gradle
n
What is the Kotlin DSL equivalent of the following:
Copy code
jar {
    from configurations.compile.collect { zipTree it }
    manifest.attributes 'Main-Class': mainClassName
}
j
napperley: This is the similar syntax used to create a source jar.
Copy code
val sourceJarTask = task<Jar>("sourceJar") {
        from(the<JavaPluginConvention>().sourceSets["main"].allSource)
        classifier = "sources"
    }
👍 1
Not quite what you are asking for but it will get you headed in the right direction hopefully.
n
Is there something available for creating an executable JAR? Want to have a JAR created that includes the Kotlin runtime and everything in the Gradle classpath (dependencies).
d
Why not use application plugin?
Copy code
apply plugin: 'application'

sourceCompatibility = 1.8

mainClassName = "lt.saltyjuice.dragas.chatty.v3.birc.MainKt"
applicationDefaultJvmArgs = ["-Dfile.encoding=UTF-8"]
n
Tried using the application plugin however it seems to duplicate some files when creating the JAR. Used the third party shadow plugin instead to resolve the issue.