X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=desktop%2Fbuild.gradle;h=f909ef108038f25ce939a04c8e745a2784fa193a;hb=3a443514027417133d7a7e18766720dfea028a87;hp=88ef144f460626ead46e01f094e94219b2fd352a;hpb=e52c9c04fb2d016a9178a038a6027c4cf3b9387f;p=cavedroid.git diff --git a/desktop/build.gradle b/desktop/build.gradle index 88ef144..f909ef1 100644 --- a/desktop/build.gradle +++ b/desktop/build.gradle @@ -1,48 +1,50 @@ -apply plugin: "kotlin" +plugins { + id 'java-library' + id 'kotlin' + id 'org.jetbrains.kotlin.plugin.serialization' version "$kotlinVersion" +} -sourceCompatibility = 11 -sourceSets.main.java.srcDirs = [ "src/" ] -sourceSets.main.resources.srcDirs = ["../android/assets"] +java.targetCompatibility = JavaVersion.VERSION_17 +java.sourceCompatibility = JavaVersion.VERSION_1_8 -project.ext.mainClassName = "ru.deadsoftware.cavedroid.desktop.DesktopLauncher" -project.ext.assetsDir = new File("../android/assets") +sourceSets.main.java.srcDirs = ["src/"] +sourceSets.main.resources.srcDirs = ["assets/"] -task run(dependsOn: classes, type: JavaExec) { - main = project.mainClassName - classpath = sourceSets.main.runtimeClasspath - standardInput = System.in - workingDir = project.assetsDir - ignoreExitValue = true as JavaExecSpec -} +project.ext.mainClassName = "ru.deadsoftware.cavedroid.desktop.DesktopLauncher" +project.ext.assetsDir = new File("assets/") -task runTouch(dependsOn: classes, type: JavaExec) { +task run(dependsOn: build, type: JavaExec) { main = project.mainClassName classpath = sourceSets.main.runtimeClasspath standardInput = System.in workingDir = project.assetsDir ignoreExitValue = true as JavaExecSpec - args "--touch" + args "--debug" } -task debug(dependsOn: classes, type: JavaExec) { +task runTouch(dependsOn: build, type: JavaExec) { main = project.mainClassName classpath = sourceSets.main.runtimeClasspath standardInput = System.in workingDir = project.assetsDir ignoreExitValue = true as JavaExecSpec - debug = true + args "--touch", "--debug" } -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" +}