Skip to content

Commit

Permalink
fix(docs): use find_version helper in build script (lvgl#6122)
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt committed Apr 25, 2024
1 parent 691554d commit 5894d53
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions docs/build.py
Expand Up @@ -207,27 +207,7 @@ def cmd(s):


def get_version():
path = os.path.join(project_path, 'lvgl.h')
with open(path, 'rb') as f:
d = f.read().decode('utf-8')

d = d.split('#define LVGL_VERSION_MAJOR', 1)[-1]
major, d = d.split('\n', 1)
d = d.split('#define LVGL_VERSION_MINOR', 1)[-1]
minor, d = d.split('\n', 1)
# d = d.split('#define LVGL_VERSION_PATCH', 1)[-1]
# patch, d = d.split('\n', 1)

ver = '{0}.{1}'.format(major.strip(), minor.strip())

# ver = '{0}.{1}.{2}'.format(major.strip(), minor.strip(), patch.strip())

# if '#define LVGL_VERSION_INFO' in d:
# d = d.split('#define LVGL_VERSION_INFO', 1)[-1]
# info, d = d.split('\n', 1)
# info = info.strip().replace('"', '')
# ver += '-' + info

_, ver = subprocess.getstatusoutput("../scripts/find_version.sh")
return ver

cmd('sphinx-build -b html "{src}" "{dst}" -D version="{version}" -E -j {cpu}'.format(
Expand Down

0 comments on commit 5894d53

Please sign in to comment.