From 00bbdaba9ef4149585b50f479d820dcc6d34e496 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 10 May 2019 06:49:30 +0800 Subject: [PATCH 1/2] Added: Revision number from git --- code/CMakeModules/GetRevision.cmake | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/code/CMakeModules/GetRevision.cmake b/code/CMakeModules/GetRevision.cmake index dba90c765..94b877438 100644 --- a/code/CMakeModules/GetRevision.cmake +++ b/code/CMakeModules/GetRevision.cmake @@ -72,6 +72,37 @@ IF(EXISTS "${ROOT_DIR}/.hg/") ENDIF() ENDIF() +IF(EXISTS "${ROOT_DIR}/.git/") + FIND_PACKAGE(Git) + + IF(GIT_FOUND) + EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} rev-list HEAD --count + WORKING_DIRECTORY ${ROOT_DIR} + RESULT_VARIABLE git_exit_code + OUTPUT_VARIABLE REVISION) + IF(NOT ${git_exit_code} EQUAL 0) + message(WARNING "git rev-list failed, unable to include version.") + ENDIF() + EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} rev-parse --short=8 HEAD + WORKING_DIRECTORY ${ROOT_DIR} + RESULT_VARIABLE git_exit_code + OUTPUT_VARIABLE CHANGESET) + IF(NOT ${git_exit_code} EQUAL 0) + message(WARNING "git rev-parse failed, unable to include version.") + ENDIF() + EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD + WORKING_DIRECTORY ${ROOT_DIR} + RESULT_VARIABLE git_exit_code + OUTPUT_VARIABLE BRANCH) + IF(NOT ${git_exit_code} EQUAL 0) + message(WARNING "git rev-parse failed, unable to include git branch.") + ENDIF() + STRING(STRIP ${REVISION} REVISION) + STRING(STRIP ${CHANGESET} CHANGESET) + STRING(STRIP ${BRANCH} BRANCH) + ENDIF() +ENDIF() + # if processing exported sources, use "revision" file if exists IF(SOURCE_DIR AND NOT DEFINED REVISION) SET(REVISION_FILE ${SOURCE_DIR}/revision) From c0950a3a790ae85990353d530ee6179d69e6c85d Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 10 May 2019 07:19:53 +0800 Subject: [PATCH 2/2] Fix CI build timeout --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1df6e1242..0e8396061 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,5 +1,6 @@ jobs: - job: ubuntu16 + timeoutInMinutes: 120 pool: vmImage: 'Ubuntu-16.04' steps: