The last comment in https://github.com/johnrengelman/shadow/issues/138 has an example of defining multiple shadowJars. I've tried without success to come up with a version that worked in kotlin DSL. What should it look like?
My latest attempt (of several) is the following, but it doesn't work because I'm not allowed to instantiate tasks directly. (I am new to gradle, so probably I'm missing something conceptually.)
tasks {
val internal = ShadowJar()
internal.isZip64 = true
internal.archiveFileName.set("internal.jar")
internal.mergeServiceFiles()
internal.manifest {
attributes(mapOf("Main-Class" to "com.foo.InternalApplication"))
}
internal.minimize()
val external = ShadowJar()
external.isZip64 = true
external.archiveFileName.set("external.jar")
external.mergeServiceFiles()
external.manifest {
attributes(mapOf("Main-Class" to "com.foo.ExternalApplication"))
}
external.minimize()
}
tasks {
val internal by existing
val external by existing
"build" {
dependsOn(internal)
dependsOn(external)
}
}