1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-30 07:39:42 +02:00

Use git describe in About Dialog

- Replaced Commit Id by Version from GIT_DESCRIBE output
- Injected GIT_DESCRIBE macro at Version.cmake
- Removed timestamping from version description and cleaned its code

Resolve: #460

Signed-off-by: Humberto Rocha <humrochagf@gmail.com>
This commit is contained in:
Humberto Rocha 2021-08-12 10:56:15 -04:00 committed by Panagiotis Vasilopoulos
parent 20ee9a6c57
commit e0f34e7154
No known key found for this signature in database
GPG Key ID: FD806FDB3B2C5270
4 changed files with 9 additions and 22 deletions

View File

@ -4,7 +4,7 @@
execute_process( execute_process(
COMMAND COMMAND
${GIT} show -s "--format=#define REV_LONG \"%H\"%n#define REV_TIME \"%cd\"%n" --no-notes --no-show-signature ${GIT} show -s "--format=#define REV_LONG \"%H\"%n#define GIT_DESCRIBE \"${GIT_DESCRIBE}\"%n" --no-notes --no-show-signature
OUTPUT_FILE OUTPUT_FILE
${_PRVDIR}/RevisionIdent.h.in ${_PRVDIR}/RevisionIdent.h.in
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE

View File

@ -176,7 +176,7 @@ void AboutDialog::CreateInformationTab(ShuttleGui& AboutDialogGUI) {
<< XO("The Build") << XO("The Build")
<< wxT("</h3>\n<table>"); // start build info table << wxT("</h3>\n<table>"); // start build info table
AddBuildInfoRow(&informationStr, XO("Commit Id:"), BuildInfo::getRevisionIdentifier()); AddBuildInfoRow(&informationStr, XO("Version:"), BuildInfo::getRevisionIdentifier());
AddBuildInfoRow(&informationStr, XO("Build type:"), BuildInfo::getBuildType()); AddBuildInfoRow(&informationStr, XO("Build type:"), BuildInfo::getBuildType());
AddBuildInfoRow(&informationStr, XO("Compiler:"), BuildInfo::getCompilerVersionString()); AddBuildInfoRow(&informationStr, XO("Compiler:"), BuildInfo::getCompilerVersionString());
@ -862,15 +862,15 @@ void AboutDialog::GenerateTenacityPageDescription(wxTextOutputStream& tos) {
#undef _ #undef _
#define _(s) wxGetTranslation((s)) #define _(s) wxGetTranslation((s))
<< wxT("<h3>DarkTenacity ") << wxT("<h3>DarkTenacity ")
<< wxString(AUDACITY_VERSION_STRING) << wxString(GIT_DESCRIBE)
<< wxT("</h3>") << wxT("</h3>")
<< wxT("Customised version of the free, open source, cross-platform audio recorder and editor Tenacity.") << wxT("Customised version of the free, open source, cross-platform audio recorder and editor Tenacity.")
#else #else
<< XO("<h3>") << XO("<h3>")
<< ProgramName << ProgramName
// << wxT(" ") << wxT(" ")
// << wxString(AUDACITY_VERSION_STRING) << wxString(GIT_DESCRIBE)
<< wxT("</h3>") << wxT("</h3>")
/* i18n-hint: The program's name substitutes for %s */ /* i18n-hint: The program's name substitutes for %s */
<< XO("Free, open source, cross-platform audio recorder and editor.") << XO("Free, open source, cross-platform audio recorder and editor.")

View File

@ -17,7 +17,7 @@
#include <Internat.h> #include <Internat.h>
// RevisionIdent contains the REV_TIME and REV_LONG defines from git commit information // RevisionIdent contains the GIT_DESCRIBE and REV_LONG defines from git commit information
#include "RevisionIdent.h" #include "RevisionIdent.h"
// This define replaces the original that modified the macro in wxwidgets // This define replaces the original that modified the macro in wxwidgets
@ -88,29 +88,15 @@ public:
}; };
static const inline wxString getRevisionIdentifier(){ static const inline wxString getRevisionIdentifier(){
static wxString NoRevisionText = XO("No revision identifier was provided").Translation(); static wxString NoRevisionText = XO("No revision identifier was provided").Translation();
#ifdef REV_LONG #ifdef REV_LONG
return wxString( "[[https://github.com/tenacityteam/tenacity/commit/" ) + REV_LONG + "|" + wxString( REV_LONG ).Left(6) + "]] of " + getRevisionDateTime(); return wxString("[[https://github.com/tenacityteam/tenacity/commit/") + REV_LONG + "|" + wxString(GIT_DESCRIBE) + "]]";
#else #else
return NoRevisionText; return NoRevisionText;
#endif #endif
} }
static const inline wxString getRevisionDateTime(){
//This needs to be outside the #ifdef or it won't end up in the POT file consistently
static wxString NoDateTimeText = XO("Unknown date and time").Translation();
#ifdef REV_TIME
return wxString(REV_TIME);
#else
return NoDateTimeText;
#endif
}
static constexpr inline bool is64bits(){ static constexpr inline bool is64bits(){
return (sizeof(void*) == 8); return (sizeof(void*) == 8);
} }

View File

@ -22,6 +22,7 @@ if( GIT_FOUND )
version version
COMMAND COMMAND
${CMAKE_COMMAND} -D GIT="${GIT_EXECUTABLE}" ${CMAKE_COMMAND} -D GIT="${GIT_EXECUTABLE}"
-D GIT_DESCRIBE="${GIT_DESCRIBE}"
-D "_PRVDIR=${_PRVDIR}" -D "_PRVDIR=${_PRVDIR}"
-P "${AUDACITY_MODULE_PATH}/Version.cmake" -P "${AUDACITY_MODULE_PATH}/Version.cmake"
WORKING_DIRECTORY WORKING_DIRECTORY