summaryrefslogtreecommitdiffstats
path: root/vpp-api/java/jvpp/gen/jvpp_gen.py
diff options
context:
space:
mode:
authorEd Warnicke <eaw@cisco.com>2016-07-11 10:29:41 -0700
committerDave Wallace <dwallacelf@gmail.com>2016-08-16 17:55:55 +0000
commitadeb749d13cbb750bcb25dac15314b80032fe024 (patch)
treea3a63150679cf1dd5323235bbc3201d0c145648a /vpp-api/java/jvpp/gen/jvpp_gen.py
parentee275a7333b811629d65a0c1dccf38105be00196 (diff)
Create python package for jvpp generation.
Change-Id: I2254f90b2c3e423563bb91bf70877979f1e86a6b Signed-off-by: Ed Warnicke <eaw@cisco.com> Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
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'