Repository navigation
Expand file tree
/
Copy pathJustfile
More file actions
113 lines (94 loc) · 4.5 KB
/
Copy pathJustfile
File metadata and controls
113 lines (94 loc) · 4.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# EdgeTX code generation and check helpers.
#
# The codegen recipes wrap existing scripts that regenerate files COMMITTED to
# git. After running one, review and commit the result. The check recipes are
# read-only and mirror what CI runs; they regenerate nothing.
#
# Both run on the host and need the tools installed locally. The docker-
# variants run the same scripts in the dev container instead, which already has
# them. CI uses the host recipes, as its jobs run in that image.
IMAGE := "ghcr.io/edgetx/edgetx-dev:latest"
# --user keeps generated files owned by the invoking user rather than root
_docker := 'docker run --rm --user "$(id -u):$(id -g)" -v "$PWD":/src -w /src ' + IMAGE
# Show available recipes
default:
@just --list
# Needs: lv_font_conv (npm), python3, gcc, and the lvgl submodule checked out.
[doc('Regenerate the LVGL fonts (radio/src/fonts/lvgl/{std,sml,lrg}/lv_font_*.c)')]
[group('codegen')]
gen-fonts:
radio/src/fonts/lvgl/make_fonts.sh
# Needs: a C++ compiler, plus the 19 system locales listed at the top of
# tools/cfn_sorter.sh (apt install locales && locale-gen ...).
[doc('Regenerate the custom-function sort order (radio/src/cfn_sort.cpp)')]
[group('codegen')]
cfn-sort:
tools/cfn_sorter.sh
# FLAVOR is a semicolon-separated target list; empty uses the script's default.
# Recreates ./build from scratch, and needs the libclang version from the
# edgetx-dev container.
[doc('Regenerate the YAML parsers (radio/src/storage/yaml/yaml_datastructs_*.cpp)')]
[group('codegen')]
gen-yaml FLAVOR='':
FLAVOR="{{ FLAVOR }}" tools/generate-yaml.sh
# Needs: node. Which radios are included comes from fw.json, so this only
# picks up a new target once it is listed there.
[doc('Regenerate the web simulator radio list (web/public/radios.json)')]
[group('codegen')]
gen-radios:
node web/scripts/gen-radios-json.js
# Needs: m4.
[doc('Regenerate the simulator string list (radio/src/translations/sim_string_list.h)')]
[group('codegen')]
gen-simstr:
m4 radio/src/translations/simstr.m4 radio/src/translations/string_list.h > radio/src/translations/sim_string_list.h
[doc('Regenerate the YAML parsers, LVGL fonts, cfn sort order, radio list and simulator string list')]
[group('codegen')]
codegen: gen-fonts cfn-sort gen-yaml gen-radios gen-simstr
# Needs: python3 only.
[doc('Check every referenced RADIO_* macro can be defined')]
[group('checks')]
check-radio-macros:
python3 tools/check_radio_macros.py
# Needs: the Python packages in pyproject.toml (uv pip install . / pip install .).
[doc('Validate the hw_defs JSON and that every template renders for every board')]
[group('checks')]
check-hw-defs:
cd radio/util/hw_defs && python3 json_validator.py ../../src/boards/hw_defs
cd radio/util/hw_defs && python3 test_templates.py ../../src/boards/hw_defs
[doc('Run the RADIO_* macro and hw_defs checks')]
[group('checks')]
check: check-radio-macros check-hw-defs
[doc('Regenerate the LVGL fonts in the dev container')]
[group('codegen (docker)')]
docker-gen-fonts:
{{ _docker }} radio/src/fonts/lvgl/make_fonts.sh
[doc('Regenerate the custom-function sort order in the dev container')]
[group('codegen (docker)')]
docker-cfn-sort:
{{ _docker }} tools/cfn_sorter.sh
# Uses its own FetchContent cache: the default one is inside the repo, so it
# would be shared with host builds and their CMake state is not portable here.
[doc('Regenerate the YAML parsers in the dev container')]
[group('codegen (docker)')]
docker-gen-yaml FLAVOR='':
{{ _docker }} env FLAVOR="{{ FLAVOR }}" \
FETCHCONTENT_BASE_DIR=/src/.cache/fetchcontent-docker \
tools/generate-yaml.sh
[doc('Regenerate the web simulator radio list in the dev container')]
[group('codegen (docker)')]
docker-gen-radios:
{{ _docker }} node web/scripts/gen-radios-json.js
[doc('Regenerate the simulator string list in the dev container')]
[group('codegen (docker)')]
docker-gen-simstr:
{{ _docker }} m4 radio/src/translations/simstr.m4 radio/src/translations/string_list.h > radio/src/translations/sim_string_list.h
[doc('Regenerate everything in the dev container')]
[group('codegen (docker)')]
docker-codegen: docker-gen-fonts docker-cfn-sort docker-gen-yaml docker-gen-radios docker-gen-simstr
[doc('Run the checks in the dev container')]
[group('checks (docker)')]
docker-check:
{{ _docker }} python3 tools/check_radio_macros.py
{{ _docker }} sh -c 'cd radio/util/hw_defs && python3 json_validator.py ../../src/boards/hw_defs'
{{ _docker }} sh -c 'cd radio/util/hw_defs && python3 test_templates.py ../../src/boards/hw_defs'