Skip to content

Commit

Permalink
fix(version): update meson.build to 6.5.0, autoupdate in update_versi…
Browse files Browse the repository at this point in the history
…on.py (#1128)
  • Loading branch information
wpbonelli authored Dec 29, 2022
1 parent 84c3893 commit 49876f8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions distribution/update_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
This script is used to update several files in the modflow6 repository, including:
../version.txt
../meson.build
../doc/version.tex
../README.md
../DISCLAIMER.md
Expand Down Expand Up @@ -48,6 +49,7 @@
version_file_path = project_root_path / "version.txt"
touched_file_paths = [
version_file_path,
project_root_path / "meson.build",
project_root_path / "doc" / "version.tex",
project_root_path / "doc" / "version.py",
project_root_path / "README.md",
Expand Down Expand Up @@ -194,6 +196,18 @@ def update_version_txt_and_py(
log_update(py_path, release_type, version)


def update_meson_build(release_type: ReleaseType, timestamp: datetime, version: Version):
path = project_root_path / "meson.build"
lines = open(path, "r").read().splitlines()
with open(path, "w") as f:
for line in lines:
if "version:" in line and "meson_version:" not in line:
line = f" version: '{version.major}.{version.minor}.{version.patch}',"
f.write(f"{line}\n")

log_update(path, release_type, version)


def update_version_tex(
release_type: ReleaseType, timestamp: datetime, version: Version
):
Expand Down Expand Up @@ -318,6 +332,7 @@ def update_version(

with lock:
update_version_txt_and_py(release_type, timestamp, version)
update_meson_build(release_type, timestamp, version)
update_version_tex(release_type, timestamp, version)
update_version_f90(release_type, timestamp, version)
update_readme_and_disclaimer(release_type, timestamp, version)
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project(
'MODFLOW 6',
'fortran',
version: '6.4.1',
version: '6.5.0',
meson_version: '>= 0.59.0',
default_options : [
'b_vscrt=static_from_buildtype', # Link runtime libraries statically on Windows
Expand Down

0 comments on commit 49876f8

Please sign in to comment.