Browse Source
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>
pull/465/head
Humberto Rocha
2 years ago
committed by
Panagiotis Vasilopoulos
No known key found for this signature in database
GPG Key ID: FD806FDB3B2C5270
4 changed files with
9 additions and
22 deletions
cmake-proxies/cmake-modules/Version.cmake
src/AboutDialog.cpp
src/BuildInfo.h
src/CMakeLists.txt
@ -4,7 +4,7 @@
execute_process (
C O M M A N D
$ { G I T } s h o w - s " - - f o r m a t = # d e f i n e R E V _ L O N G \ " % H \ " % n # d e f i n e R E V _ T I M E \ " % c d \ " % n " - - n o - n o t e s - - n o - s h o w - s i g n a t u r e
$ { G I T } s h o w - s " - - f o r m a t = # d e f i n e R E V _ L O N G \ " % H \ " % n # d e f i n e G I T _ D E S C R I B E \ " $ { G I T _ D E S C R I B E } \ " % n " - - n o - n o t e s - - n o - s h o w - s i g n a t u r e
O U T P U T _ F I L E
$ { _ P R V D I R } / R e v i s i o n I d e n t . h . i n
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E
@ -176,7 +176,7 @@ void AboutDialog::CreateInformationTab(ShuttleGui& AboutDialogGUI) {
< < XO ( " The Build " )
< < 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 ( " Compiler: " ) , BuildInfo : : getCompilerVersionString ( ) ) ;
@ -862,15 +862,15 @@ void AboutDialog::GenerateTenacityPageDescription(wxTextOutputStream& tos) {
# undef _
# define _(s) wxGetTranslation((s))
< < wxT ( " <h3>DarkTenacity " )
< < wxString ( AUDACITY_VERSION_STRING )
< < wxString ( GIT_DESCRIBE )
< < wxT ( " </h3> " )
< < wxT ( " Customised version of the free, open source, cross-platform audio recorder and editor Tenacity. " )
# else
< < XO ( " <h3> " )
< < ProgramName
// << wxT(" ")
// << wxString(AUDACITY_VERSION_STRING)
< < wxT ( " " )
< < wxString ( GIT_DESCRIBE )
< < wxT ( " </h3> " )
/* i18n-hint: The program's name substitutes for %s */
< < XO ( " Free, open source, cross-platform audio recorder and editor. " )
@ -17,14 +17,14 @@
# include <Internat.h>
/ / RevisionIdent contains the REV_TIM E and REV_LONG defines from git commit information
/ / RevisionIdent contains the GIT_DESCRIB E and REV_LONG defines from git commit information
# include "RevisionIdent.h"
/ / This define replaces the original that modified the macro in wxwidgets
# define CUSTOM_wxMAKE_VERSION_DOT_STRING_T(x, y, z) wxSTRINGIZE_T(x) wxT(".") wxSTRINGIZE_T(y) wxT(".") wxSTRINGIZE_T(z) wxT("(Tenacity)")
class BuildInfo {
public :
enum class CompilerType { MSVC , MinGW , GCC , Clang , Unknown } ;
@ -88,29 +88,15 @@ public:
} ;
static const inline wxString getRevisionIdentifier ( ) {
static wxString NoRevisionText = XO ( " No revision identifier was provided " ) . Translation ( ) ;
# 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_DESC RIB E) + " ]] " ;
# else
return NoRevisionText ;
# 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 ( ) {
return ( sizeof ( void * ) = = 8 ) ;
}
@ -22,6 +22,7 @@ if( GIT_FOUND )
v e r s i o n
C O M M A N D
$ { C M A K E _ C O M M A N D } - D G I T = " $ { G I T _ E X E C U T A B L E } "
- D G I T _ D E S C R I B E = " $ { G I T _ D E S C R I B E } "
- D " _ P R V D I R = $ { _ P R V D I R } "
- P " $ { A U D A C I T Y _ M O D U L E _ P A T H } / V e r s i o n . c m a k e "
W O R K I N G _ D I R E C T O R Y