From c841f8b3607c590f4107cd1e9f93320ef30d210d Mon Sep 17 00:00:00 2001 From: Tom Ritchford Date: Fri, 8 Aug 2014 14:28:44 -0400 Subject: [PATCH] Add the git tag to the compile (RIPD-238) --- Builds/VisualStudio2013/RippleD.vcxproj | 176 ++++++++++-- .../VisualStudio2013/RippleD.vcxproj.filters | 264 +++++++++++++++--- SConstruct | 11 +- src/beast/site_scons/Beast.py | 5 +- src/ripple/module/app/main/Application.cpp | 21 +- 5 files changed, 398 insertions(+), 79 deletions(-) diff --git a/Builds/VisualStudio2013/RippleD.vcxproj b/Builds/VisualStudio2013/RippleD.vcxproj index f484fc498..d8ea130b4 100644 --- a/Builds/VisualStudio2013/RippleD.vcxproj +++ b/Builds/VisualStudio2013/RippleD.vcxproj @@ -126,6 +126,8 @@ + + @@ -302,14 +304,14 @@ True + + True + True - - True - True @@ -823,6 +825,14 @@ + + + + + + + + True @@ -835,14 +845,6 @@ - - - - - - - - True @@ -1185,8 +1187,6 @@ - - True @@ -2209,11 +2209,6 @@ - - True - - - @@ -2779,9 +2774,6 @@ True - - True - True @@ -3596,6 +3588,9 @@ + + True + True @@ -3637,9 +3632,6 @@ - - True - True @@ -3734,6 +3726,10 @@ + + + + @@ -3752,6 +3748,8 @@ + + @@ -3760,6 +3758,8 @@ + + @@ -3778,6 +3778,22 @@ + + + + + + + + + + + + + + + + @@ -3793,6 +3809,16 @@ + + True + + + + + True + + + True @@ -3828,6 +3854,21 @@ + + True + + + + + True + + + + + True + + + True @@ -3868,6 +3909,11 @@ + + True + + + True @@ -3890,6 +3936,65 @@ + + + + + + + + + + True + + + True + + + True + + + True + + + + + + + True + + + True + + + + + True + + + + + True + + + True + + + + + + + + + True + + + + + True + + + True @@ -3936,6 +4041,9 @@ True + + True + True @@ -3972,6 +4080,16 @@ + + True + + + + + + + True + True @@ -3992,6 +4110,9 @@ True + + True + True @@ -4001,6 +4122,11 @@ + + True + + + True @@ -4012,8 +4138,6 @@ - - True diff --git a/Builds/VisualStudio2013/RippleD.vcxproj.filters b/Builds/VisualStudio2013/RippleD.vcxproj.filters index fd9b97fed..afafe9c38 100644 --- a/Builds/VisualStudio2013/RippleD.vcxproj.filters +++ b/Builds/VisualStudio2013/RippleD.vcxproj.filters @@ -553,21 +553,63 @@ {CF9BDE04-BD20-28B9-FC91-1BB55ADCACB7} + + {0407E334-3863-9048-3EAF-2AD842D9E4E6} + {C0556487-1F23-30EC-158C-1BA7C8B1F6C3} {AD14E1B2-4586-6CDC-2A6F-8476B12F08B0} + + {5DA11815-21A8-C90A-3599-C1E61725BE79} + {B3F3758B-CF66-DE50-EC23-90ABAA4519F1} {BA71F7B0-9208-711E-B1E5-10A2B1C54A59} + + {8DCA6950-4D9E-DD56-ABFE-1E3E933FB323} + + + {0C0524C1-7BE5-DA20-0E6A-F85A514AB437} + + + {1EFA83A1-02CA-BE26-A213-3D536AF039C1} + {3564B926-C600-5731-CE0C-426C65C360B2} + + {2D0A0363-AA57-11F4-AFCF-2198A26BE7C2} + + + {6E712E4B-035E-53DF-EF79-D2820B5AC364} + + + {2942472B-8C45-8A9F-C2B7-9AFE833D9A8D} + + + {6D2A0108-1F32-B04A-6B16-872AA2C9039D} + + + {42C7A482-C4FE-F9D1-6DBC-4BD3443B3D99} + + + {BE9A242A-D80D-63CC-4046-4E273BB53562} + + + {1B1AA153-E614-C50F-B5FE-E69F86B90CB5} + + + {8DC59E9F-E114-2DA1-0334-AA83B67C433C} + + + {1E3A9D8A-09E6-E3E6-1572-D20E311F5621} + {26306562-F81D-B6CD-B192-22BA51E1A96B} @@ -624,6 +666,9 @@ build\proto + + . + beast @@ -855,15 +900,15 @@ beast\crypto\impl + + beast\crypto\impl + beast\crypto\impl\sha2 beast\crypto\impl\sha2 - - beast\crypto\impl - beast\crypto\impl @@ -1506,6 +1551,18 @@ beast\module\core\text + + beast\module\core\threads + + + beast\module\core\threads + + + beast\module\core\threads + + + beast\module\core\threads + beast\module\core\thread @@ -1521,18 +1578,6 @@ beast\module\core\thread - - beast\module\core\threads - - - beast\module\core\threads - - - beast\module\core\threads - - - beast\module\core\threads - beast\module\core\time @@ -1971,9 +2016,6 @@ beast - - . - hyperleveldb\db @@ -3237,12 +3279,6 @@ ripple\module\app\misc - - ripple\module\app\misc - - - ripple\module\app\misc - ripple\module\app\misc @@ -3912,9 +3948,6 @@ ripple\module\rpc\handlers - - ripple\module\rpc\handlers - ripple\module\rpc\handlers @@ -4929,6 +4962,9 @@ rocksdb\db + + rocksdb\db + rocksdb\db @@ -4977,9 +5013,6 @@ rocksdb\db - - rocksdb\db - rocksdb\db @@ -5094,6 +5127,12 @@ rocksdb\db + + rocksdb\hdfs + + + rocksdb\include\rocksdb + rocksdb\include\rocksdb @@ -5121,6 +5160,9 @@ rocksdb\include\rocksdb + + rocksdb\include\rocksdb + rocksdb\include\rocksdb @@ -5133,6 +5175,9 @@ rocksdb\include\rocksdb + + rocksdb\include\rocksdb + rocksdb\include\rocksdb @@ -5160,6 +5205,30 @@ rocksdb\include\rocksdb + + rocksdb\include\rocksdb\utilities + + + rocksdb\include\rocksdb\utilities + + + rocksdb\include\rocksdb\utilities + + + rocksdb\include\rocksdb\utilities + + + rocksdb\include\rocksdb\utilities + + + rocksdb\include\rocksdb\utilities + + + rocksdb\include\rocksdb\utilities + + + rocksdb\include\rocksdb\utilities + rocksdb\include\rocksdb @@ -5181,6 +5250,18 @@ rocksdb\port + + rocksdb\port + + + rocksdb\port + + + rocksdb\table + + + rocksdb\table + rocksdb\table @@ -5223,6 +5304,24 @@ rocksdb\table + + rocksdb\table + + + rocksdb\table + + + rocksdb\table + + + rocksdb\table + + + rocksdb\table + + + rocksdb\table + rocksdb\table @@ -5271,6 +5370,12 @@ rocksdb\table + + rocksdb\table + + + rocksdb\table + rocksdb\table @@ -5298,6 +5403,78 @@ rocksdb\table + + rocksdb\third-party\rapidjson\internal + + + rocksdb\third-party\rapidjson\internal + + + rocksdb\third-party\rapidjson + + + rocksdb\third-party\rapidjson + + + rocksdb\utilities\backupable + + + rocksdb\utilities\document + + + rocksdb\utilities\document + + + rocksdb\utilities\geodb + + + rocksdb\utilities\geodb + + + rocksdb\utilities + + + rocksdb\utilities\merge_operators + + + rocksdb\utilities\merge_operators\string_append + + + rocksdb\utilities\merge_operators\string_append + + + rocksdb\utilities\merge_operators\string_append + + + rocksdb\utilities\merge_operators\string_append + + + rocksdb\utilities\merge_operators + + + rocksdb\utilities\redis + + + rocksdb\utilities\redis + + + rocksdb\utilities\redis + + + rocksdb\utilities\redis + + + rocksdb\utilities\spatialdb + + + rocksdb\utilities\spatialdb + + + rocksdb\utilities\ttl + + + rocksdb\utilities\ttl + rocksdb\util @@ -5352,6 +5529,9 @@ rocksdb\util + + rocksdb\util + rocksdb\util @@ -5394,6 +5574,18 @@ rocksdb\util + + rocksdb\util + + + rocksdb\util + + + rocksdb\util + + + rocksdb\util + rocksdb\util @@ -5418,6 +5610,9 @@ rocksdb\util + + rocksdb\util + rocksdb\util @@ -5430,6 +5625,12 @@ rocksdb\util + + rocksdb\util + + + rocksdb\util + rocksdb\util @@ -5442,9 +5643,6 @@ rocksdb\util - - rocksdb\util - rocksdb\util diff --git a/SConstruct b/SConstruct index 0df767383..99bc21de3 100644 --- a/SConstruct +++ b/SConstruct @@ -200,10 +200,6 @@ def config_base(env): env.Append(CPPDEFINES=['OPENSSL_NO_SSL2']) - #git = Beast.Git(env) # TODO(TOM) - if False: #git.exists: - env.Append(CPPDEFINES={'GIT_COMMIT_ID' : '"%s"' % git.commit_id}) - try: BOOST_ROOT = os.path.normpath(os.environ['BOOST_ROOT']) env.Append(CPPPATH=[ @@ -328,6 +324,13 @@ def config_env(toolchain, variant, env): '-fno-strict-aliasing' ]) + if toolchain != 'msvc': + git = Beast.Git(env) + if git.exists: + env.Append(CPPDEFINES={ + 'GIT_COMMIT_ID' : '\'"%s"\'' % git.commit_id + }) + if toolchain == 'clang': if Beast.system.osx: env.Replace(CC='clang', CXX='clang++', LINK='clang++') diff --git a/src/beast/site_scons/Beast.py b/src/beast/site_scons/Beast.py index 0b096d402..63669010e 100644 --- a/src/beast/site_scons/Beast.py +++ b/src/beast/site_scons/Beast.py @@ -79,7 +79,10 @@ class Git(object): def __init__(self, env): self.exists = env.Detect('git') if self.exists: - self.commit_id = _execute('git describe --tags') + try: + self.commit_id = _execute('git describe --tags') + except: + self.exists = False else: self.commit_id = None diff --git a/src/ripple/module/app/main/Application.cpp b/src/ripple/module/app/main/Application.cpp index 733b416c5..45d8c51ec 100644 --- a/src/ripple/module/app/main/Application.cpp +++ b/src/ripple/module/app/main/Application.cpp @@ -853,26 +853,13 @@ public: // Initialize the Validators object with Config information. void prepareValidators () { -#if 1 - { - std::vector const& strings (getConfig().validators); - m_validators->addStrings ("rippled.cfg", strings); - } -#endif + m_validators->addStrings ("rippled.cfg", getConfig().validators); -#if 1 if (! getConfig().getValidatorsURL().empty()) - { m_validators->addURL (getConfig().getValidatorsURL()); - } -#endif -#if 1 if (getConfig().getValidatorsFile() != beast::File::nonexistent ()) - { m_validators->addFile (getConfig().getValidatorsFile()); - } -#endif } //-------------------------------------------------------------------------- @@ -887,7 +874,11 @@ public: void onStart () { - m_journal.debug << "Application starting"; +#ifdef GIT_COMMIT_ID + m_journal.info << "Application starting. Build is " << GIT_COMMIT_ID; +#else + m_journal.info << "Application starting."; +#endif m_sweepTimer.setExpiration (10);