X-Git-Url: https://deadsoftware.ru/gitweb?p=cavedroid.git;a=blobdiff_plain;f=desktop%2Fbuild.gradle;h=b3a6693f285b98a686c56c8db34af36336b6be2c;hp=bd50a043363d17ad8d144c55a387eab4246e7e6e;hb=11736fceb90d618b4a473f8308a209f25ac7ab45;hpb=7b0664af188968ee28799a9c86f98cdb764ea76a diff --git a/desktop/build.gradle b/desktop/build.gradle index bd50a04..b3a6693 100644 --- a/desktop/build.gradle +++ b/desktop/build.gradle @@ -1,17 +1,27 @@ apply plugin: "java" -sourceCompatibility = 1.6 +sourceCompatibility = 1.8 sourceSets.main.java.srcDirs = [ "src/" ] +sourceSets.main.resources.srcDirs = ["../android/assets"] project.ext.mainClassName = "ru.deadsoftware.cavedroid.desktop.DesktopLauncher" -project.ext.assetsDir = new File("../android/assets"); +project.ext.assetsDir = new File("../android/assets") task run(dependsOn: classes, type: JavaExec) { main = project.mainClassName classpath = sourceSets.main.runtimeClasspath standardInput = System.in workingDir = project.assetsDir - ignoreExitValue = true + ignoreExitValue = true as JavaExecSpec +} + +task runTouch(dependsOn: classes, type: JavaExec) { + main = project.mainClassName + classpath = sourceSets.main.runtimeClasspath + standardInput = System.in + workingDir = project.assetsDir + ignoreExitValue = true as JavaExecSpec + args "--touch" } task debug(dependsOn: classes, type: JavaExec) { @@ -19,37 +29,19 @@ task debug(dependsOn: classes, type: JavaExec) { classpath = sourceSets.main.runtimeClasspath standardInput = System.in workingDir = project.assetsDir - ignoreExitValue = true + ignoreExitValue = true as JavaExecSpec debug = true } task dist(type: Jar) { - from files(sourceSets.main.output.classesDir) - from files(sourceSets.main.output.resourcesDir) - from {configurations.compile.collect {zipTree(it)}} - from files(project.assetsDir); - manifest { attributes 'Main-Class': project.mainClassName } -} - -dist.dependsOn classes - -eclipse { - project { - name = appName + "-desktop" - linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/android/assets' + from { + configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } } + with jar } -task afterEclipseImport(description: "Post processing after project generation", group: "IDE") { - doLast { - def classpath = new XmlParser().parse(file(".classpath")) - new Node(classpath, "classpathentry", [ kind: 'src', path: 'assets' ]); - def writer = new FileWriter(file(".classpath")) - def printer = new XmlNodePrinter(new PrintWriter(writer)) - printer.setPreserveWhitespace(true) - printer.print(classpath) - } -} + +dist.dependsOn classes \ No newline at end of file