Skip to content

Commit

Permalink
Specify manifest in gradle's jar task
Browse files Browse the repository at this point in the history
  • Loading branch information
David Fialho committed Sep 1, 2017
1 parent 0448b2f commit b3b96ed
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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) } }
}

0 comments on commit b3b96ed

Please sign in to comment.