Resolved #1757 - Can now see version when running from a desktop Jar

This commit is contained in:
Yair Morgenstern 2020-01-29 21:45:44 +02:00
parent 5e264a7e62
commit 267c98be55
4 changed files with 9 additions and 3 deletions

View file

@ -21,8 +21,8 @@ android {
applicationId "com.unciv.app"
minSdkVersion 14
targetSdkVersion 29
versionCode 369
versionName "3.5.7"
versionCode appCodeNumber
versionName appVersion
archivesBaseName = "Unciv"
}

View file

@ -33,6 +33,9 @@ allprojects {
version = '1.0.1'
ext {
appName = "Unciv"
appCodeNumber = 369
appVersion = "3.5.7"
gdxVersion = '1.9.10'
roboVMVersion = '2.3.1'
box2DLightsVersion = '1.4'

View file

@ -40,6 +40,7 @@ task dist(dependsOn: classes, type: Jar) { // Compiles the jar file
manifest {
attributes 'Main-Class': project.mainClassName
attributes 'Specification-Version': appVersion
}
}

View file

@ -27,7 +27,9 @@ internal object DesktopLauncher {
config.title = "Unciv"
config.useHDPI = true
val game = UncivGame("Desktop", null){exitProcess(0)}
val versionFromJar = DesktopLauncher.javaClass.`package`.specificationVersion
val game = UncivGame(if (versionFromJar != null) versionFromJar else "Desktop", null){exitProcess(0)}
if(!RaspberryPiDetector.isRaspberryPi()) // No discord RPC for Raspberry Pi, see https://github.com/yairm210/Unciv/issues/1624
tryActivateDiscord(game)