2018-01-28 11:42:42 +07:00
|
|
|
apply plugin: "java"
|
|
|
|
|
|
|
|
sourceCompatibility = 1.8
|
|
|
|
sourceSets.main.java.srcDirs = [ "src/" ]
|
|
|
|
|
|
|
|
project.ext.mainClassName = "io.anuke.mindustry.server.ServerLauncher"
|
2018-10-06 22:56:39 +07:00
|
|
|
project.ext.assetsDir = new File("../core/assets")
|
2018-01-28 11:42:42 +07:00
|
|
|
|
|
|
|
task run(dependsOn: classes, type: JavaExec) {
|
|
|
|
main = project.mainClassName
|
|
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
|
|
standardInput = System.in
|
|
|
|
workingDir = project.assetsDir
|
|
|
|
ignoreExitValue = true
|
|
|
|
if (project.hasProperty("appArgs")) {
|
|
|
|
args Eval.me(appArgs)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task debug(dependsOn: classes, type: JavaExec) {
|
|
|
|
main = project.mainClassName
|
|
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
|
|
standardInput = System.in
|
|
|
|
workingDir = project.assetsDir
|
|
|
|
ignoreExitValue = true
|
|
|
|
debug = true
|
|
|
|
}
|
|
|
|
|
|
|
|
task dist(type: Jar) {
|
2018-02-02 10:16:00 +07:00
|
|
|
from files(sourceSets.main.output.classesDirs)
|
2018-01-28 11:42:42 +07:00
|
|
|
from files(sourceSets.main.output.resourcesDir)
|
|
|
|
from {configurations.compile.collect {zipTree(it)}}
|
2018-10-06 22:56:39 +07:00
|
|
|
from files(project.assetsDir)
|
2019-03-10 07:12:54 +07:00
|
|
|
exclude("sprites/**")
|
|
|
|
exclude("fonts/**")
|
|
|
|
exclude("com/badlogic/gdx/**")
|
|
|
|
exclude("bundles/**")
|
2018-05-04 00:04:30 +07:00
|
|
|
|
|
|
|
writeVersion()
|
2018-01-28 11:42:42 +07:00
|
|
|
|
|
|
|
manifest {
|
|
|
|
attributes 'Main-Class': project.mainClassName
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-29 23:26:31 +07:00
|
|
|
task deploy(type: Copy){
|
|
|
|
dependsOn "dist"
|
|
|
|
|
|
|
|
from "build/libs/server-release.jar"
|
2018-10-06 22:56:39 +07:00
|
|
|
into "../deploy/"
|
|
|
|
rename ("server-release.jar", appName + "-server-" + getVersionString() + ".jar")
|
2018-01-29 23:26:31 +07:00
|
|
|
}
|
|
|
|
|
2018-01-28 11:42:42 +07:00
|
|
|
dist.dependsOn classes
|