Skip to content

Commit 71ac0fc

Browse files
committed
internal: add hardcoded versioning support
Added the _VERSION variable to the exported table. Is part of the task [1]. 1. github.com/tarantool/roadmap-internal/issues/204
1 parent 6f041ee commit 71ac0fc

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
9+
* Add hardcoded versioning support, now the exported table
10+
has _VERSION variable.
911

1012
### Fixed
1113
* Pre-hotreload `cartridge` support (older than 2.4.0) (PR #341).

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ install(
9191
DESTINATION ${TARANTOOL_INSTALL_LUADIR}
9292
)
9393

94+
install(
95+
FILES ${CMAKE_CURRENT_SOURCE_DIR}/crud-version.lua
96+
DESTINATION ${TARANTOOL_INSTALL_LUADIR}
97+
)
98+
9499
install(
95100
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cartridge
96101
DESTINATION ${TARANTOOL_INSTALL_LUADIR}

crud-version.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- Сontains the module version, requires manual update.
2+
return '1.0.0-1'

crud.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ local stats = require('crud.stats')
2323

2424
local crud = {}
2525

26+
local ok, VERSION = pcall(require, 'crud-version')
27+
if not ok then
28+
VERSION = 'unknown, check crud-version file'
29+
end
30+
crud['_VERSION'] = VERSION
31+
2632
--- CRUD operations.
2733
-- @section crud
2834

0 commit comments

Comments
 (0)