Created
March 19, 2021 22:33
-
-
Save ilyavoronin/9b98585fff7ff56ac379d6e40c751163 to your computer and use it in GitHub Desktop.
Multiple fat jars in gradle(kotlin dsl)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tasks { | |
task("buildClient", type=Jar::class) { | |
archiveFileName.set("client.jar") | |
manifest { | |
attributes(mapOf("Main-Class" to "RunClientKt")) | |
} | |
isZip64 = true | |
from (project.configurations.runtimeClasspath.get().map {if (it.isDirectory) it else zipTree(it) }) | |
with(getByName("jar") as CopySpec) | |
} | |
task("buildServer", type=Jar::class) { | |
archiveFileName.set("server.jar") | |
manifest { | |
attributes(mapOf("Main-Class" to "RunServerKt")) | |
} | |
isZip64 = true | |
from (project.configurations.runtimeClasspath.get().map {if (it.isDirectory) it else zipTree(it) }) | |
with(getByName("jar") as CopySpec) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment