apply plugin: "java" [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' sourceCompatibility = targetCompatibility = appJavaCompatibility sourceSets.main.resources.srcDirs = [new File(project(':core').projectDir, "/src/main/assets"), new File(project(':desktop').projectDir,"/src/main/assets")] sourceSets { debug release } task debug(dependsOn: classes, type: JavaExec) { classpath = sourceSets.debug.runtimeClasspath + sourceSets.main.runtimeClasspath ignoreExitValue = true mainClass = "com.shatteredpixel.shatteredpixeldungeon.desktop.DesktopLauncher" systemProperty 'Specification-Title', appName systemProperty 'Specification-Version', appVersionName + "-INDEV" systemProperty 'Implementation-Version', appVersionCode dependencies { debugImplementation project(':services:updates:debugUpdates') } } //need a separate task to compile dependencies first, seeing as we're setting them up in an odd way task compileForRelease(dependsOn: classes, type: JavaCompile){ classpath = sourceSets.release.runtimeClasspath + sourceSets.main.runtimeClasspath } task release(dependsOn: compileForRelease, type: Jar) { from sourceSets.main.output from { sourceSets.release.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) } } from { configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) } } manifest { attributes 'Main-Class': "com.shatteredpixel.shatteredpixeldungeon.desktop.DesktopLauncher" attributes 'Specification-Title': appName attributes 'Specification-Version': appVersionName attributes 'Implementation-Version': appVersionCode } dependencies { releaseImplementation project(':services:updates:githubUpdates') } } dependencies { implementation project(':core') implementation "com.badlogicgames.gdx:gdx-freetype:$gdxVersion" implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion" implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop" //we use LWJGL tinyFD directly to display crash messages and (for now) single-line text input implementation "org.lwjgl:lwjgl-tinyfd:3.2.1" implementation "org.lwjgl:lwjgl-tinyfd:3.2.1:natives-windows" implementation "org.lwjgl:lwjgl-tinyfd:3.2.1:natives-macos" implementation "org.lwjgl:lwjgl-tinyfd:3.2.1:natives-linux" //Need these at compile time to prevent errors there. // The actual dependency used at runtime will vary based on source set. compileOnly project(':services:updates:debugUpdates') }