summaryrefslogtreecommitdiffstats
path: root/desktop
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2018-06-26 02:06:32 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2018-06-26 02:06:32 +0200
commitccbec710375ddab05e60d893851e57f7ee743d19 (patch)
treed22eb9f39093e4a15113b4f29ff7eaf8f4562cfb /desktop
downloadgdx-boardgame-ccbec710375ddab05e60d893851e57f7ee743d19.zip
gdx-boardgame-ccbec710375ddab05e60d893851e57f7ee743d19.tar.gz
bare bone libgdx project
generated with https://libgdx.badlogicgames.com/nightlies/dist/gdx-setup.jar
Diffstat (limited to 'desktop')
-rw-r--r--desktop/build.gradle60
-rw-r--r--desktop/src/ch/asynk/zproject/desktop/DesktopLauncher.java12
2 files changed, 72 insertions, 0 deletions
diff --git a/desktop/build.gradle b/desktop/build.gradle
new file mode 100644
index 0000000..ddc39d7
--- /dev/null
+++ b/desktop/build.gradle
@@ -0,0 +1,60 @@
+import org.apache.tools.ant.taskdefs.condition.Os
+
+apply plugin: "java"
+
+sourceCompatibility = 1.6
+sourceSets.main.java.srcDirs = [ "src/" ]
+
+project.ext.mainClassName = "ch.asynk.zproject.desktop.DesktopLauncher"
+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
+
+ if(Os.isFamily(Os.FAMILY_MAC))
+ jvmArgs += "-XstartOnFirstThread"
+}
+
+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) {
+ 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'
+ }
+}
+
+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)
+ }
+}
diff --git a/desktop/src/ch/asynk/zproject/desktop/DesktopLauncher.java b/desktop/src/ch/asynk/zproject/desktop/DesktopLauncher.java
new file mode 100644
index 0000000..c6a3885
--- /dev/null
+++ b/desktop/src/ch/asynk/zproject/desktop/DesktopLauncher.java
@@ -0,0 +1,12 @@
+package ch.asynk.zproject.desktop;
+
+import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
+import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
+import ch.asynk.zproject.ZProject;
+
+public class DesktopLauncher {
+ public static void main (String[] arg) {
+ LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
+ new LwjglApplication(new ZProject(), config);
+ }
+}