Skip to content

Commit

Permalink
Bump version file for release
Browse files Browse the repository at this point in the history
 - 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)
  • Loading branch information
zbeekman committed Feb 11, 2018
1 parent 3002769 commit 81c591a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .VERSION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$Format:%d%n%n$
# Fall back version, probably last release:
1.9.3
2.0.0-rc1

# OpenCoarrays version file. This project uses semantic
# versioning. For details see http://semver.org
Expand Down
19 changes: 12 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ file(STRINGS ".VERSION" first_line
LIMIT_COUNT 1
)

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

if((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")) AND (EXISTS "${CMAKE_SOURCE_DIR}/.git"))
if((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+(-rc[0-9]+)?")) AND (EXISTS "${CMAKE_SOURCE_DIR}/.git"))
message( STATUS "Build from git repository detected")
find_package(Git)
if(GIT_FOUND)
Expand All @@ -42,7 +42,7 @@ if((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")) AND (EXISTS "$
RESULT_VARIABLE git_status
OUTPUT_VARIABLE git_output
OUTPUT_STRIP_TRAILING_WHITESPACE)
if((git_status STREQUAL "0") AND (git_output MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+"))
if((git_status STREQUAL "0") AND (git_output MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+(-rc[0-9]+)?"))
set(OpenCoarraysVersion "${git_output}")
endif()
execute_process(COMMAND "${GIT_EXECUTABLE}" describe --always
Expand All @@ -64,18 +64,21 @@ if((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")) AND (EXISTS "$
endif()
endif()

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

if(NOT full_git_describe)
set(full_git_describe ${OpenCoarraysVersion})
endif()

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

Expand Down Expand Up @@ -819,5 +822,7 @@ set(TRAVIS_SCRIPTS
test-script.InstallScript.sh
test-script.cmake.sh)
foreach(SCRIPT ${TRAVIS_SCRIPTS})
lint_script("${CMAKE_SOURCE_DIR}/developer-scripts/travis" ${SCRIPT})
if(EXISTS "${CMAKE_SOURCE_DIR}/developer-scripts/travis/${SCRIPT}")
lint_script("${CMAKE_SOURCE_DIR}/developer-scripts/travis" ${SCRIPT})
endif()
endforeach()

0 comments on commit 81c591a

Please sign in to comment.