1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Automatically integrates git build information into executables.

Usage:
func.exe -V
adnl-pong -V
validator-engine -V
and so on.
Result will be shown in the following format:
Func build information: [ Commit: d8b751d7a5, Date: 2021-02-27 14:34:41 +0200]
This commit is contained in:
Alex Melman 2021-03-26 00:26:49 +02:00 committed by main
parent 41a3418b7b
commit bab4c1637e
40 changed files with 492 additions and 78 deletions

View file

@ -53,6 +53,8 @@
#include "td/utils/Parser.h"
#include "td/utils/port/path.h"
#include "git.h"
void usage(const char* progname) {
std::cerr << "A simple Fift interpreter. Type `bye` to quit, or `words` to get a list of all commands\n";
std::cerr
@ -66,7 +68,7 @@ void usage(const char* progname) {
"\t-d<ton-db-path>\tUse a ton database\n"
"\t-s\tScript mode: use first argument as a fift source file and import remaining arguments as $n)\n"
"\t-v<verbosity-level>\tSet verbosity level\n"
"\t-V<version>\tShow fift build version\n";
"\t-V<version>\tShow fift build information\n";
std::exit(2);
}
@ -118,7 +120,7 @@ int main(int argc, char* const argv[]) {
new_verbosity_level = VERBOSITY_NAME(FATAL) + td::to_integer<int>(td::Slice(optarg));
break;
case 'V':
std::cout << "Fift build version: [" << BUILD_VERSION << "]\n";
std::cout << "Fift build information: [ Commit: " << GitMetadata::CommitSHA1() << ", Date: " << GitMetadata::CommitDate() << "]\n";
std::exit(0);
break;