rename java package from com.cesnet to org.cesnet
diff --git a/swig/java/CMakeLists.txt b/swig/java/CMakeLists.txt
index 7b3ee5f..1af6a03 100644
--- a/swig/java/CMakeLists.txt
+++ b/swig/java/CMakeLists.txt
@@ -10,15 +10,20 @@
set(CMAKE_SWIG_FLAGS "-I${PROJECT_SOURCE_DIR}")
set(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR})
-file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/com/cesnet")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/org/cesnet")
-set_source_files_properties(${JAVA_SWIG_BINDING}.i PROPERTIES CPLUSPLUS ON PREFIX "" SWIG_FLAGS "-package;com.cesnet")
+set_source_files_properties(${JAVA_SWIG_BINDING}.i PROPERTIES CPLUSPLUS ON PREFIX "" SWIG_FLAGS "-package;org.cesnet")
-swig_add_module(${JAVA_SWIG_BINDING} java ${JAVA_SWIG_BINDING}.i)
+if(${CMAKE_VERSION} VERSION_LESS "3.8.0")
+ swig_add_module(${JAVA_SWIG_BINDING} java ${JAVA_SWIG_BINDING}.i)
+else()
+ swig_add_library(${JAVA_SWIG_BINDING} LANGUAGE java SOURCES ${JAVA_SWIG_BINDING}.i)
+endif()
+
set_target_properties(${SWIG_MODULE_${JAVA_SWIG_BINDING}_REAL_NAME} PROPERTIES PREFIX "")
swig_link_libraries(${JAVA_SWIG_BINDING} ${JNI_LIBRARIES} libyang-cpp)
-add_custom_command(TARGET ${JAVA_SWIG_BINDING} POST_BUILD COMMAND "${Java_JAVAC_EXECUTABLE}" *.java -d . COMMAND "${Java_JAR_EXECUTABLE}" -cvf libyang.jar com)
+add_custom_command(TARGET ${JAVA_SWIG_BINDING} POST_BUILD COMMAND "${Java_JAVAC_EXECUTABLE}" *.java -d . COMMAND "${Java_JAR_EXECUTABLE}" -cvf libyang.jar org)
set(NATIVE_JAR "${CMAKE_CURRENT_BINARY_DIR}/libyang.jar")
# install so file
diff --git a/swig/java/examples/Context.java b/swig/java/examples/Context.java
index 737d335..7ad4720 100644
--- a/swig/java/examples/Context.java
+++ b/swig/java/examples/Context.java
@@ -1,12 +1,12 @@
-import com.cesnet.Module;
-import com.cesnet.vectorModules;
-import com.cesnet.vector_String;
+import org.cesnet.Module;
+import org.cesnet.vectorModules;
+import org.cesnet.vector_String;
public class Context {
public static void main(String[] args) {
System.loadLibrary("yangJava");
- com.cesnet.Context ctx = new com.cesnet.Context("/etc/sysrepo/yang");
+ org.cesnet.Context ctx = new org.cesnet.Context("/etc/sysrepo/yang");
vector_String vs = ctx.get_searchdirs();
for (int i = 0; i < vs.size(); i++) {
System.out.println(vs.get(i));
diff --git a/swig/java/examples/ProcessTree.java b/swig/java/examples/ProcessTree.java
index 01b1d4d..693bfd8 100644
--- a/swig/java/examples/ProcessTree.java
+++ b/swig/java/examples/ProcessTree.java
@@ -3,10 +3,10 @@
import java.io.FileReader;
import java.io.IOException;
-import com.cesnet.*;
-import com.cesnet.Module;
-import static com.cesnet.LYD_FORMAT.LYD_XML;
-import static com.cesnet.yangConstants.LYD_OPT_CONFIG;
+import org.cesnet.*;
+import org.cesnet.Module;
+import static org.cesnet.LYD_FORMAT.LYD_XML;
+import static org.cesnet.yangConstants.LYD_OPT_CONFIG;
public class ProcessTree {
@@ -42,7 +42,7 @@
public static void main(String[] args) {
System.loadLibrary("yangJava");
- com.cesnet.Context ctx = new com.cesnet.Context("/etc/sysrepo/yang");
+ org.cesnet.Context ctx = new org.cesnet.Context("/etc/sysrepo/yang");
Module module = ctx.get_module("turing-machine");
if (module != null){
System.out.println(module.name());
diff --git a/swig/java/examples/Xpath.java b/swig/java/examples/Xpath.java
index da425c5..0eda5b3 100644
--- a/swig/java/examples/Xpath.java
+++ b/swig/java/examples/Xpath.java
@@ -1,16 +1,16 @@
-import com.cesnet.Data_Node;
-import com.cesnet.Module;
-import com.cesnet.Set;
-import com.cesnet.vectorData_Node;
+import org.cesnet.Data_Node;
+import org.cesnet.Module;
+import org.cesnet.Set;
+import org.cesnet.vectorData_Node;
-import static com.cesnet.LYD_FORMAT.LYD_XML;
-import static com.cesnet.yangConstants.LYD_OPT_CONFIG;
+import static org.cesnet.LYD_FORMAT.LYD_XML;
+import static org.cesnet.yangConstants.LYD_OPT_CONFIG;
public class Xpath {
public static void main(String[] args) {
System.loadLibrary("yangJava");
- com.cesnet.Context ctx = new com.cesnet.Context("/etc/sysrepo/yang");
+ org.cesnet.Context ctx = new org.cesnet.Context("/etc/sysrepo/yang");
Module module = ctx.get_module("turing-machine");
if (module != null){
diff --git a/swig/java/tests/LibyangTest.java b/swig/java/tests/LibyangTest.java
index 8b9cda0..2e896a0 100644
--- a/swig/java/tests/LibyangTest.java
+++ b/swig/java/tests/LibyangTest.java
@@ -1,11 +1,11 @@
-import com.cesnet.*;
-import com.cesnet.Module;
-import static com.cesnet.LYD_FORMAT.LYD_XML;
-import static com.cesnet.LYS_INFORMAT.LYS_IN_YANG;
-import static com.cesnet.LYS_INFORMAT.LYS_IN_YIN;
-import static com.cesnet.yangConstants.LYD_OPT_CONFIG;
-import static com.cesnet.yangConstants.LYD_OPT_STRICT;
-import static com.cesnet.yangConstants.LYD_VAL_OK;
+import org.cesnet.*;
+import org.cesnet.Module;
+import static org.cesnet.LYD_FORMAT.LYD_XML;
+import static org.cesnet.LYS_INFORMAT.LYS_IN_YANG;
+import static org.cesnet.LYS_INFORMAT.LYS_IN_YIN;
+import static org.cesnet.yangConstants.LYD_OPT_CONFIG;
+import static org.cesnet.yangConstants.LYD_OPT_STRICT;
+import static org.cesnet.yangConstants.LYD_VAL_OK;
import org.junit.Test;
import static org.junit.Assert.*;
diff --git a/swig/java/tests/TreeDataTest.java b/swig/java/tests/TreeDataTest.java
index b7e6ee8..f2352ee 100644
--- a/swig/java/tests/TreeDataTest.java
+++ b/swig/java/tests/TreeDataTest.java
@@ -1,10 +1,10 @@
-import com.cesnet.*;
-import com.cesnet.Module;
-import static com.cesnet.LYD_ANYDATA_VALUETYPE.LYD_ANYDATA_CONSTSTRING;
-import static com.cesnet.LYD_FORMAT.LYD_JSON;
-import static com.cesnet.LYD_FORMAT.LYD_XML;
-import static com.cesnet.LYS_INFORMAT.LYS_IN_YIN;
-import static com.cesnet.yangConstants.*;
+import org.cesnet.*;
+import org.cesnet.Module;
+import static org.cesnet.LYD_ANYDATA_VALUETYPE.LYD_ANYDATA_CONSTSTRING;
+import static org.cesnet.LYD_FORMAT.LYD_JSON;
+import static org.cesnet.LYD_FORMAT.LYD_XML;
+import static org.cesnet.LYS_INFORMAT.LYS_IN_YIN;
+import static org.cesnet.yangConstants.*;
import java.io.FileDescriptor;
import java.io.RandomAccessFile;
diff --git a/swig/java/tests/TreeSchemaTest.java b/swig/java/tests/TreeSchemaTest.java
index 0201753..62051e4 100644
--- a/swig/java/tests/TreeSchemaTest.java
+++ b/swig/java/tests/TreeSchemaTest.java
@@ -1,10 +1,10 @@
-import com.cesnet.*;
-import com.cesnet.Module;
-import static com.cesnet.LYS_INFORMAT.LYS_IN_YANG;
-import static com.cesnet.LYS_INFORMAT.LYS_IN_YIN;
-import static com.cesnet.LYS_OUTFORMAT.LYS_OUT_TREE;
-import static com.cesnet.LYS_OUTFORMAT.LYS_OUT_YANG;
-import static com.cesnet.LYS_OUTFORMAT.LYS_OUT_YIN;
+import org.cesnet.*;
+import org.cesnet.Module;
+import static org.cesnet.LYS_INFORMAT.LYS_IN_YANG;
+import static org.cesnet.LYS_INFORMAT.LYS_IN_YIN;
+import static org.cesnet.LYS_OUTFORMAT.LYS_OUT_TREE;
+import static org.cesnet.LYS_OUTFORMAT.LYS_OUT_YANG;
+import static org.cesnet.LYS_OUTFORMAT.LYS_OUT_YIN;
import java.io.FileDescriptor;
import java.io.RandomAccessFile;