Skip to content

Commit c635f21

Browse files
committed
v3.3.0
1 parent 1ebdad3 commit c635f21

File tree

7 files changed

+80
-8
lines changed

7 files changed

+80
-8
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.14)
22

33
project(
44
tomlplusplus
5-
VERSION 3.2.0
5+
VERSION 3.3.0
66
DESCRIPTION "Header-only TOML config file parser and serializer for C++17"
77
HOMEPAGE_URL "https://marzer.github.io/tomlplusplus/"
88
LANGUAGES CXX

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ You'll find some more code examples in the `examples` directory, and plenty more
113113
114114
### Conan
115115
116-
Add `tomlplusplus/3.2.0` to your conanfile.
116+
Add `tomlplusplus/3.3.0` to your conanfile.
117117
118118
### DDS
119119
120120
Add `tomlpp` to your `package.json5`, e.g.:
121121
122122
```plaintext
123123
depends: [
124-
'tomlpp^3.2.0',
124+
'tomlpp^3.3.0',
125125
]
126126
```
127127

@@ -166,7 +166,7 @@ include(FetchContent)
166166
FetchContent_Declare(
167167
tomlplusplus
168168
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
169-
GIT_TAG v3.2.0
169+
GIT_TAG v3.3.0
170170
)
171171
FetchContent_MakeAvailable(tomlplusplus)
172172
```

docs/pages/main_page.dox

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,15 +453,15 @@ and [emoji sundae] Regular. The API is the same for both.
453453

454454

455455
\subsection mainpage-adding-lib-conan Conan
456-
Add `tomlplusplus/3.2.0` to your conanfile.
456+
Add `tomlplusplus/3.3.0` to your conanfile.
457457

458458

459459

460460
\subsection mainpage-adding-lib-dds DDS
461461
Add `tomlpp` to your `package.json5`, e.g.:
462462
\json
463463
depends: [
464-
'tomlpp^3.2.0',
464+
'tomlpp^3.3.0',
465465
]
466466
\endjson
467467

@@ -507,7 +507,7 @@ include(FetchContent)
507507
FetchContent_Declare(
508508
tomlplusplus
509509
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
510-
GIT_TAG v3.2.0
510+
GIT_TAG v3.3.0
511511
)
512512
FetchContent_MakeAvailable(tomlplusplus)
513513
\endcmake

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ project(
77
'tomlplusplus',
88
'cpp',
99
license: 'MIT',
10-
version: '3.2.0',
10+
version: '3.3.0',
1111
meson_version: '>=0.61.0',
1212
default_options: [
1313
# https://mesonbuild.com/Builtin-options.html

toml++.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
<None Include="tools\generate_single_header.py" />
128128
<None Include="tools\generate_windows_test_targets.py" />
129129
<None Include="tools\utils.py" />
130+
<None Include="tools\version.py" />
130131
<None Include="vendor\README.md" />
131132
</ItemGroup>
132133
<ItemGroup>

toml++.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@
248248
<None Include=".github\FUNDING.yml">
249249
<Filter>.github</Filter>
250250
</None>
251+
<None Include="tools\version.py">
252+
<Filter>tools</Filter>
253+
</None>
251254
</ItemGroup>
252255
<ItemGroup>
253256
<Filter Include="docs">

tools/version.py

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/usr/bin/env python3
2+
# This file is a part of toml++ and is subject to the the terms of the MIT license.
3+
# Copyright (c) Mark Gillard <[email protected]>
4+
# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
5+
# SPDX-License-Identifier: MIT
6+
7+
import sys
8+
import re
9+
from argparse import ArgumentParser
10+
from pathlib import Path
11+
12+
13+
14+
def read_text_file(path):
15+
print(rf'Reading {path}')
16+
with open(path, r'r', encoding=r'utf-8') as f:
17+
return f.read()
18+
19+
20+
21+
def write_text_file(path, text):
22+
print(rf'Writing {path}')
23+
with open(path, r'w', encoding=r'utf-8', newline='\n') as f:
24+
f.write(text)
25+
26+
27+
28+
if __name__ == '__main__':
29+
30+
args = ArgumentParser(r'version.py', description=r'Sets the project version in all the necessary places.')
31+
args.add_argument(r'version', type=str)
32+
args = args.parse_args()
33+
34+
version = re.fullmatch(r'\s*([0-9]+)\s*[.,;]\s*([0-9]+)\s*[.,;]\s*([0-9]+)\s*', args.version)
35+
if not version:
36+
print(rf"Couldn't parse version triplet from '{args.version}'", file=sys.stderr)
37+
sys.exit(1)
38+
version = (int(version[1]), int(version[2]), int(version[3]))
39+
version_str = rf'{version[0]}.{version[1]}.{version[2]}'
40+
print(rf'version: {version_str}')
41+
42+
root = Path(__file__).parent.parent.resolve()
43+
44+
path = root / r'meson.build'
45+
text = read_text_file(path)
46+
text = re.sub(r'''(\s|^)version\s*:\s*['"].*?['"]''', rf"\1version: '{version_str}'", text, count=1)
47+
write_text_file(path, text)
48+
49+
path = root / r'CMakeLists.txt'
50+
text = read_text_file(path)
51+
text = re.sub(r'''(\s|^)VERSION\s+[0-9](?:[.][0-9]){2}''', rf"\1VERSION {version_str}", text, count=1, flags=re.I)
52+
write_text_file(path, text)
53+
54+
path = root / r'include/toml++/impl/version.h'
55+
text = read_text_file(path)
56+
text = re.sub(r'''(\s*#\s*define\s+TOML_LIB_MAJOR)\s+[0-9]+''', rf"\1 {version[0]}", text)
57+
text = re.sub(r'''(\s*#\s*define\s+TOML_LIB_MINOR)\s+[0-9]+''', rf"\1 {version[1]}", text)
58+
text = re.sub(r'''(\s*#\s*define\s+TOML_LIB_PATCH)\s+[0-9]+''', rf"\1 {version[2]}", text)
59+
write_text_file(path, text)
60+
61+
noop_sub = r'#$%^nbsp^%$#'
62+
for file in (r'README.md', r'docs/pages/main_page.dox'):
63+
path = root / file
64+
text = read_text_file(path)
65+
text = re.sub(r'''(toml(?:plusplus|\+\+|pp)\s*[/:^]\s*)[0-9](?:[.][0-9]){2}''', rf"\1{noop_sub}{version_str}", text, flags=re.I)
66+
text = re.sub(r'''(GIT_TAG\s+)(?:v\s*)?[0-9](?:[.][0-9]){2}''', rf"\1v{version_str}", text, flags=re.I)
67+
text = text.replace(noop_sub, '')
68+
write_text_file(path, text)

0 commit comments

Comments
 (0)