diff --git a/desktop/build.gradle b/desktop/build.gradle
index 3436d706d7d6b68dda0a0bdfba095c7614331abe..912734500bc8b2c2b414039e17cc9ef830176306 100644 (file)
--- a/desktop/build.gradle
+++ b/desktop/build.gradle
-apply plugin: "kotlin"
+plugins {
+ id 'java-library'
+ id 'kotlin'
+ id 'org.jetbrains.kotlin.plugin.serialization' version "$kotlinVersion"
+}
+
+java.targetCompatibility = JavaVersion.VERSION_17
+java.sourceCompatibility = JavaVersion.VERSION_1_8
-sourceCompatibility = 17
-sourceSets.main.java.srcDirs = [ "src/" ]
+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")
-task run(dependsOn: classes, type: JavaExec) {
+task run(dependsOn: build, type: JavaExec) {
main = project.mainClassName
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
args "--debug"
}
-task runTouch(dependsOn: classes, type: JavaExec) {
+task runTouch(dependsOn: build, type: JavaExec) {
main = project.mainClassName
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
args "--touch", "--debug"
}
-task debug(dependsOn: classes, type: JavaExec) {
- main = project.mainClassName
- classpath = sourceSets.main.runtimeClasspath
- standardInput = System.in
- workingDir = project.assetsDir
- ignoreExitValue = true as JavaExecSpec
- debug = true
-}
-
-task dist(type: Jar) {
+task dist(dependsOn: build, type: Jar) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes 'Main-Class': project.mainClassName
}
from {
- configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
+ configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
with jar
}
-
-dist.dependsOn classes
\ No newline at end of file
+dependencies {
+ implementation project(":core")
+ implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinSerializationVersion"
+ api "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
+ api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
+}