X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;ds=sidebyside;f=desktop%2Fbuild.gradle;h=912734500bc8b2c2b414039e17cc9ef830176306;hb=4a1f204c0cbe56e4c85f29f0d9f89ccd907f5f3b;hp=3436d706d7d6b68dda0a0bdfba095c7614331abe;hpb=fd73b6dd24b9fe55c0bc8f52f8aa1104a5fe3cb0;p=cavedroid.git diff --git a/desktop/build.gradle b/desktop/build.gradle index 3436d70..9127345 100644 --- a/desktop/build.gradle +++ b/desktop/build.gradle @@ -1,13 +1,19 @@ -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 @@ -16,7 +22,7 @@ task run(dependsOn: classes, type: JavaExec) { args "--debug" } -task runTouch(dependsOn: classes, type: JavaExec) { +task runTouch(dependsOn: build, type: JavaExec) { main = project.mainClassName classpath = sourceSets.main.runtimeClasspath standardInput = System.in @@ -25,25 +31,20 @@ task runTouch(dependsOn: classes, type: JavaExec) { 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" +}