Skip to content

Commit

Permalink
Share version number among qmake, xmake and shell scripts (#233)
Browse files Browse the repository at this point in the history
* share version number among qmake, xmake and shell scripts

* use symlink for xmake inclusion
  • Loading branch information
CyanoHao authored Mar 4, 2024
1 parent d5ea217 commit e6c1ca8
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions BUILD_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)以获得更好的代码分析能力。
Expand Down
4 changes: 1 addition & 3 deletions RedPandaIDE/RedPandaIDE.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 6 additions & 2 deletions RedPandaIDE/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions version.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
APP_VERSION="2.27"
APP_VERSION_SUFFIX="alpha"
1 change: 1 addition & 0 deletions version.lua
5 changes: 3 additions & 2 deletions xmake.lua
Original file line number Diff line number Diff line change
@@ -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")
Expand Down

0 comments on commit e6c1ca8

Please sign in to comment.