summaryrefslogtreecommitdiff
path: root/deps/Unity/auto/extract_version.py
blob: 1d137e5bda3103672a319e9937abc6cb2ba421cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env python3
import re
import sys

ver_re = re.compile(r"^#define\s+UNITY_VERSION_(?:MAJOR|MINOR|BUILD)\s+(\d+)$")
version = []

with open(sys.argv[1], "r") as f:
    for line in f:
        m = ver_re.match(line)
        if m:
            version.append(m.group(1))

print(".".join(version))