aboutsummaryrefslogtreecommitdiffstats
path: root/vpp-api/java/jvpp/gen/jvpp_gen.py
diff options
context:
space:
mode:
Diffstat (limited to 'vpp-api/java/jvpp/gen/jvpp_gen.py')
-rwxr-xr-xvpp-api/java/jvpp/gen/jvpp_gen.py30
1 files changed, 19 insertions, 11 deletions
diff --git a/vpp-api/java/jvpp/gen/jvpp_gen.py b/vpp-api/java/jvpp/gen/jvpp_gen.py
index 26bcea1523a..6f531defc9a 100755
--- a/vpp-api/java/jvpp/gen/jvpp_gen.py
+++ b/vpp-api/java/jvpp/gen/jvpp_gen.py
@@ -17,15 +17,16 @@
import argparse
import importlib
import sys
+import os
-import callback_gen
-import notification_gen
-import dto_gen
-import jvpp_callback_facade_gen
-import jvpp_future_facade_gen
-import jvpp_impl_gen
-import jvpp_c_gen
-import util
+from jvppgen import callback_gen
+from jvppgen import notification_gen
+from jvppgen import dto_gen
+from jvppgen import jvpp_callback_facade_gen
+from jvppgen import jvpp_future_facade_gen
+from jvppgen import jvpp_impl_gen
+from jvppgen import jvpp_c_gen
+from jvppgen import util
# Invocation:
# ~/Projects/vpp/vpp-api/jvpp/gen$ mkdir -p java/org/openvpp/jvpp && cd java/org/openvpp/jvpp
@@ -36,15 +37,23 @@ import util
#
# where
# defs_api_vpp_papi.py - vpe.api in python format (generated by vppapigen)
-from util import vpp_2_jni_type_mapping
+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')
args = parser.parse_args()
sys.path.append(".")
-inputfile = args.inputfile.replace('.py', '')
+print "args.inputfile %s" % args.inputfile
+importdir = os.path.dirname(args.inputfile)
+print "importdir %s" % importdir
+inputfile = os.path.basename(args.inputfile)
+inputfile = inputfile.replace('.py', '')
+print "inputfile %s" % inputfile
+base_package = args.base_package
+sys.path.append(importdir)
cfg = importlib.import_module(inputfile, package=None)
@@ -124,7 +133,6 @@ def get_definitions():
func_list, func_name = get_definitions()
-base_package = 'org.openvpp.jvpp'
dto_package = 'dto'
callback_package = 'callback'
notification_package = 'notification'