2019-10-23 01:39:57 +00:00
|
|
|
apply plugin: "java"
|
|
|
|
|
|
|
|
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
2019-10-26 17:21:05 +00:00
|
|
|
sourceCompatibility = targetCompatibility = appJavaCompatibility
|
|
|
|
|
2020-05-29 01:33:39 +00:00
|
|
|
ext.appMainClass = "com.shatteredpixel.shatteredpixeldungeon.desktop.DesktopLauncher"
|
2019-10-26 17:21:05 +00:00
|
|
|
sourceSets.main.resources.srcDirs = [new File(project(':core').projectDir, "/src/main/assets"),
|
|
|
|
new File(project(':desktop').projectDir,"/src/main/assets")]
|
2019-10-23 01:39:57 +00:00
|
|
|
|
2019-11-22 20:02:42 +00:00
|
|
|
sourceSets {
|
|
|
|
debug
|
|
|
|
release
|
|
|
|
}
|
|
|
|
|
|
|
|
task debug(dependsOn: classes, type: JavaExec) {
|
|
|
|
classpath = sourceSets.debug.runtimeClasspath + sourceSets.main.runtimeClasspath
|
2019-10-23 01:39:57 +00:00
|
|
|
ignoreExitValue = true
|
2019-10-27 22:50:44 +00:00
|
|
|
|
2020-05-29 01:33:39 +00:00
|
|
|
main = appMainClass
|
2019-10-28 04:34:24 +00:00
|
|
|
systemProperty 'Specification-Title', appName
|
2019-10-27 22:50:44 +00:00
|
|
|
systemProperty 'Specification-Version', appVersionName + "-INDEV"
|
|
|
|
systemProperty 'Implementation-Version', appVersionCode
|
2019-11-22 20:05:47 +00:00
|
|
|
|
|
|
|
dependencies {
|
|
|
|
debugImplementation project(':services:updates:debugUpdates')
|
2020-07-03 23:17:54 +00:00
|
|
|
debugImplementation project(':services:news:debugNews')
|
2019-11-22 20:05:47 +00:00
|
|
|
}
|
2019-10-23 01:39:57 +00:00
|
|
|
}
|
|
|
|
|
2019-11-22 20:02:42 +00:00
|
|
|
//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) {
|
2019-10-23 17:42:43 +00:00
|
|
|
from sourceSets.main.output
|
2019-11-22 20:02:42 +00:00
|
|
|
from { sourceSets.release.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) } }
|
2019-10-23 17:42:43 +00:00
|
|
|
from { configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) } }
|
|
|
|
|
|
|
|
manifest {
|
2020-05-29 01:33:39 +00:00
|
|
|
attributes 'Main-Class': appMainClass
|
2019-10-28 04:34:24 +00:00
|
|
|
attributes 'Specification-Title': appName
|
2019-10-23 17:42:43 +00:00
|
|
|
attributes 'Specification-Version': appVersionName
|
|
|
|
attributes 'Implementation-Version': appVersionCode
|
|
|
|
}
|
2019-11-22 20:05:47 +00:00
|
|
|
|
|
|
|
dependencies {
|
|
|
|
releaseImplementation project(':services:updates:githubUpdates')
|
2020-07-03 23:17:54 +00:00
|
|
|
releaseImplementation project(':services:news:shatteredNews')
|
2019-11-22 20:05:47 +00:00
|
|
|
}
|
2019-10-23 17:42:43 +00:00
|
|
|
}
|
2019-10-23 01:39:57 +00:00
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation project(':core')
|
|
|
|
|
|
|
|
implementation "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
|
2019-10-29 00:58:29 +00:00
|
|
|
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
|
2019-10-23 01:39:57 +00:00
|
|
|
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
|
|
|
implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
|
2019-11-22 20:05:47 +00:00
|
|
|
|
2019-12-05 04:15:27 +00:00
|
|
|
//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"
|
|
|
|
|
2019-11-22 20:05:47 +00:00
|
|
|
//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')
|
2020-07-03 23:17:54 +00:00
|
|
|
compileOnly project(':services:news:debugNews')
|
2019-10-23 01:39:57 +00:00
|
|
|
}
|