From a021fc22a99df2b9e9c8f5c8ba4b0d7fec5888a9 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 16 Apr 2024 20:57:04 +0200 Subject: [PATCH] Moved ApplicationVersion.h from es-app to es-core --- es-app/CMakeLists.txt | 3 +- es-core/CMakeLists.txt | 3 +- {es-app => es-core}/src/ApplicationVersion.h | 8 +-- tools/update_version_string.sh | 60 ++++++++++---------- 4 files changed, 37 insertions(+), 37 deletions(-) rename {es-app => es-core}/src/ApplicationVersion.h (83%) diff --git a/es-app/CMakeLists.txt b/es-app/CMakeLists.txt index 34182dd65..97ba82224 100644 --- a/es-app/CMakeLists.txt +++ b/es-app/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT # -# ES-DE +# ES-DE Frontend # CMakeLists.txt (es-app) # # CMake configuration for es-app @@ -11,7 +11,6 @@ project(es-de) set(ES_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/ApplicationUpdater.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/ApplicationVersion.h ${CMAKE_CURRENT_SOURCE_DIR}/src/CollectionSystemsManager.h ${CMAKE_CURRENT_SOURCE_DIR}/src/FileData.h ${CMAKE_CURRENT_SOURCE_DIR}/src/FileFilterIndex.h diff --git a/es-core/CMakeLists.txt b/es-core/CMakeLists.txt index e4c387850..6222898fb 100644 --- a/es-core/CMakeLists.txt +++ b/es-core/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: MIT # -# ES-DE +# ES-DE Frontend # CMakeLists.txt (es-core) # # CMake configuration for es-core @@ -9,6 +9,7 @@ project(core) set(CORE_HEADERS + ${CMAKE_CURRENT_SOURCE_DIR}/src/ApplicationVersion.h ${CMAKE_CURRENT_SOURCE_DIR}/src/AsyncHandle.h ${CMAKE_CURRENT_SOURCE_DIR}/src/AudioManager.h ${CMAKE_CURRENT_SOURCE_DIR}/src/CECInput.h diff --git a/es-app/src/ApplicationVersion.h b/es-core/src/ApplicationVersion.h similarity index 83% rename from es-app/src/ApplicationVersion.h rename to es-core/src/ApplicationVersion.h index a8d3bc264..edc678005 100644 --- a/es-app/src/ApplicationVersion.h +++ b/es-core/src/ApplicationVersion.h @@ -1,11 +1,11 @@ // SPDX-License-Identifier: MIT // -// ES-DE +// ES-DE Frontend // ApplicationVersion.h // -#ifndef ES_APP_APPLICATION_VERSION_H -#define ES_APP_APPLICATION_VERSION_H +#ifndef ES_CORE_APPLICATION_VERSION_H +#define ES_CORE_APPLICATION_VERSION_H // These numbers and strings need to be manually updated for a new version. // Do this version number update as the very last commit for the new release version. @@ -22,4 +22,4 @@ #define RESOURCE_VERSION_STRING "3,0,1\0" #define RESOURCE_VERSION PROGRAM_VERSION_MAJOR, PROGRAM_VERSION_MINOR, PROGRAM_VERSION_MAINTENANCE -#endif // ES_APP_APPLICATION_VERSION_H +#endif // ES_CORE_APPLICATION_VERSION_H diff --git a/tools/update_version_string.sh b/tools/update_version_string.sh index e44278b22..fa4f89627 100755 --- a/tools/update_version_string.sh +++ b/tools/update_version_string.sh @@ -1,7 +1,7 @@ #!/usr/bin/bash # SPDX-License-Identifier: MIT # -# ES-DE +# ES-DE Frontend # update_version_string.sh # # Updates the version string for ES-DE. @@ -14,9 +14,9 @@ # # The following files are updated by this script: # es-app/CMakeLists.txt -# es-app/src/ApplicationVersion.h # es-app/assets/ES-DE.plist # es-app/assets/Windows_Portable_README.txt +# es-core/src/ApplicationVersion.h # # This script is only intended to be used on Linux systems. # @@ -50,9 +50,36 @@ NEWSTRING="set(ES_VERSION ${1}.${2}.${3}${SUFFIX})" cat $MODIFYFILE | sed s/"${MODIFYSTRING}"/"${NEWSTRING}"/ > $TEMPFILE mv $TEMPFILE $MODIFYFILE +##### ES-DE_Info.plist + +MODIFYFILE=../es-app/assets/ES-DE_Info.plist +MODIFYSTRING=$(grep "ES-DE " $MODIFYFILE) +OLDVERSION=$(echo $MODIFYSTRING | cut -f4 -d" " | sed s/".........$"//) +MODIFYSTRING=$(echo $MODIFYSTRING | sed s/".........$"//) +NEWSTRING="ES-DE ${1}.${2}.${3}" + +cat $MODIFYFILE | sed s/"${MODIFYSTRING}"/"${NEWSTRING}"/ > $TEMPFILE +mv $TEMPFILE $MODIFYFILE + +MODIFYSTRING=$(grep -m1 "${OLDVERSION}" $MODIFYFILE) +MODIFYSTRING=$(echo $MODIFYSTRING | sed s/".........$"//) +# Adding the suffix is not fully compliant with the Apple documentation but seems to be working. +# It's not used for the release builds anyway so it should hopefully not be an issue. +NEWSTRING="${1}.${2}.${3}${SUFFIX}" + +cat $MODIFYFILE | sed s/"${MODIFYSTRING}"/"${NEWSTRING}"/ > $TEMPFILE +mv $TEMPFILE $MODIFYFILE + +##### Windows_Portable_README.txt + +ROW_NUM=$(grep -n "ES-DE release:" ../es-app/assets/Windows_Portable_README.txt | cut -f1 -d:) +ROW_NUM=$((ROW_NUM+1)) +NEWSTRING=${1}.${2}.${3}${SUFFIX} +sed -i ${ROW_NUM}s/.*/$(echo $NEWSTRING | unix2dos)/ ../es-app/assets/Windows_Portable_README.txt + ##### ApplicationVersion.h -MODIFYFILE=../es-app/src/ApplicationVersion.h +MODIFYFILE=../es-core/src/ApplicationVersion.h MODIFYSTRING=$(grep "PROGRAM_VERSION_MAJOR " $MODIFYFILE) NEWSTRING="#define PROGRAM_VERSION_MAJOR ${1}" @@ -94,31 +121,4 @@ NEWSTRING=$(grep "PROGRAM_RELEASE_NUMBER" $MODIFYFILE | sed "s/$OLDRELEASE/$NEWR cat $MODIFYFILE | sed s/"${MODIFYSTRING}"/"${NEWSTRING}"/ > $TEMPFILE mv $TEMPFILE $MODIFYFILE -##### ES-DE_Info.plist - -MODIFYFILE=../es-app/assets/ES-DE_Info.plist -MODIFYSTRING=$(grep "ES-DE " $MODIFYFILE) -OLDVERSION=$(echo $MODIFYSTRING | cut -f4 -d" " | sed s/".........$"//) -MODIFYSTRING=$(echo $MODIFYSTRING | sed s/".........$"//) -NEWSTRING="ES-DE ${1}.${2}.${3}" - -cat $MODIFYFILE | sed s/"${MODIFYSTRING}"/"${NEWSTRING}"/ > $TEMPFILE -mv $TEMPFILE $MODIFYFILE - -MODIFYSTRING=$(grep -m1 "${OLDVERSION}" $MODIFYFILE) -MODIFYSTRING=$(echo $MODIFYSTRING | sed s/".........$"//) -# Adding the suffix is not fully compliant with the Apple documentation but seems to be working. -# It's not used for the release builds anyway so it should hopefully not be an issue. -NEWSTRING="${1}.${2}.${3}${SUFFIX}" - -cat $MODIFYFILE | sed s/"${MODIFYSTRING}"/"${NEWSTRING}"/ > $TEMPFILE -mv $TEMPFILE $MODIFYFILE - -##### Windows_Portable_README.txt - -ROW_NUM=$(grep -n "ES-DE release:" ../es-app/assets/Windows_Portable_README.txt | cut -f1 -d:) -ROW_NUM=$((ROW_NUM+1)) -NEWSTRING=${1}.${2}.${3}${SUFFIX} -sed -i ${ROW_NUM}s/.*/$(echo $NEWSTRING | unix2dos)/ ../es-app/assets/Windows_Portable_README.txt - echo "Done updating, don't forget to run generate_man_page.sh once the binary has been compiled with the new version string."