Skip to content

Commit

Permalink
Merge pull request #236 from LLNL/fix_banner_bug
Browse files Browse the repository at this point in the history
Fix banner bug
  • Loading branch information
ldowen authored Jul 26, 2023
2 parents 0bfb70c + 7aefcab commit ae60eeb
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 26 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# CMakeLists to build the Spheral library.

cmake_minimum_required(VERSION 3.10)
project(spheral LANGUAGES C CXX Fortran)
include(cmake/SpheralVersion.cmake)
project(spheral LANGUAGES C CXX Fortran VERSION ${SPHERAL_VERSION})

set(SPHERAL_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(SPHERAL_TEST_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
Expand Down
16 changes: 12 additions & 4 deletions cmake/SetupSpheral.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,18 @@ if (ENABLE_TESTS)
endmacro(install_with_directory)

# Find the test files we want to install
execute_process(
COMMAND git ls-files tests
WORKING_DIRECTORY ${SPHERAL_ROOT_DIR}
OUTPUT_VARIABLE test_files1)
set(test_files1 "")
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
execute_process(
COMMAND git ls-files tests
WORKING_DIRECTORY ${SPHERAL_ROOT_DIR}
OUTPUT_VARIABLE test_files1)
else()
execute_process(
COMMAND find tests -type f
WORKING_DIRECTORY ${SPHERAL_ROOT_DIR}
OUTPUT_VARIABLE test_files1)
endif()
string(REPLACE "\n" " " test_files ${test_files1})
separate_arguments(test_files)
list(REMOVE_ITEM test_files tests/unit/CXXTests/runCXXTests.ats)
Expand Down
1 change: 1 addition & 0 deletions cmake/SpheralVersion.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(SPHERAL_VERSION 2023.06.0)
16 changes: 12 additions & 4 deletions docs/developer/dev/release_process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,22 @@ The Spheral release process typically involves the following sequence of steps:
#. Merge all PRs containing work to be included in the release into the
develop branch.
#. Make a :ref:`rcbranch-label` from the develop branch. Finalize the
release by completing remaining release tasks on that branch.
release by completing remaining release tasks on that branch. Be sure to
set the version number in ``spheral/cmake/SpheralVersion.cmake`` and commit
the changes. The file should become:
::

set(SPHERAL_VERSION YYYY.MM.pp)

See :ref:`semver-label` for a description of the version numbering scheme
we use.
#. When the release candidate branch is ready, make a PR for it to be merged
into the **main branch.** When it is approved and all CI checks pass,
merge the release candidate branch into the Spheral main branch.
#. On GitHub, make a new release with a tag for the release. Following our
convention, the tag label should have the format ``vYYYY.MM.pp``. See
:ref:`semver-label` for a description of the version numbering scheme we
use. In the GitHub release description, please note key features,
convention, the tag label should have the format ``vYYYY.MM.pp`` and
should be consistent the updates in ``spheral/cmake/SpheralVersion.cmake``.
In the GitHub release description, please note key features,
bugfixes, etc. in the release. Also, add a note to the
release description to remind users to download the gzipped tarfile for
the release instead of the assets GitHub creates for the release.
Expand Down
31 changes: 14 additions & 17 deletions src/SimulationControl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
execute_process(
COMMAND git --git-dir ${CMAKE_SOURCE_DIR}/.git rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE abbref
OUTPUT_STRIP_TRAILING_WHITESPACE
set(spheralversion "v${CMAKE_PROJECT_VERSION}")
if (EXISTS ${CMAKE_SOURCE_DIR}/.git)
execute_process(
COMMAND git --git-dir ${CMAKE_SOURCE_DIR}/.git describe --tags
OUTPUT_VARIABLE tagcomm
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REPLACE "-" " " tagcomm "${tagcomm}")

execute_process(
COMMAND git --git-dir ${CMAKE_SOURCE_DIR}/.git rev-parse --short HEAD
OUTPUT_VARIABLE short
OUTPUT_STRIP_TRAILING_WHITESPACE
execute_process(
COMMAND git --git-dir ${CMAKE_SOURCE_DIR}/.git rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE abbref
OUTPUT_STRIP_TRAILING_WHITESPACE
)

execute_process(
COMMAND git --git-dir ${CMAKE_SOURCE_DIR}/.git log --oneline
COMMAND wc -l
OUTPUT_VARIABLE oneline
OUTPUT_STRIP_TRAILING_WHITESPACE
)

set(SPHERAL_VERSION_LIST ${abbref} ${short} ${oneline})
string(REPLACE ";" " " spheralversion "${SPHERAL_VERSION_LIST}")
set(SPHERAL_VERSION_LIST ${tagcomm} ${abbref})
string(REPLACE ";" " " spheralversion "${SPHERAL_VERSION_LIST}")
endif()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Spheral_banner.py
${CMAKE_CURRENT_BINARY_DIR}/Spheral_banner.py)
Expand Down

0 comments on commit ae60eeb

Please sign in to comment.