java_gen: clean filename handling
diff --git a/Makefile b/Makefile
index 556b44e..dceb3e6 100644
--- a/Makefile
+++ b/Makefile
@@ -68,9 +68,9 @@
java: .loxi_ts.java
-.loxi_ts.java: ${LOXI_JAVA_FILES} ${LOXI_TEMPLATE_FILES} ${INPUT_FILES}
+.loxi_ts.java: ${LOXI_PY_FILES} ${LOXI_TEMPLATE_FILES} ${INPUT_FILES}
./loxigen.py --install-dir=${LOXI_OUTPUT_DIR} --lang=java
- cd loxi_output/openflowj; mvn package
+ cd ${LOXI_OUTPUT_DIR}/openflowj; mvn package
touch $@
diff --git a/java_gen/codegen.py b/java_gen/codegen.py
index f369459..7c4789d 100644
--- a/java_gen/codegen.py
+++ b/java_gen/codegen.py
@@ -42,7 +42,7 @@
import java_gen.java_model as java_model
def gen_all_java(out, name):
- basedir='loxi_output/openflowj'
+ basedir= '%s/openflowj' % of_g.options.install_dir
srcdir = "%s/src/main/java/" % basedir
print "Outputting to %s" % basedir
if os.path.exists(basedir):
@@ -55,7 +55,7 @@
gen.create_of_classes()
gen.create_of_const_enums()
- with open('README.java-lang') as readme_src:
+ with open('%s/README.java-lang' % os.path.dirname(__file__)) as readme_src:
out.writelines(readme_src.readlines())
out.close()
@@ -138,4 +138,4 @@
print "Copying pre-written files into %s" % basedir
#subprocess.call("cd java_gen/pre-written && tar cpf - pom.xml | ( cd ../../%s && tar xvpf - )" % basedir,
# shell=True)
- os.symlink(os.path.abspath("java_gen/pre-written/pom.xml"), "%s/pom.xml" % basedir)
+ os.symlink(os.path.abspath("%s/pre-written/pom.xml" % os.path.dirname(__file__)), "%s/pom.xml" % basedir)
diff --git a/lang_java.py b/lang_java.py
index a380fab..be94e82 100644
--- a/lang_java.py
+++ b/lang_java.py
@@ -46,25 +46,5 @@
targets = {
- 'base_java': java_codegen.gen_all_java
+ 'openflowj/README': java_codegen.gen_all_java
}
-
-##
-# The list of files to produce. These are the keywords used to index
-# the arrays below giving the external file names, the subdirectory locations
-# and the generating functions.
-
-target_files = ["base_java" ]
-# Internal file name references to actual file names
-file_to_name_map = dict(
- # LOCI source
- base_java="README.openflowj", # not really used by java generator
-)
-
-##
-# The map from the internal file identifier to the function name
-# that generates the content of the file
-
-file_gen_map = dict(
- base_java=java_codegen.gen_all_java,
-)