summaryrefslogtreecommitdiff
path: root/desktop/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/build.gradle')
-rw-r--r--desktop/build.gradle47
1 files changed, 47 insertions, 0 deletions
diff --git a/desktop/build.gradle b/desktop/build.gradle
new file mode 100644
index 0000000..9e8a4a8
--- /dev/null
+++ b/desktop/build.gradle
@@ -0,0 +1,47 @@
+sourceCompatibility = 1.8
+sourceSets.main.java.srcDirs = [ "src/" ]
+sourceSets.main.resources.srcDirs = ["../assets"]
+
+project.ext.mainClassName = "com.ilotterytea.maxoning.DesktopLauncher"
+project.ext.assetsDir = new File("../assets")
+
+import org.gradle.internal.os.OperatingSystem
+
+task run(dependsOn: classes, type: JavaExec) {
+ main = project.mainClassName
+ classpath = sourceSets.main.runtimeClasspath
+ standardInput = System.in
+ workingDir = project.assetsDir
+ ignoreExitValue = true
+
+ if (OperatingSystem.current() == OperatingSystem.MAC_OS) {
+ // Required to run on macOS
+ 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) {
+ duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
+ manifest {
+ attributes 'Main-Class': project.mainClassName
+ }
+ dependsOn configurations.runtimeClasspath
+ from {
+ configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
+ }
+ with jar
+}
+
+
+dist.dependsOn classes
+
+eclipse.project.name = appName + "-desktop"