Skip to content

Commit

Permalink
Add get-templates arguments to get paths to interface, loader and typ…
Browse files Browse the repository at this point in the history
…e templates

Signed-off-by: Kai-Uwe Hermann <[email protected]>
  • Loading branch information
hikinggrass committed Oct 11, 2024
1 parent cf6a187 commit 080be56
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ev-dev-tools/src/ev_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""EVerest command line utility."""
__version__ = '0.2.2'
__version__ = '0.3.0'
38 changes: 38 additions & 0 deletions ev-dev-tools/src/ev_cli/ev.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,14 @@ def module_genld(args):
helpers.write_content_to_file_and_check_template(file_info, 'update-if-non-existent')


def module_get_templates(args):
interface_files = args.seperator.join(
[templates['ld-ev.hpp'].filename,
templates['ld-ev.cpp'].filename])

print(f'{interface_files}')


def interface_genhdr(args):
# Always generate type info before generating interfaces
for type_with_namespace in list_types_with_namespace():
Expand Down Expand Up @@ -612,6 +620,14 @@ def interface_genhdr(args):
helpers.write_content_to_file_and_check_template(if_parts['types'], primary_update_strategy, args.diff)


def interface_get_templates(args):
interface_files = args.seperator.join(
[templates['interface_base'].filename,
templates['interface_exports'].filename])

print(f'{interface_files}')


def helpers_genuuids(args):
if (args.count <= 0):
raise Exception(f'Invalid number ("{args.count}") of uuids to generate')
Expand Down Expand Up @@ -684,6 +700,12 @@ def types_genhdr(args):
helpers.write_content_to_file(type_parts['types'], primary_update_strategy, args.diff)


def types_get_templates(args):
interface_files = templates['types.hpp'].filename

print(f'{interface_files}')


def main():
global validators, everest_dirs, work_dir

Expand Down Expand Up @@ -740,6 +762,11 @@ def main():
'files (default: {everest-dir}/build/generated/generated/modules)')
mod_genld_parser.set_defaults(action_handler=module_genld)

mod_get_templates_parser = mod_actions.add_parser(
'get-templates', aliases=['gt'], parents=[common_parser], help='get paths to template files')
mod_get_templates_parser.add_argument('-s', '--seperator', type=str, default=';', help='Seperator between interface files (default: ;)')
mod_get_templates_parser.set_defaults(action_handler=module_get_templates)

if_actions = parser_if.add_subparsers(metavar='<action>', help='available actions', required=True)
if_genhdr_parser = if_actions.add_parser(
'generate-headers', aliases=['gh'], parents=[common_parser], help='generate headers')
Expand All @@ -752,6 +779,11 @@ def main():
'will be skipped')
if_genhdr_parser.set_defaults(action_handler=interface_genhdr)

if_get_templates_parser = if_actions.add_parser(
'get-templates', aliases=['gt'], parents=[common_parser], help='get paths to template files')
if_get_templates_parser.add_argument('-s', '--seperator', type=str, default=';', help='Seperator between interface files (default: ;)')
if_get_templates_parser.set_defaults(action_handler=interface_get_templates)

hlp_actions = parser_hlp.add_subparsers(metavar='<action>', help='available actions', required=True)
hlp_genuuid_parser = hlp_actions.add_parser('generate-uuids', help='generete uuids')
hlp_genuuid_parser.add_argument('count', type=int, default=3)
Expand Down Expand Up @@ -779,6 +811,12 @@ def main():
'will be skipped')
types_genhdr_parser.set_defaults(action_handler=types_genhdr)

types_get_templates_parser = types_actions.add_parser(
'get-templates', aliases=['gt'], parents=[common_parser], help='get paths to template files')
types_get_templates_parser.add_argument('-s', '--seperator', type=str, default=';', help='Seperator between interface files (default: ;)')
types_get_templates_parser.set_defaults(action_handler=types_get_templates)


args = parser.parse_args()

if 'everest_dir' in args:
Expand Down

0 comments on commit 080be56

Please sign in to comment.