Share version number among qmake, xmake and shell scripts (#233)

* share version number among qmake, xmake and shell scripts

* use symlink for xmake inclusion
This commit is contained in:
Cyano Hao 2024-03-04 18:39:14 +08:00 committed by GitHub
parent d5ea217945
commit e6c1ca8b60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 15 additions and 7 deletions

View File

@ -11,6 +11,7 @@ Recommended development environments:
* Debugger integration with Qt.
To setup development environment in Visual Studio Code:
0. (Windows only) Enable Developer Mode in Windows Settings, and enable `core.symlinks` in Git (`git config core.symlinks true`).
1. Install [xmake](https://xmake.io/) and [XMake extension](https://marketplace.visualstudio.com/items?itemName=tboox.xmake-vscode).
2. Install [C/C++ extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) for language and debugging support.
3. Optionally install [clangd](https://clangd.llvm.org/) and [clangd extension](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd) for better analysis.

View File

@ -11,6 +11,7 @@
* 调试器的 Qt 集成。
设置 Visual Studio Code 开发环境的步骤:
0. 在 Windows 设置中,启用 “开发人员模式”。启用 Git 的 `core.symlinks` 选项(`git config core.symlinks true`)。
1. 安装 [xmake](https://xmake.io/) 和 [XMake 扩展](https://marketplace.visualstudio.com/items?itemName=tboox.xmake-vscode)。
2. 安装 [C/C++ 扩展](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) 以支持语言和调试功能。
3. 根据需要安装 [clangd](https://clangd.llvm.org/) 和 [clangd 扩展](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd)以获得更好的代码分析能力。

View File

@ -15,9 +15,7 @@ CONFIG += ENABLE_SDCC
APP_NAME = RedPandaCPP
APP_VERSION = 2.27
APP_VERSION_SUFFIX = alpha
include(../version.inc)
# TEST_VERSION = beta2
system(git rev-list HEAD --count): TEST_VERSION = $$system(git rev-list HEAD --count)

View File

@ -12,8 +12,12 @@ target("RedPandaIDE")
add_options("app-name", "prefix", "libexecdir")
add_options("lua-addon", "sdcc", "vcs")
if TEST_VERSION ~= nil then
add_defines('REDPANDA_CPP_VERSION="' .. APP_VERSION .. '-' .. TEST_VERSION .. '"')
if APP_VERSION_SUFFIX ~= "" then
add_defines('APP_VERSION_SUFFIX="' .. APP_VERSION_SUFFIX .. '"')
end
if TEST_VERSION ~= "" then
add_defines('REDPANDA_CPP_VERSION="' .. APP_VERSION .. '.' .. TEST_VERSION .. '"')
else
add_defines('REDPANDA_CPP_VERSION="' .. APP_VERSION .. '"')
end

2
version.inc Normal file
View File

@ -0,0 +1,2 @@
APP_VERSION="2.27"
APP_VERSION_SUFFIX="alpha"

1
version.lua Symbolic link
View File

@ -0,0 +1 @@
version.inc

View File

@ -1,5 +1,6 @@
APP_VERSION = "2.26"
TEST_VERSION = "alpha8"
includes("./version.lua")
TEST_VERSION = "$(shell git rev-list HEAD --count)"
add_rules("mode.debug", "mode.release")
set_warnings("all", "extra", "pedantic")