DEADSOFTWARE

Add module code gen
[cavedroid.git] / desktop / build.gradle
1 plugins {
2 id 'java-library'
3 id 'kotlin'
4 id 'org.jetbrains.kotlin.plugin.serialization' version "$kotlinVersion"
5 }
7 java.targetCompatibility = JavaVersion.VERSION_17
8 java.sourceCompatibility = JavaVersion.VERSION_1_8
10 sourceSets.main.java.srcDirs = ["src/"]
11 sourceSets.main.resources.srcDirs = ["../android/assets"]
13 project.ext.mainClassName = "ru.deadsoftware.cavedroid.desktop.DesktopLauncher"
14 project.ext.assetsDir = new File("../android/assets")
16 task run(dependsOn: classes, type: JavaExec) {
17 main = project.mainClassName
18 classpath = sourceSets.main.runtimeClasspath
19 standardInput = System.in
20 workingDir = project.assetsDir
21 ignoreExitValue = true as JavaExecSpec
22 args "--debug"
23 }
25 task runTouch(dependsOn: classes, type: JavaExec) {
26 main = project.mainClassName
27 classpath = sourceSets.main.runtimeClasspath
28 standardInput = System.in
29 workingDir = project.assetsDir
30 ignoreExitValue = true as JavaExecSpec
31 args "--touch", "--debug"
32 }
34 task debug(dependsOn: classes, type: JavaExec) {
35 main = project.mainClassName
36 classpath = sourceSets.main.runtimeClasspath
37 standardInput = System.in
38 workingDir = project.assetsDir
39 ignoreExitValue = true as JavaExecSpec
40 debug = true
41 }
43 task dist(type: Jar) {
44 duplicatesStrategy = DuplicatesStrategy.EXCLUDE
45 manifest {
46 attributes 'Main-Class': project.mainClassName
47 }
48 from {
49 configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
50 }
51 with jar
52 }
54 dist.dependsOn classes
56 dependencies {
57 implementation project(":core")
58 implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinSerializationVersion"
59 api "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
60 api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
61 }