1 apply plugin: "kotlin"
3 sourceCompatibility = 17
4 sourceSets.main.java.srcDirs = [ "src/" ]
5 sourceSets.main.resources.srcDirs = ["../android/assets"]
7 project.ext.mainClassName = "ru.deadsoftware.cavedroid.desktop.DesktopLauncher"
8 project.ext.assetsDir = new File("../android/assets")
10 task run(dependsOn: classes, type: JavaExec) {
11 main = project.mainClassName
12 classpath = sourceSets.main.runtimeClasspath
13 standardInput = System.in
14 workingDir = project.assetsDir
15 ignoreExitValue = true as JavaExecSpec
16 args "--debug"
17 }
19 task runTouch(dependsOn: classes, type: JavaExec) {
20 main = project.mainClassName
21 classpath = sourceSets.main.runtimeClasspath
22 standardInput = System.in
23 workingDir = project.assetsDir
24 ignoreExitValue = true as JavaExecSpec
25 args "--touch --debug"
26 }
28 task debug(dependsOn: classes, type: JavaExec) {
29 main = project.mainClassName
30 classpath = sourceSets.main.runtimeClasspath
31 standardInput = System.in
32 workingDir = project.assetsDir
33 ignoreExitValue = true as JavaExecSpec
34 debug = true
35 }
37 task dist(type: Jar) {
38 duplicatesStrategy = DuplicatesStrategy.EXCLUDE
39 manifest {
40 attributes 'Main-Class': project.mainClassName
41 }
42 from {
43 configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
44 }
45 with jar
46 }
49 dist.dependsOn classes