Use single jar for release, no need for shell script

This commit is contained in:
Felix Ableitner 2016-09-19 05:30:57 +09:00
parent 1d8736931f
commit 69066c6744
2 changed files with 18 additions and 2 deletions

View file

@ -12,6 +12,22 @@ mainClassName = 'com.nutomic.ensichat.server.Main'
version = "0.4.0"
applicationName = 'ensichat-server'
jar {
archiveName "${applicationName}.jar"
manifest.attributes 'Main-Class': mainClassName
from(configurations.compile.collect { it.isDirectory() ? it : zipTree(it) })
}
task release(type: Zip) {
archiveName = "$applicationName-${version}.zip"
def baseDir = archiveName - '.zip'
into(baseDir) {
from(project.file('src/dist'))
into ('lib') { from ('build/libs/') }
}
}
release.dependsOn(jar)
run {
// Use this to pass command line arguments via `gradle run`.
//
@ -24,6 +40,6 @@ run {
// ./gradlew server:run -Pargs="--name,MyName,--status,My Status"
// ```
if (project.hasProperty('args')) {
args project.args.split("\\s+")
args project.args.split('\\s+')
}
}

View file

@ -5,7 +5,7 @@ After=network.target
[Service]
User=ensichat
Group=ensichat
ExecStart=/usr/bin/ensichat --name "" --status ""
ExecStart=/usr/bin/java -jar /usr/lib/ensichat.jar --name "unknown user" --status ""
WorkingDirectory=/var/lib/ensichat
RootDirectory=/var/lib/ensichat