Skip to content

Commit

Permalink
gradle: Add full fat jar build option
Browse files Browse the repository at this point in the history
  • Loading branch information
darktohka committed Mar 19, 2019
1 parent 7229019 commit 87eefe9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Expand Up @@ -32,3 +32,14 @@ dependencies {
}

I've also listed an example build.gradle with this repo.

# Compiling as JAR file
DemiBOT can also be compiled as a standalone JAR file.

However, if you decide to go this route, you will need to supply the ffmpeg, wget and nircmd binaries alongside the JAR file.

First, install [Gradle 5.2.1](https://gradle.org/next-steps/?version=5.2.1&format=bin) and add Gradle's bin folder into your PATH environment variable.

Then, run this command to build your JAR file: `gradle fatjar`

The artifacts can then be copied from the `build/libs` folder.
20 changes: 20 additions & 0 deletions build.gradle
Expand Up @@ -21,3 +21,23 @@ version '1.0-SNAPSHOT'
apply plugin: 'java'

sourceCompatibility = 1.8

jar {
manifest {
attributes("Manifest-Version": "1.0", "Main-Class": "pro.loonatic.demibot.Main");
}
}

task fatJar(type: Jar) {
manifest.from jar.manifest
classifier = 'all'
from {
configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) }
}
{
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
with jar
}

0 comments on commit 87eefe9

Please sign in to comment.