v0.8.0: improved desktop debugRun task, version info is now dynamic

This commit is contained in:
Evan Debenham
2019-10-27 18:50:44 -04:00
parent 7ae14f9142
commit b3d4515b32
2 changed files with 25 additions and 23 deletions

View File

@@ -3,14 +3,18 @@ apply plugin: "java"
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
sourceCompatibility = targetCompatibility = appJavaCompatibility
ext.mainClass = "com.shatteredpixel.shatteredpixeldungeon.desktop.DesktopLauncher"
sourceSets.main.resources.srcDirs = [new File(project(':core').projectDir, "/src/main/assets"),
new File(project(':desktop').projectDir,"/src/main/assets")]
task runDebug(dependsOn: classes, type: JavaExec) {
main = "com.shatteredpixel.shatteredpixeldungeon.desktop.DesktopLauncher"
classpath = sourceSets.main.runtimeClasspath
ignoreExitValue = true
main = mainClass
systemProperty 'Specification-Name', appName
systemProperty 'Specification-Version', appVersionName + "-INDEV"
systemProperty 'Implementation-Version', appVersionCode
}
task releaseJAR(dependsOn: classes, type: Jar) {
@@ -18,7 +22,7 @@ task releaseJAR(dependsOn: classes, type: Jar) {
from { configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) } }
manifest {
attributes 'Main-Class': "com.shatteredpixel.shatteredpixeldungeon.desktop.DesktopLauncher"
attributes 'Main-Class': mainClass
attributes 'Specification-Name': appName
attributes 'Specification-Version': appVersionName
attributes 'Implementation-Version': appVersionCode