From b3b96edeee7a378e9e706e5d32c9e87ef2fac3be Mon Sep 17 00:00:00 2001 From: David Fialho Date: Fri, 1 Sep 2017 14:59:52 +0100 Subject: [PATCH] Specify manifest in gradle's jar task --- build.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build.gradle b/build.gradle index f4750df..ccbe582 100644 --- a/build.gradle +++ b/build.gradle @@ -74,4 +74,15 @@ task enabledMockingFinalClasses << { mockMakerFile.parentFile.mkdirs() mockMakerFile.createNewFile() mockMakerFile.write("mock-maker-inline") +} + +jar { + manifest { + attributes 'Main-Class': 'main.MainKt' + } + + // This line of code recursively collects and copies all of a project's files + // and adds them to the JAR itself. One can extend this task, to skip certain + // files or particular types at will + from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } } \ No newline at end of file