diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2018-01-24 16:35:11 +0100 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2018-01-27 10:50:52 +0000 |
commit | d1660e980031882627fc1aa42b650c219831dad4 (patch) | |
tree | 102c78a7b15c1ec686245431871b844f1e7ff1e8 /src/vpp-api/java/jvpp/gen/jvpp_gen.py | |
parent | 568cc60b7097299cacb4341a4a70d8ef270f51b4 (diff) |
jvpp: map VPP API enums to primitive types
Adding enum support (VPP-1153) requires
JVPP generator refactoring
(see: VPP-1154, VPP-1155, VPP-480)
As a workaround we just update all the mappings
used for VPP API definitions to JAVA and C/JNI translation.
Change-Id: I9dff83e5199039a1a46a3d4685ce57cdeeeb2014
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'src/vpp-api/java/jvpp/gen/jvpp_gen.py')
-rwxr-xr-x | src/vpp-api/java/jvpp/gen/jvpp_gen.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/vpp-api/java/jvpp/gen/jvpp_gen.py b/src/vpp-api/java/jvpp/gen/jvpp_gen.py index 79708abdf8a..2536b4eea42 100755 --- a/src/vpp-api/java/jvpp/gen/jvpp_gen.py +++ b/src/vpp-api/java/jvpp/gen/jvpp_gen.py @@ -29,6 +29,7 @@ from jvppgen import jvpp_future_facade_gen from jvppgen import jvpp_impl_gen from jvppgen import jvpp_c_gen from jvppgen import util +from jvppgen import enum_gen # Invocation: # ~/Projects/vpp/vpp-api/jvpp/gen$ mkdir -p java/io/fd/vpp/jvpp && cd java/io/fd/vpp/jvpp @@ -88,6 +89,10 @@ os.chdir(work_dir) for inputfile in args.inputfiles: _cfg = json.load(open(cwd + "/" + inputfile, 'r')) + if 'enums' in cfg: + cfg['enums'].extend(_cfg['enums']) + else: + cfg['enums'] = _cfg['enums'] if 'types' in cfg: cfg['types'].extend(_cfg['types']) else: @@ -184,11 +189,10 @@ future_package = 'future' callback_facade_package = 'callfacade' types_list, types_name = get_definitions(cfg['types']) - -types_gen.generate_types(types_list, plugin_package, types_package, args.inputfiles, logger) - func_list, func_name = get_definitions(cfg['messages']) +enum_gen.generate_enums(cfg['enums'], args.inputfiles, logger) +types_gen.generate_types(types_list, plugin_package, types_package, args.inputfiles, logger) dto_gen.generate_dtos(func_list, base_package, plugin_package, plugin_name.title(), dto_package, args.inputfiles, logger) jvpp_impl_gen.generate_jvpp(func_list, base_package, plugin_package, plugin_name, dto_package, args.inputfiles, logger) |