mirror of
https://github.com/Anuken/Mindustry.git
synced 2024-11-11 03:31:19 +03:00
87 lines
2.0 KiB
Groovy
87 lines
2.0 KiB
Groovy
sourceSets.main.java.srcDirs = ["src/"]
|
|
|
|
project.ext.mainClassName = "mindustry.server.ServerLauncher"
|
|
project.ext.assetsDir = new File("../core/assets")
|
|
|
|
ext.getServerFolder = {
|
|
return "../deploy/${appName}-server-${getVersionString()}"
|
|
}
|
|
|
|
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)
|
|
}
|
|
if(project.hasProperty("jvmArgs")){
|
|
jvmArgs((List<String>)Eval.me(project.getProperties()["jvmArgs"]))
|
|
}
|
|
}
|
|
|
|
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, dependsOn: configurations.runtimeClasspath){
|
|
from files(sourceSets.main.output.classesDirs)
|
|
from files(sourceSets.main.output.resourcesDir)
|
|
from {configurations.runtimeClasspath.collect{ it.isDirectory() ? it : zipTree(it) }}
|
|
from files(project.assetsDir)
|
|
exclude("sprites/**")
|
|
exclude("music/**")
|
|
exclude("sounds/**")
|
|
exclude("fonts/**")
|
|
exclude("zones/**")
|
|
exclude("icons/**")
|
|
exclude("bundles/**")
|
|
|
|
manifest{
|
|
attributes 'Main-Class': project.mainClassName
|
|
}
|
|
}
|
|
|
|
task dzip(type: Zip){
|
|
from getServerFolder()
|
|
archiveFileName = "${generateDeployName('server')}.zip"
|
|
destinationDirectory = file("../deploy/")
|
|
|
|
finalizedBy 'cleanup'
|
|
}
|
|
|
|
task cleanup{
|
|
doLast{
|
|
delete{
|
|
delete getServerFolder()
|
|
}
|
|
}
|
|
}
|
|
|
|
task deploy{
|
|
dependsOn "dist"
|
|
|
|
finalizedBy 'dzip'
|
|
|
|
doLast{
|
|
copy{
|
|
from "build/libs/server-release.jar"
|
|
into getServerFolder()
|
|
rename("server-release.jar", "server.jar")
|
|
}
|
|
|
|
copy{
|
|
from "server_template"
|
|
into getServerFolder()
|
|
}
|
|
}
|
|
}
|
|
|
|
dist.dependsOn classes
|