diff options
author | 2016-07-26 15:28:22 +0200 | |
---|---|---|
committer | 2016-08-16 21:26:19 +0000 | |
commit | 66ea26b1bc7bbc8d54a3498dbd3d0919c4712fa8 (patch) | |
tree | 16c46e75723099ad859128af6069055e68897300 /vpp-api/java/jvpp/gen/jvpp_gen.py | |
parent | f4691cd7befd4cf31a63adffc204d71b1f1548e1 (diff) |
VPP-205: jvpp plugin support.
Splits jvpp into two jars
jvpp-registry.jar - base jvpp functionality
jvpp-core.jar - Java wrapper for vpe.api
Plugins can be generated the same way jvpp-core.jar is.
Example (nsh):
https://gerrit.fd.io/r/#/c/2118/
Change-Id: I2254f90b2c3e423563bb91bf70877979f1e90a7d
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'vpp-api/java/jvpp/gen/jvpp_gen.py')
-rwxr-xr-x | vpp-api/java/jvpp/gen/jvpp_gen.py | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/vpp-api/java/jvpp/gen/jvpp_gen.py b/vpp-api/java/jvpp/gen/jvpp_gen.py index 6f531def..551ce7d2 100755 --- a/vpp-api/java/jvpp/gen/jvpp_gen.py +++ b/vpp-api/java/jvpp/gen/jvpp_gen.py @@ -41,7 +41,8 @@ from jvppgen.util import vpp_2_jni_type_mapping parser = argparse.ArgumentParser(description='VPP Java API generator') parser.add_argument('-i', action="store", dest="inputfile") -parser.add_argument('--base_package', action="store", dest="base_package", default='org.openvpp.jvpp') +parser.add_argument('--plugin_name', action="store", dest="plugin_name") +parser.add_argument('--control_ping_class', action="store", dest="control_ping_class", default="ControlPing") args = parser.parse_args() sys.path.append(".") @@ -52,7 +53,10 @@ print "importdir %s" % importdir inputfile = os.path.basename(args.inputfile) inputfile = inputfile.replace('.py', '') print "inputfile %s" % inputfile -base_package = args.base_package +plugin_name = args.plugin_name +print "plugin_name %s" % plugin_name +control_ping_class = args.control_ping_class +print "control_ping_class %s" % control_ping_class sys.path.append(importdir) cfg = importlib.import_module(inputfile, package=None) @@ -133,17 +137,20 @@ def get_definitions(): func_list, func_name = get_definitions() +base_package = 'org.openvpp.jvpp' +plugin_package = base_package + '.' + plugin_name dto_package = 'dto' callback_package = 'callback' notification_package = 'notification' future_package = 'future' # TODO find better package name callback_facade_package = 'callfacade' - -dto_gen.generate_dtos(func_list, base_package, dto_package, args.inputfile) -jvpp_impl_gen.generate_jvpp(func_list, base_package, dto_package, args.inputfile) -callback_gen.generate_callbacks(func_list, base_package, callback_package, dto_package, args.inputfile) -notification_gen.generate_notification_registry(func_list, base_package, notification_package, callback_package, dto_package, args.inputfile) -jvpp_c_gen.generate_jvpp(func_list, args.inputfile) -jvpp_future_facade_gen.generate_jvpp(func_list, base_package, dto_package, callback_package, notification_package, future_package, args.inputfile) -jvpp_callback_facade_gen.generate_jvpp(func_list, base_package, dto_package, callback_package, notification_package, callback_facade_package, args.inputfile) +control_ping_class_fqn = "%s.%s.%s" % (plugin_package, dto_package, control_ping_class) + +dto_gen.generate_dtos(func_list, base_package, plugin_package, plugin_name.title(), dto_package, args.inputfile) +jvpp_impl_gen.generate_jvpp(func_list, base_package, plugin_package, plugin_name, control_ping_class_fqn, dto_package, args.inputfile) +callback_gen.generate_callbacks(func_list, base_package, plugin_package, plugin_name.title(), callback_package, dto_package, args.inputfile) +notification_gen.generate_notification_registry(func_list, base_package, plugin_package, plugin_name.title(), notification_package, callback_package, dto_package, args.inputfile) +jvpp_c_gen.generate_jvpp(func_list, plugin_name, args.inputfile) +jvpp_future_facade_gen.generate_jvpp(func_list, base_package, plugin_package, plugin_name.title(), dto_package, callback_package, notification_package, future_package, args.inputfile) +jvpp_callback_facade_gen.generate_jvpp(func_list, base_package, plugin_package, plugin_name.title(), dto_package, callback_package, notification_package, callback_facade_package, args.inputfile) |