diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-06-01 15:41:47 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-06-01 15:41:47 +1000 |
| commit | dd27c3530432ea0b09f01e604bf577f31d8ef841 (patch) | |
| tree | bbf86cf81a78f0ff0b07f31f1c390db473f26fd3 /lib/lvgl/docs/build.py | |
| parent | 6fd588e970470b15936187980829916d0dbe77bb (diff) | |
| download | tangara-fw-dd27c3530432ea0b09f01e604bf577f31d8ef841.tar.gz | |
convert lvgl from submodule to a plain old directory
Diffstat (limited to 'lib/lvgl/docs/build.py')
| m--------- | lib/lvgl | 0 | ||||
| -rwxr-xr-x | lib/lvgl/docs/build.py | 74 |
2 files changed, 74 insertions, 0 deletions
diff --git a/lib/lvgl b/lib/lvgl deleted file mode 160000 -Subproject 0732400e7b564dd0e7dc4a924619d8e19c5b23a diff --git a/lib/lvgl/docs/build.py b/lib/lvgl/docs/build.py new file mode 100755 index 00000000..7a1f7979 --- /dev/null +++ b/lib/lvgl/docs/build.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python3 + +import sys +import os +import subprocess +import re +import example_list as ex + +langs = ['en'] + +# Change to script directory for consistency +abspath = os.path.abspath(__file__) +dname = os.path.dirname(abspath) +os.chdir(dname) + +def cmd(s): + print("") + print(s) + print("-------------------------------------") + r = os.system(s) + if r != 0: + print("Exit build due to previous error") + exit(-1) + +# Get the current branch name +status, br = subprocess.getstatusoutput("git branch | grep '*'") +_, gitcommit = subprocess.getstatusoutput("git rev-parse HEAD") +br = re.sub('\* ', '', br) + +# Generate the list of examples +ex.exec() + +urlpath = re.sub('release/', '', br) + +os.environ['LVGL_URLPATH'] = urlpath +os.environ['LVGL_GITCOMMIT'] = gitcommit + +clean = 0 +trans = 0 +skip_latex = False +args = sys.argv[1:] +if len(args) >= 1: + if "clean" in args: clean = 1 + if "skip_latex" in args: skip_latex = True + +lang = "en" +print("") +print("****************") +print("Building") +print("****************") +if clean: + cmd("rm -rf " + lang) + cmd("mkdir " + lang) + + +print("Running doxygen") +cmd("cd ../scripts && doxygen Doxyfile") +# BUILD PDF + +if not skip_latex: + # Silly workaround to include the more or less correct PDF download link in the PDF + #cmd("cp -f " + lang +"/latex/LVGL.pdf LVGL.pdf | true") + cmd("sphinx-build -b latex . out_latex") + + # Generate PDF + cmd("cd out_latex && latexmk -pdf 'LVGL.tex'") + # Copy the result PDF to the main directory to make it available for the HTML build + cmd("cd out_latex && cp -f LVGL.pdf ../LVGL.pdf") +else: + print("skipping latex build as requested") + +# BUILD HTML +cmd("sphinx-build -b html . ../out_html") + |
