Merge from Git repository
--HG-- branch : develop
This commit is contained in:
commit
1aeb8a3873
2 changed files with 32 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
jobs:
|
||||
- job: ubuntu16
|
||||
timeoutInMinutes: 120
|
||||
pool:
|
||||
vmImage: 'Ubuntu-16.04'
|
||||
steps:
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue