Use vX.Y.Z-dev+{git-describe} for development versions

This commit is contained in:
James McCoy 2020-12-06 15:22:20 -05:00
parent 5855a3ea7b
commit 2b594b9c81
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB
2 changed files with 5 additions and 6 deletions

View File

@ -35,11 +35,10 @@ if not described then
end
-- `git describe` annotates the most recent tagged release; for pre-release
-- builds we must replace that with the unreleased version.
local with_prefix = described:gsub("^v%d+%.%d+%.%d+", prefix)
if described == with_prefix then
-- Prepend the prefix always, e.g. with "nightly-12208-g4041b62b9".
with_prefix = prefix .. "-" .. described
-- builds we append that to the dev version
local with_prefix = prefix
if prefix:match('-dev$') ~= nil then
with_prefix = prefix .. '+' .. described:gsub('^v%d+%.%d+%.%d+-', '')
end
-- Read existing include file.

View File

@ -242,7 +242,7 @@ if(use_git_version)
add_custom_target(update_version_stamp ALL
COMMAND ${LUA_PRG} scripts/update_version_stamp.lua
${relbuild}/config/auto/versiondef_git.h
"v${NVIM_VERSION_MAJOR}.${NVIM_VERSION_MINOR}.${NVIM_VERSION_PATCH}"
"v${NVIM_VERSION_MAJOR}.${NVIM_VERSION_MINOR}.${NVIM_VERSION_PATCH}${NVIM_VERSION_PRERELEASE}"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
BYPRODUCTS ${CMAKE_BINARY_DIR}/config/auto/versiondef_git.h)
else()