123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- // Used indirectly. See build/scripts/vcs_info.py
- // ya-bin dump vcs-info > vcs.json
- // python build/scripts/vcs_info.py vcs.json out.c build/scripts/c_templates/svn_interface.c <any_prefix>library/cpp/svnversion<any_suffix>
- #include "build/scripts/c_templates/svnversion.h"
- #define STR1(x) #x
- #define STR2(x) STR1(x)
- const char* GetProgramSvnVersion() {
- #if defined(REVISION)
- // for package systems generating from svn export but providing REVISION macro
- #define STRREVISION STR2(REVISION)
- #define REVISIONINFO "r" STRREVISION
- #if defined(PROGRAM_VERSION)
- return PROGRAM_VERSION "\n\n" REVISIONINFO;
- #else
- return REVISIONINFO " "__DATE__
- " "__TIME__;
- #endif
- #elif defined(PROGRAM_VERSION)
- return PROGRAM_VERSION;
- #else
- return "No program version found";
- #endif
- }
- const char* GetArcadiaSourcePath() {
- #if defined(ARCADIA_SOURCE_PATH)
- return ARCADIA_SOURCE_PATH;
- #else
- return "";
- #endif
- }
- const char* GetArcadiaSourceUrl() {
- #if defined(ARCADIA_SOURCE_URL)
- return ARCADIA_SOURCE_URL;
- #else
- return "";
- #endif
- }
- int GetArcadiaLastChangeNum() {
- #if defined(ARCADIA_SOURCE_LAST_CHANGE)
- return ARCADIA_SOURCE_LAST_CHANGE;
- #else
- return 0;
- #endif
- }
- const char* GetArcadiaLastChange() {
- #if defined(ARCADIA_SOURCE_LAST_CHANGE)
- return STR2(ARCADIA_SOURCE_LAST_CHANGE);
- #else
- return "";
- #endif
- }
- const char* GetArcadiaLastAuthor() {
- #if defined(ARCADIA_SOURCE_LAST_AUTHOR)
- return ARCADIA_SOURCE_LAST_AUTHOR;
- #else
- return "";
- #endif
- }
- int GetProgramSvnRevision() {
- #if defined(ARCADIA_SOURCE_REVISION)
- return ARCADIA_SOURCE_REVISION;
- #else
- return 0;
- #endif
- }
- const char* GetVCSDirty()
- {
- #if defined(DIRTY)
- return DIRTY;
- #else
- return 0;
- #endif
- }
- const char* GetProgramHash() {
- #if defined(ARCADIA_SOURCE_HG_HASH)
- return ARCADIA_SOURCE_HG_HASH;
- #else
- return "";
- #endif
- }
- const char* GetProgramCommitId() {
- #if defined(ARCADIA_SOURCE_REVISION)
- if (ARCADIA_SOURCE_REVISION <= 0) {
- return GetProgramHash();
- }
- return STR2(ARCADIA_SOURCE_REVISION);
- #else
- return GetProgramHash();
- #endif
- }
- const char* GetProgramScmData() {
- #if defined(SCM_DATA)
- return SCM_DATA;
- #else
- return "";
- #endif
- }
- const char* GetProgramShortVersionData() {
- #if defined(SVN_REVISION) && defined(SVN_TIME)
- return STR2(SVN_REVISION) " (" SVN_TIME ")";
- #else
- return GetProgramHash();
- #endif
- }
- const char* GetProgramBuildUser() {
- #if defined(BUILD_USER)
- return BUILD_USER;
- #else
- return "";
- #endif
- }
- const char* GetProgramBuildHost() {
- #if defined(BUILD_HOST)
- return BUILD_HOST;
- #else
- return "";
- #endif
- }
- const char* GetProgramBuildDate() {
- #if defined(BUILD_DATE)
- return BUILD_DATE;
- #else
- return "";
- #endif
- }
- const char* GetCustomVersion() {
- #if defined(CUSTOM_VERSION)
- return CUSTOM_VERSION;
- #else
- return "";
- #endif
- }
- int GetProgramBuildTimestamp() {
- #if defined(BUILD_TIMESTAMP)
- return BUILD_TIMESTAMP;
- #else
- return 0;
- #endif
- }
- const char* GetVCS() {
- #if defined(VCS)
- return VCS;
- #else
- return "";
- #endif
- }
- const char* GetBranch() {
- #if defined(BRANCH)
- return BRANCH;
- #else
- return "";
- #endif
- }
- int GetArcadiaPatchNumber() {
- #if defined(ARCADIA_PATCH_NUMBER)
- return ARCADIA_PATCH_NUMBER;
- #else
- return 42;
- #endif
- }
- const char* GetTag() {
- #if defined(ARCADIA_TAG)
- return ARCADIA_TAG;
- #else
- return "";
- #endif
- }
|