diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ab2017..d1bc622 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,10 +3,13 @@ cmake_minimum_required(VERSION 3.5) set(tile_VERSION_MAJOR 0) set(tile_VERSION_MINOR 1) set(tile_VERSION_PATCH 0) - +set(tile_VERSION_BUILD $ENV{BUILD_NUMBER}) +if (NOT tile_VERSION_BUILD) + set(tile_VERSION_BUILD "0") +endif() project( tile - VERSION ${tile_VERSION_MAJOR}.${tile_VERSION_MINOR}.${tile_VERSION_PATCH} + VERSION ${tile_VERSION_MAJOR}.${tile_VERSION_MINOR}.${tile_VERSION_PATCH}.${tile_VERSION_BUILD} LANGUAGES C CXX) set(CMAKE_CXX_STANDARD 11) @@ -221,7 +224,8 @@ target_precompile_headers(tile PUBLIC json/nlohann/json.hpp) # target_sources(tile PRIVATE ${TILE_SRCS}) target_include_directories( tile - PUBLIC "${CMAKE_CURRENT_BINARY_DIR}" + PUBLIC + "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/third_party/fmt/include" "${CMAKE_CURRENT_BINARY_DIR}/third_party/glog" "${CMAKE_CURRENT_SOURCE_DIR}/third_party/glog/src" diff --git a/Jenkinsfile b/Jenkinsfile index 0b6bd2c..0a29c5e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { agent { docker { - image 'tqcq/cross' + image 'art.uocat.com/tqcq/cross:v1.0.1' } } diff --git a/tile/base/config.h.in b/tile/base/config.h.in index 9d57d67..d16f6cc 100644 --- a/tile/base/config.h.in +++ b/tile/base/config.h.in @@ -20,6 +20,7 @@ #define TILE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@" #define TILE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@" #define TILE_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@" +#define TILE_VERSION "@PROJECT_VERSOIN@" // clang-format on diff --git a/tile/base/net/endpoint_test.cc b/tile/base/net/endpoint_test.cc index 7cbcc48..0d89a96 100644 --- a/tile/base/net/endpoint_test.cc +++ b/tile/base/net/endpoint_test.cc @@ -139,7 +139,7 @@ TEST(Endpoint, ResolveDomainName) { const std::string test_domain = "www.baidu.com"; auto eps = ResolveDomain(test_domain, 80); - ASSERT_TRUE(eps); + ASSERT_TRUE(eps) << eps.error(); for (auto &ep : *eps) { std::cout << Format("Get IP From {}: {}", test_domain, ep.ToString()) << std::endl; diff --git a/tile/init.cc b/tile/init.cc index f4b225b..bcde904 100644 --- a/tile/init.cc +++ b/tile/init.cc @@ -1,6 +1,7 @@ #include "init.h" #include "tile/base/chrono.h" +#include "tile/base/config.h" #include "tile/base/internal/background_task_host.h" #include "tile/base/internal/time_keeper.h" #include "tile/base/internal/utility.h" @@ -54,14 +55,14 @@ int Start(int argc, char **argv, std::function cb, } // Init gflags - gflags::SetVersionString("0.1.0"); + gflags::SetVersionString(TILE_VERSION); gflags::ParseCommandLineFlags(&argc, &argv, true); detail::ApplyFlagOverrider(); // Init Glog google::InitGoogleLogging(argv[0]); - TILE_LOG_INFO("Tile started."); + TILE_LOG_INFO("Tile started. version: {}", TILE_VERSION); TILE_PCHECK(signal(SIGPIPE, SIG_IGN) != SIG_ERR);