Skip to content

Commit 1b90923

Browse files
committed
feat: update version to 0.6.0 in xmake.lua and add version update function
1 parent eccd894 commit 1b90923

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

Scripts/increment_version.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,24 @@ def update_cmakelists_version(new_version: str) -> None:
6868
with open("CMakeLists.txt", "w", newline='\n') as f:
6969
f.write(content)
7070

71+
def update_xmake_version(new_version: str) -> None:
72+
"""
73+
Updates the version number in the xmake.lua file for the Flakkari-Server project.
74+
75+
Args:
76+
new_version (str): The new version number to set in the format 'major.minor.patch'.
77+
78+
Returns:
79+
None
80+
"""
81+
with open("xmake.lua", "r") as f:
82+
content = f.read()
83+
84+
content = re.sub(r'set_version\("(\d+\.\d+\.\d+)"\)', f'set_version("{new_version}")', content)
85+
86+
with open("xmake.lua", "w", newline='\n') as f:
87+
f.write(content)
88+
7189
def update_config_in_version(path: str, new_version: str) -> None:
7290
"""
7391
Updates the version information in the specified configuration file.
@@ -155,6 +173,9 @@ def apply_new_version(current_version: str, new_version: str):
155173
print(f"Updating version {current_version} -> {new_version} in CMakeLists.txt")
156174
update_cmakelists_version(new_version)
157175

176+
print(f"Updating version {current_version} -> {new_version} in xmake.lua")
177+
update_xmake_version(new_version)
178+
158179
loop_in_files("./Flakkari/", current_version, new_version)
159180

160181
def main(calculated_version: str):

xmake.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ target("flakkari")
2525
set_default(true)
2626
set_languages("cxx20")
2727
set_policy("build.warning", true)
28-
set_version("0.5.0")
28+
set_version("0.6.0")
2929

3030
add_packages("nlohmann_json", "singleton")
3131

@@ -80,7 +80,7 @@ xpack("flakkari")
8080
set_homepage("https://github.com/MasterLaplace/Flakkari")
8181
set_licensefile("LICENSE")
8282
set_copyright("Copyright (C) 2023-present, Me.inc & MasterLaplace")
83-
set_version("0.5.0")
83+
set_version("0.6.0")
8484
add_targets("flakkari")
8585
set_iconfile("docs/Images/icon.ico")
8686

0 commit comments

Comments
 (0)