What is the Kotlin DSL equivalent of the following:
Copy code
jar {
from configurations.compile.collect { zipTree it }
manifest.attributes 'Main-Class': mainClassName
}
j
jlleitschuh
06/28/2017, 1:54 PM
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
jlleitschuh
06/28/2017, 1:54 PM
Not quite what you are asking for but it will get you headed in the right direction hopefully.
n
napperley
06/28/2017, 11:00 PM
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).
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.