-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from beclab/feat/rank-no-time-limit
Always run ranking no matter whether extractor runs.
- Loading branch information
Showing
8 changed files
with
66 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
execute_process(COMMAND git log --pretty=format:'%h' -n 1 | ||
OUTPUT_VARIABLE GIT_REV | ||
ERROR_QUIET) | ||
|
||
# Check whether we got any revision (which isn't | ||
# always the case, e.g. when someone downloaded a zip | ||
# file from Github instead of a checkout) | ||
if ("${GIT_REV}" STREQUAL "") | ||
set(GIT_REV "N/A") | ||
set(GIT_DIFF "") | ||
set(GIT_TAG "N/A") | ||
set(GIT_BRANCH "N/A") | ||
else() | ||
execute_process( | ||
COMMAND bash -c "git diff --quiet --exit-code || echo +" | ||
OUTPUT_VARIABLE GIT_DIFF) | ||
execute_process( | ||
COMMAND git describe --exact-match --tags | ||
OUTPUT_VARIABLE GIT_TAG ERROR_QUIET) | ||
execute_process( | ||
COMMAND git rev-parse --abbrev-ref HEAD | ||
OUTPUT_VARIABLE GIT_BRANCH) | ||
|
||
string(STRIP "${GIT_REV}" GIT_REV) | ||
string(SUBSTRING "${GIT_REV}" 1 7 GIT_REV) | ||
string(STRIP "${GIT_DIFF}" GIT_DIFF) | ||
string(STRIP "${GIT_TAG}" GIT_TAG) | ||
string(STRIP "${GIT_BRANCH}" GIT_BRANCH) | ||
endif() | ||
|
||
set(VERSION "const char* GIT_REV=\"${GIT_REV}${GIT_DIFF}\"; | ||
const char* GIT_TAG=\"${GIT_TAG}\"; | ||
const char* GIT_BRANCH=\"${GIT_BRANCH}\";") | ||
|
||
if(EXISTS ../src/gitinfo.h) | ||
file(READ ../src/gitinfo.h VERSION_) | ||
else() | ||
set(VERSION_ "") | ||
endif() | ||
|
||
if (NOT "${VERSION}" STREQUAL "${VERSION_}") | ||
file(WRITE ../src/gitinfo.h "${VERSION}") | ||
endif() |