-tasks.withType<JavaExec> {
- val appArgs: String? by project
- if (appArgs != null) {
- // allow passing command-line arguments to the main application e.g.:
- // $ gradle run -PappArgs="['-u', '+...', 'daemon', '--json']"
- args = groovy.util.Eval.me(appArgs) as MutableList<String>
- }
+task("fatJar", type = Jar::class) {
+ archiveBaseName.set("${project.name}-fat")
+ exclude(
+ "META-INF/*.SF",
+ "META-INF/*.DSA",
+ "META-INF/*.RSA",
+ "META-INF/NOTICE",
+ "META-INF/LICENSE",
+ "**/module-info.class"
+ )
+ from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
+ with(tasks.jar.get() as CopySpec)