mirror of
https://github.com/Z3Prover/z3
synced 2025-08-24 03:57:51 +00:00
Create centralized version management with VERSION.txt (#7802)
* Initial plan * Create VERSION.txt and update CMakeLists.txt to read version from file Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Complete centralized version management system Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Fix version update script and finalize implementation Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Create centralized version management with VERSION.txt Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
parent
debe04350c
commit
265265a68c
7 changed files with 166 additions and 6 deletions
|
@ -8,7 +8,20 @@
|
|||
from mk_util import *
|
||||
|
||||
def init_version():
|
||||
set_version(4, 15, 4, 0) # express a default build version or pick up ci build version
|
||||
# Read version from VERSION.txt file
|
||||
version_file_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'VERSION.txt')
|
||||
try:
|
||||
with open(version_file_path, 'r') as f:
|
||||
version_str = f.read().strip()
|
||||
version_parts = version_str.split('.')
|
||||
if len(version_parts) >= 4:
|
||||
major, minor, build, tweak = int(version_parts[0]), int(version_parts[1]), int(version_parts[2]), int(version_parts[3])
|
||||
else:
|
||||
major, minor, build, tweak = int(version_parts[0]), int(version_parts[1]), int(version_parts[2]), 0
|
||||
set_version(major, minor, build, tweak)
|
||||
except (IOError, ValueError) as e:
|
||||
print(f"Warning: Could not read version from VERSION.txt: {e}")
|
||||
set_version(4, 15, 4, 0) # fallback to default version
|
||||
|
||||
# Z3 Project definition
|
||||
def init_project_def():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue