From dd27c3530432ea0b09f01e604bf577f31d8ef841 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 1 Jun 2023 15:41:47 +1000 Subject: convert lvgl from submodule to a plain old directory --- lib/lvgl | 1 - lib/lvgl/docs/build.py | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) delete mode 160000 lib/lvgl create mode 100755 lib/lvgl/docs/build.py (limited to 'lib/lvgl/docs/build.py') diff --git a/lib/lvgl b/lib/lvgl deleted file mode 160000 index 0732400e..00000000 --- a/lib/lvgl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0732400e7b564dd0e7dc4a924619d8e19c5b23a0 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") + -- cgit v1.2.3