mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-27 03:25:28 +08:00
feat: add API JSON generator (#5677)
Co-authored-by: Liam <30486941+liamHowatt@users.noreply.github.com>
This commit is contained in:
+6
-4
@@ -16,6 +16,7 @@ import shutil
|
||||
import tempfile
|
||||
import config_builder
|
||||
import add_translation
|
||||
from docbuilder_utils import spawn
|
||||
|
||||
# due to the modifications that take place to the documentation files
|
||||
# when the documentaation builds it is better to copy the source files to a
|
||||
@@ -70,10 +71,11 @@ def cmd(s):
|
||||
print("")
|
||||
print(s)
|
||||
print("-------------------------------------")
|
||||
r = os.system(s)
|
||||
if r != 0:
|
||||
|
||||
result = os.system(s)
|
||||
if result != 0:
|
||||
print("Exit build due to previous error")
|
||||
exit(-1)
|
||||
sys.exit(result)
|
||||
|
||||
|
||||
# Get the current branch name
|
||||
@@ -140,7 +142,7 @@ print("Add translation")
|
||||
add_translation.exec(temp_directory)
|
||||
|
||||
print("Running doxygen")
|
||||
cmd('cd "{0}" && doxygen Doxyfile'.format(temp_directory))
|
||||
cmd('cd "{temp_directory}" && doxygen Doxyfile'.format(temp_directory=temp_directory))
|
||||
|
||||
print('Reading Doxygen output')
|
||||
|
||||
|
||||
+16
-2
@@ -10,20 +10,34 @@ src_config = os.path.abspath(os.path.join(
|
||||
))
|
||||
|
||||
|
||||
def run():
|
||||
def run(c_path=None):
|
||||
global dst_config
|
||||
|
||||
if c_path is not None:
|
||||
dst_config = c_path
|
||||
|
||||
with open(src_config, 'r') as f:
|
||||
data = f.read()
|
||||
|
||||
data = data.split('\n')
|
||||
|
||||
for i, line in enumerate(data):
|
||||
if 'LV_USE' in line or 'LV_FONT' in line:
|
||||
if 'LV_USE_PROFILER' in line:
|
||||
continue
|
||||
|
||||
if 'LV_USE' in line or 'LV_FONT' in line and '#define' in line:
|
||||
line = [item for item in line.split(' ') if item]
|
||||
|
||||
for j, item in enumerate(line):
|
||||
if item == '0':
|
||||
line[j] = '1'
|
||||
|
||||
line = ' '.join(line)
|
||||
data[i] = line
|
||||
elif line.startswith('#if 0'):
|
||||
line = line.replace('#if 0', '#if 1')
|
||||
data[i] = line
|
||||
|
||||
data = '\n'.join(data)
|
||||
|
||||
with open(dst_config, 'w') as f:
|
||||
|
||||
+740
-100
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -10,3 +10,4 @@ Bindings
|
||||
cpp
|
||||
pikascript
|
||||
javascript
|
||||
api_json
|
||||
|
||||
Reference in New Issue
Block a user