mirror of
https://github.com/Retera/WarsmashModEngine.git
synced 2022-07-31 17:38:59 +02:00
43 lines
1.1 KiB
Groovy
43 lines
1.1 KiB
Groovy
|
apply plugin: "java"
|
||
|
|
||
|
sourceCompatibility = 1.7
|
||
|
sourceSets.main.java.srcDirs = [ "src/" ]
|
||
|
sourceSets.main.resources.srcDirs = [ "src/" ]
|
||
|
|
||
|
project.ext.mainClassName = "com.etheller.warsmash.bigserver.GamingNetworkServerMain"
|
||
|
|
||
|
task run(dependsOn: classes, type: JavaExec) {
|
||
|
main = project.mainClassName
|
||
|
classpath = sourceSets.main.runtimeClasspath
|
||
|
standardInput = System.in
|
||
|
ignoreExitValue = true
|
||
|
}
|
||
|
|
||
|
task dist(type: Jar) {
|
||
|
from files(sourceSets.main.output.classesDir)
|
||
|
from files(sourceSets.main.output.resourcesDir)
|
||
|
from {configurations.compile.collect {zipTree(it)}}
|
||
|
|
||
|
manifest {
|
||
|
attributes 'Main-Class': project.mainClassName
|
||
|
}
|
||
|
}
|
||
|
|
||
|
dist.dependsOn classes
|
||
|
|
||
|
eclipse {
|
||
|
project {
|
||
|
name = appName + "-server"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
task afterEclipseImport(description: "Post processing after project generation", group: "IDE") {
|
||
|
doLast {
|
||
|
def classpath = new XmlParser().parse(file(".classpath"))
|
||
|
def writer = new FileWriter(file(".classpath"))
|
||
|
def printer = new XmlNodePrinter(new PrintWriter(writer))
|
||
|
printer.setPreserveWhitespace(true)
|
||
|
printer.print(classpath)
|
||
|
}
|
||
|
}
|