mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-03-14 03:49:19 +07:00
Implemented gradle application plugin into :server:bncs
This commit is contained in:
parent
9c928bc559
commit
1b138e29fa
@ -1,22 +1,32 @@
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
|
apply plugin: 'application'
|
||||||
|
|
||||||
import org.apache.tools.ant.taskdefs.condition.Os
|
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
||||||
|
|
||||||
project.ext.mainClassName = 'com.riiablo.server.bncs.Main'
|
application {
|
||||||
|
mainClass = 'com.riiablo.server.bncs.Main'
|
||||||
task run(dependsOn: classes, type: JavaExec) {
|
|
||||||
main = project.mainClassName
|
|
||||||
classpath = sourceSets.main.runtimeClasspath
|
|
||||||
standardInput = System.in
|
|
||||||
ignoreExitValue = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
task dist(dependsOn: classes, type: Jar) {
|
run {
|
||||||
from files(sourceSets.main.output.classesDirs)
|
setStandardInput(System.in)
|
||||||
from files(sourceSets.main.output.resourcesDir)
|
setIgnoreExitValue(true)
|
||||||
from {configurations.compile.collect {zipTree(it)}}
|
}
|
||||||
|
|
||||||
manifest {
|
jar {
|
||||||
attributes 'Main-Class': project.mainClassName
|
archiveBaseName = project.name
|
||||||
}
|
// These can be excluded because they add to the jar size but libGDX 1.9.11 can't use them.
|
||||||
|
// If your libGDX version is 1.9.10 or earlier, or is 1.9.12-SNAPSHOT or later, you can leave
|
||||||
|
// the following line commented; if you use 1.9.11 exactly, or if you use 1.9.12-SNAPSHOT but
|
||||||
|
// don't need ARM Linux support, you can uncomment it safely.
|
||||||
|
// It's always safe to keep that line commented out; it only affects JAR size.
|
||||||
|
// exclude('linux/arm32/**', 'linux/arm64/**')
|
||||||
|
dependsOn configurations.runtimeClasspath
|
||||||
|
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
|
||||||
|
manifest {
|
||||||
|
attributes 'Main-Class': application.mainClass
|
||||||
|
}
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
file(archivePath).setExecutable(true, false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user