Skip to content

Commit 81c591a

Browse files
committedFeb 11, 2018
Bump version file for release
- Update CMakeLists.txt to handle -rc# versions returned from git etc. - Don't try to run shellcheck tests on Travis-CI scripts if they are missing. (I.e., in a release archive)
1 parent 3002769 commit 81c591a

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed
 

‎.VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
$Format:%d%n%n$
22
# Fall back version, probably last release:
3-
1.9.3
3+
2.0.0-rc1
44

55
# OpenCoarrays version file. This project uses semantic
66
# versioning. For details see http://semver.org

‎CMakeLists.txt

+12-7
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ file(STRINGS ".VERSION" first_line
3030
LIMIT_COUNT 1
3131
)
3232

33-
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+"
33+
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+(-rc[0-9]+)?"
3434
OpenCoarraysVersion "${first_line}")
3535

36-
if((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")) AND (EXISTS "${CMAKE_SOURCE_DIR}/.git"))
36+
if((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+(-rc[0-9]+)?")) AND (EXISTS "${CMAKE_SOURCE_DIR}/.git"))
3737
message( STATUS "Build from git repository detected")
3838
find_package(Git)
3939
if(GIT_FOUND)
@@ -42,7 +42,7 @@ if((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")) AND (EXISTS "$
4242
RESULT_VARIABLE git_status
4343
OUTPUT_VARIABLE git_output
4444
OUTPUT_STRIP_TRAILING_WHITESPACE)
45-
if((git_status STREQUAL "0") AND (git_output MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+"))
45+
if((git_status STREQUAL "0") AND (git_output MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+(-rc[0-9]+)?"))
4646
set(OpenCoarraysVersion "${git_output}")
4747
endif()
4848
execute_process(COMMAND "${GIT_EXECUTABLE}" describe --always
@@ -64,18 +64,21 @@ if((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")) AND (EXISTS "$
6464
endif()
6565
endif()
6666

67-
if(NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+"))
67+
if(NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+(-rc[0-9]+)?"))
6868
message( WARNING "Could not extract version from git, falling back on .VERSION, line 3.")
6969
file(STRINGS ".VERSION" OpenCoarraysVersion
70-
REGEX "[0-9]+\\.[0-9]+\\.[0-9]+"
70+
REGEX "[0-9]+\\.[0-9]+\\.[0-9]+(-rc[0-9]+)?"
7171
)
7272
endif()
7373

7474
if(NOT full_git_describe)
7575
set(full_git_describe ${OpenCoarraysVersion})
7676
endif()
7777

78-
project(opencoarrays VERSION "${OpenCoarraysVersion}" LANGUAGES C Fortran)
78+
string(REGEX REPLACE "-rc[0-9]+$"
79+
".0" OPENCOARRAYS_CMAKE_PROJECT_VERSION
80+
"${OpenCoarraysVersion}")
81+
project(opencoarrays VERSION "${OPENCOARRAYS_CMAKE_PROJECT_VERSION}" LANGUAGES C Fortran)
7982
message( STATUS "Building OpenCoarrays version: ${full_git_describe}" )
8083
set(OpenCoarrays_dist_string "OpenCoarrays-${full_git_describe}")
8184

@@ -819,5 +822,7 @@ set(TRAVIS_SCRIPTS
819822
test-script.InstallScript.sh
820823
test-script.cmake.sh)
821824
foreach(SCRIPT ${TRAVIS_SCRIPTS})
822-
lint_script("${CMAKE_SOURCE_DIR}/developer-scripts/travis" ${SCRIPT})
825+
if(EXISTS "${CMAKE_SOURCE_DIR}/developer-scripts/travis/${SCRIPT}")
826+
lint_script("${CMAKE_SOURCE_DIR}/developer-scripts/travis" ${SCRIPT})
827+
endif()
823828
endforeach()

0 commit comments

Comments
 (0)
Please sign in to comment.