DEADSOFTWARE

Rename Items -> GameItems
[cavedroid.git] / desktop / build.gradle
1 apply plugin: "java"
3 sourceCompatibility = 1.6
4 sourceSets.main.java.srcDirs = [ "src/" ]
6 project.ext.mainClassName = "ru.deadsoftware.cavecraft.desktop.DesktopLauncher"
7 project.ext.assetsDir = new File("../android/assets");
9 task run(dependsOn: classes, type: JavaExec) {
10 main = project.mainClassName
11 classpath = sourceSets.main.runtimeClasspath
12 standardInput = System.in
13 workingDir = project.assetsDir
14 ignoreExitValue = true
15 }
17 task debug(dependsOn: classes, type: JavaExec) {
18 main = project.mainClassName
19 classpath = sourceSets.main.runtimeClasspath
20 standardInput = System.in
21 workingDir = project.assetsDir
22 ignoreExitValue = true
23 debug = true
24 }
26 task dist(type: Jar) {
27 from files(sourceSets.main.output.classesDir)
28 from files(sourceSets.main.output.resourcesDir)
29 from {configurations.compile.collect {zipTree(it)}}
30 from files(project.assetsDir);
32 manifest {
33 attributes 'Main-Class': project.mainClassName
34 }
35 }
37 dist.dependsOn classes
39 eclipse {
40 project {
41 name = appName + "-desktop"
42 linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/android/assets'
43 }
44 }
46 task afterEclipseImport(description: "Post processing after project generation", group: "IDE") {
47 doLast {
48 def classpath = new XmlParser().parse(file(".classpath"))
49 new Node(classpath, "classpathentry", [ kind: 'src', path: 'assets' ]);
50 def writer = new FileWriter(file(".classpath"))
51 def printer = new XmlNodePrinter(new PrintWriter(writer))
52 printer.setPreserveWhitespace(true)
53 printer.print(classpath)
54 }
55 }