(Android) The versionCode is now included in the version printout on application startup

Also removed the v before the version name on all platforms
This commit is contained in:
Leon Styhre 2024-02-25 11:32:44 +01:00
parent dfefa74646
commit 89f65d092b
2 changed files with 11 additions and 3 deletions

View file

@ -283,6 +283,7 @@ endif()
if(ANDROID) if(ANDROID)
set(BUNDLED_CERTS ON) set(BUNDLED_CERTS ON)
add_compile_definitions(ANDROID_VERSION_CODE=${ANDROID_VERSION_CODE})
if(ANDROID_LITE_RELEASE) if(ANDROID_LITE_RELEASE)
add_compile_definitions(ANDROID_APPLICATION_ID="org.es_de.frontend.lite") add_compile_definitions(ANDROID_APPLICATION_ID="org.es_de.frontend.lite")
add_compile_definitions(ANDROID_LITE_RELEASE) add_compile_definitions(ANDROID_LITE_RELEASE)
@ -402,6 +403,7 @@ if(ANDROID)
else() else()
message(FATAL_ERROR "-- Unsupported Android ABI: " ${ANDROID_ABI}) message(FATAL_ERROR "-- Unsupported Android ABI: " ${ANDROID_ABI})
endif() endif()
message("-- Building with Android version code " ${ANDROID_VERSION_CODE})
if(ANDROID_LITE_RELEASE) if(ANDROID_LITE_RELEASE)
message("-- Building Lite release") message("-- Building Lite release")
else() else()

View file

@ -390,7 +390,7 @@ bool parseArguments(const std::vector<std::string>& arguments)
Log::setReportingLevel(LogDebug); Log::setReportingLevel(LogDebug);
} }
else if (arguments[i] == "--version" || arguments[i] == "-v") { else if (arguments[i] == "--version" || arguments[i] == "-v") {
std::cout << "ES-DE v" << PROGRAM_VERSION_STRING << " (r" << PROGRAM_RELEASE_NUMBER std::cout << "ES-DE " << PROGRAM_VERSION_STRING << " (r" << PROGRAM_RELEASE_NUMBER
<< ")\n"; << ")\n";
return false; return false;
} }
@ -679,8 +679,14 @@ int main(int argc, char* argv[])
#else #else
const std::string applicationName {"ES-DE"}; const std::string applicationName {"ES-DE"};
#endif #endif
LOG(LogInfo) << applicationName << " v" << PROGRAM_VERSION_STRING << " (r" #if defined(__ANDROID__)
LOG(LogInfo) << applicationName << " " << PROGRAM_VERSION_STRING << "-"
<< ANDROID_VERSION_CODE << " (r" << PROGRAM_RELEASE_NUMBER << "), built "
<< PROGRAM_BUILT_STRING;
#else
LOG(LogInfo) << applicationName << " " << PROGRAM_VERSION_STRING << " (r"
<< PROGRAM_RELEASE_NUMBER << "), built " << PROGRAM_BUILT_STRING; << PROGRAM_RELEASE_NUMBER << "), built " << PROGRAM_BUILT_STRING;
#endif
if (portableMode) { if (portableMode) {
LOG(LogInfo) << "Running in portable mode"; LOG(LogInfo) << "Running in portable mode";
Settings::getInstance()->setBool("PortableMode", true); Settings::getInstance()->setBool("PortableMode", true);
@ -972,7 +978,7 @@ int main(int argc, char* argv[])
.append(PROGRAM_BUILT_STRING); .append(PROGRAM_BUILT_STRING);
if (Utils::Platform::Android::checkNeedResourceCopy(buildIdentifier)) { if (Utils::Platform::Android::checkNeedResourceCopy(buildIdentifier)) {
LOG(LogInfo) << "Application has been updated or it's a new installation, copying " LOG(LogInfo) << "Application has been updated or it's a new installation, copying "
"bundled resources and themes to internal storage..."; "bundled resources and theme to internal storage...";
if (Settings::getInstance()->getBool("SplashScreen")) if (Settings::getInstance()->getBool("SplashScreen"))
window->renderSplashScreen(Window::SplashScreenState::RESOURCE_COPY, 0.0f); window->renderSplashScreen(Window::SplashScreenState::RESOURCE_COPY, 0.0f);
if (Utils::Platform::Android::setupResources(buildIdentifier)) { if (Utils::Platform::Android::setupResources(buildIdentifier)) {