Lines Matching +full:ext +full:- +full:gen
3 set -e
12 Usage: $(basename "$0") [options] <command-args>*
18 --help - Display this message
19 --command <cmd> - Command mode to execute (default 'meson').
20 --directory <path> - Root directory of the YAML source (default '.').
21 --output <path> - Root directory of the output (default '.').
22 --tool <path> - Path to the processing tool (default 'sdbus++').
23 --version - Display this tool's version string.
26 meson - Generate a tree of meson.build files corresponding
28 cpp <intf> - Generate the source files from a YAML interface.
29 markdown <intf> - Generate the markdown files from a YAML interface.
30 registry <intf> - Generate the Redfish registry from a YAML interface.
31 version - Display this tool's version string.
40 tool_version="sdbus++-gen-meson version 10"
52 options="$(getopt -o hc:d:o:t:v --long help,command:,directory:,output:,tool:,version -- "$@")"
53 eval set -- "${options}"
57 -h | --help)
62 -c | --command)
68 -d | --directory)
74 -o | --output)
80 -t | --tool)
86 -v | --version)
91 --)
104 ## $1 - path to create meson.build at.
106 mkdir -p "$1"
110 ## Create the root-level meson.build
121 '--version',
126 warning('Generated meson files from wrong version of sdbus++-gen-meson.')
134 inst_registry_dir = get_option('datadir') / 'redfish-registry' / meson.project_name()
156 ## hash-tables to store:
157 ## meson_paths - list of subdirectory paths for which an empty meson.build
159 ## interfaces - list of interface paths which a YAML has been found and
161 declare -A meson_paths
162 declare -A interfaces
165 ## $1 - The path requiring to be created.
194 ## $1 - The path to insert into.
212 ## $1 - The interface to generate a target for.
215 yamldir="$(realpath --relative-to="${mesondir}" "${rootdir}")"
278 sdbuspp_gen_meson_prog, '--command', 'cpp',
279 '--output', meson.current_build_dir(),
280 '--tool', sdbusplusplus_prog,
281 '--directory', meson.current_source_dir() / '${yamldir}',
294 ## $1 - The interface to generate a target for.
297 yamldir="$(realpath --relative-to="${mesondir}" "${rootdir}")"
314 sdbuspp_gen_meson_prog, '--command', 'markdown',
315 '--output', meson.current_build_dir(),
316 '--tool', sdbusplusplus_prog,
317 '--directory', meson.current_source_dir() / '${yamldir}',
329 ## $1 - The interface to generate a target for.
332 yamldir="$(realpath --relative-to="${mesondir}" "${rootdir}")"
357 if [[ -z "${sources}" ]]; then
370 sdbuspp_gen_meson_prog, '--command', 'registry',
371 '--output', meson.current_build_dir(),
372 '--tool', sdbusplusplus_prog,
373 '--directory', meson.current_source_dir() / '${yamldir}',
388 …yamls="$(find "${rootdir}" -name '*.interface.yaml' -o -name '*.errors.yaml' -o -name '*.events.ya…
391 # Assign the YAML files into the hash-table by interface name.
393 rel="$(realpath "--relative-to=${rootdir}" "${y}")"
395 ext="${rel#*.}"
396 base="$(basename "${rel}" ".${ext}")"
399 interfaces["${key}"]="${interfaces[${key}]} ${ext}"
406 iface_parent_dirs="$(echo "${sorted_ifaces}" | xargs -n1 dirname)"
423 ## $1 - interface to generate.
433 if [[ ! -e "${rootdir}/$1.interface.yaml" ]] &&
434 [[ ! -e "${rootdir}/$1.errors.yaml" ]] &&
435 [[ ! -e "${rootdir}/$1.events.yaml" ]]; then
440 mkdir -p "${outputdir}"
442 sdbusppcmd="${sdbuspp} -r ${rootdir}"
445 if [[ -e "${rootdir}/$1.interface.yaml" ]]; then
446 ${sdbusppcmd} interface common-header "${intf}" > "${outputdir}/common.hpp"
447 ${sdbusppcmd} interface server-header "${intf}" > "${outputdir}/server.hpp"
448 ${sdbusppcmd} interface server-cpp "${intf}" > "${outputdir}/server.cpp"
449 ${sdbusppcmd} interface client-header "${intf}" > "${outputdir}/client.hpp"
450 ${sdbusppcmd} interface aserver-header "${intf}" > "${outputdir}/aserver.hpp"
453 if [[ -e "${rootdir}/$1.errors.yaml" ]]; then
454 ${sdbusppcmd} error exception-header "${intf}" > "${outputdir}/error.hpp"
455 ${sdbusppcmd} error exception-cpp "${intf}" > "${outputdir}/error.cpp"
458 if [[ -e "${rootdir}/$1.events.yaml" ]]; then
459 ${sdbusppcmd} event exception-header "${intf}" > "${outputdir}/event.hpp"
460 ${sdbusppcmd} event exception-cpp "${intf}" > "${outputdir}/event.cpp"
465 ## $1 - interface to generate.
475 if [[ ! -e "${rootdir}/$1.interface.yaml" ]] &&
476 [[ ! -e "${rootdir}/$1.errors.yaml" ]] &&
477 [[ ! -e "${rootdir}/$1.events.yaml" ]]; then
482 mkdir -p "${outputdir}"
484 sdbusppcmd="${sdbuspp} -r ${rootdir}"
488 echo -n > "${outputdir}/${base}.md"
489 if [[ -e "${rootdir}/$1.interface.yaml" ]]; then
493 if [[ -e "${rootdir}/$1.errors.yaml" ]]; then
497 if [[ -e "${rootdir}/$1.events.yaml" ]]; then
503 ## $1 - interface to generate.
513 if [[ ! -e "${rootdir}/$1.events.yaml" ]]; then
518 mkdir -p "${outputdir}"
520 sdbusppcmd="${sdbuspp} -r ${rootdir}"
524 if [[ -e "${rootdir}/$1.events.yaml" ]]; then
525 ${sdbusppcmd} event exception-registry "${intf}" > "${outputdir}/${base}.json"