aboutsummaryrefslogtreecommitdiffstats
path: root/java_fat
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-01-25 23:56:30 +0100
committerSven Gothel <[email protected]>2021-01-25 23:56:30 +0100
commit959c604af7c100d7d06b51d92d16aed64fac286f (patch)
tree014cebb20f5aa73d6ee67d93aaa55e618c48a3c9 /java_fat
parent7054cd13119c6dc5e113dc5436e226ad70b380fc (diff)
Complete build change: Using jaulib[_fat] if available (for Java) incl. native lib loading. Added junit test facility (Java).
Diffstat (limited to 'java_fat')
-rw-r--r--java_fat/CMakeLists.txt68
-rw-r--r--java_fat/manifest.txt.in34
2 files changed, 102 insertions, 0 deletions
diff --git a/java_fat/CMakeLists.txt b/java_fat/CMakeLists.txt
new file mode 100644
index 00000000..4a641125
--- /dev/null
+++ b/java_fat/CMakeLists.txt
@@ -0,0 +1,68 @@
+# java/CMakeLists.txt
+
+# COMMAND ${CMAKE_COMMAND}
+# -DOS_AND_ARCH=${OS_AND_ARCH}
+# -Dos_and_arch_slash=${os_and_arch_slash}
+# -Dos_and_arch_dot=${os_and_arch_dot}
+# -D_jarfile=${CMAKE_CURRENT_BINARY_DIR}/jaulib_jni-natives-${OS_AND_ARCH}.jar
+# -D_workdir=${CMAKE_CURRENT_BINARY_DIR}
+# -D_module=jni
+# -P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules/MakeNativeJar.cmake
+
+# set(direct_bt_jar_file ${CMAKE_CURRENT_BINARY_DIR}/direct_bt.jar CACHE FILEPATH "direct_bt jar file" FORCE)
+set(direct_bt_fat_jar_file ${CMAKE_CURRENT_BINARY_DIR}/direct_bt_fat.jar CACHE FILEPATH "direct_bt fat jar file" FORCE)
+set(direct_bt_java_src_file ${CMAKE_CURRENT_BINARY_DIR}/direct_bt_java_src.zip CACHE FILEPATH "direct_bt java source file" FORCE)
+
+add_custom_command (OUTPUT ${direct_bt_fat_jar_file} ${direct_bt_java_src_file}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMAND ${CMAKE_COMMAND}
+ -D_srcdir=${CMAKE_CURRENT_BINARY_DIR}/../src/direct_bt
+ -D_dstdir=${CMAKE_CURRENT_BINARY_DIR}/natives/${OS_AND_ARCH}
+ -D_srcbasename=${CMAKE_SHARED_LIBRARY_PREFIX}direct_bt${CMAKE_SHARED_LIBRARY_SUFFIX}.${direct_bt_VERSION_STRING}
+ -D_dstbasename=${CMAKE_SHARED_LIBRARY_PREFIX}direct_bt${CMAKE_SHARED_LIBRARY_SUFFIX}
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules/FileCopyS2D.cmake
+ COMMAND ${CMAKE_COMMAND}
+ -D_srcdir=${CMAKE_CURRENT_BINARY_DIR}/../java/jni/direct_bt
+ -D_dstdir=${CMAKE_CURRENT_BINARY_DIR}/natives/${OS_AND_ARCH}
+ -D_srcbasename=${CMAKE_SHARED_LIBRARY_PREFIX}javadirect_bt${CMAKE_SHARED_LIBRARY_SUFFIX}.${direct_bt_VERSION_STRING}
+ -D_dstbasename=${CMAKE_SHARED_LIBRARY_PREFIX}javadirect_bt${CMAKE_SHARED_LIBRARY_SUFFIX}
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules/FileCopyS2D.cmake
+ COMMAND ${CMAKE_COMMAND}
+ -D_srcdir=${CMAKE_CURRENT_BINARY_DIR}/../src/tinyb
+ -D_dstdir=${CMAKE_CURRENT_BINARY_DIR}/natives/${OS_AND_ARCH}
+ -D_srcbasename=${CMAKE_SHARED_LIBRARY_PREFIX}tinyb${CMAKE_SHARED_LIBRARY_SUFFIX}.${tinyb_VERSION_STRING}
+ -D_dstbasename=${CMAKE_SHARED_LIBRARY_PREFIX}tinyb${CMAKE_SHARED_LIBRARY_SUFFIX}
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules/FileCopyS2D.cmake
+ COMMAND ${CMAKE_COMMAND}
+ -D_srcdir=${CMAKE_CURRENT_BINARY_DIR}/../java/jni/tinyb
+ -D_dstdir=${CMAKE_CURRENT_BINARY_DIR}/natives/${OS_AND_ARCH}
+ -D_srcbasename=${CMAKE_SHARED_LIBRARY_PREFIX}javatinyb${CMAKE_SHARED_LIBRARY_SUFFIX}.${tinyb_VERSION_STRING}
+ -D_dstbasename=${CMAKE_SHARED_LIBRARY_PREFIX}javatinyb${CMAKE_SHARED_LIBRARY_SUFFIX}
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules/FileCopyS2D.cmake
+ COMMAND ${JAR}
+ --create --file ${direct_bt_fat_jar_file}
+ --manifest ${CMAKE_CURRENT_BINARY_DIR}/manifest.txt
+ -C ${CMAKE_CURRENT_BINARY_DIR}/../java/${CMAKE_FILES_DIRECTORY}/direct_bt_jar.dir/ jau
+ -C ${CMAKE_CURRENT_BINARY_DIR}/../java/${CMAKE_FILES_DIRECTORY}/direct_bt_jar.dir/ org
+ -C ${CMAKE_CURRENT_BINARY_DIR}/../java/${CMAKE_FILES_DIRECTORY}/direct_bt_jar.dir/ tinyb
+ -C ${CMAKE_CURRENT_BINARY_DIR}/ natives
+ COMMAND ${JAR}
+ --create --file ${direct_bt_java_src_file}
+ --no-manifest
+ -C ${CMAKE_CURRENT_SOURCE_DIR}/../java jau
+ -C ${CMAKE_CURRENT_SOURCE_DIR}/../java org
+ -C ${CMAKE_CURRENT_SOURCE_DIR}/../java tinyb
+ DEPENDS jaulib_fat_jar direct_bt tinyb direct_bt_jar javadirect_bt javatinyb
+ COMMENT "producing direct_bt [fat] jar files and its java source zip"
+ VERBATIM
+ )
+
+add_custom_target (direct_bt_fat_jar ALL
+ DEPENDS ${direct_bt_fat_jar_file} ${direct_bt_java_src_file}
+ )
+
+add_dependencies(direct_bt_fat_jar jaulib_fat_jar direct_bt tinyb direct_bt_jar javadirect_bt javatinyb)
+
+install (FILES ${direct_bt_fat_jar_file} ${direct_bt_java_src_file} DESTINATION ${CMAKE_INSTALL_LIBDIR}/../lib/java)
+
+
diff --git a/java_fat/manifest.txt.in b/java_fat/manifest.txt.in
new file mode 100644
index 00000000..eba8d645
--- /dev/null
+++ b/java_fat/manifest.txt.in
@@ -0,0 +1,34 @@
+Manifest-Version: 1.0
+Bundle-Date: @BUILD_TSTAMP@
+Bundle-ManifestVersion: 2
+Bundle-Name: org.direct_bt
+Bundle-SymbolicName: org.direct_bt
+Bundle-Version: @VERSION_SHORT@
+Export-Package: org.direct_bt
+Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.9))"
+Package-Title: org.direct_bt
+Package-Vendor: Gothel Software
+Package-Version: @VERSION_SHORT@
+Specification-Title: Direct-BT Fat
+Specification-Vendor: Gothel Software
+Specification-Version: @VERSION_API@
+Implementation-Title: Direct-BT Fat (optionally with TinyB)
+Implementation-Vendor: Gothel Software
+Implementation-Version: @VERSION@
+Implementation-Commit: @VERSION_SHA1@
+Implementation-URL: http://www.jausoft.com/
+Extension-Name: org.direct_bt
+Trusted-Library: true
+Permissions: all-permissions
+Application-Library-Allowable-Codebase: *
+Class-Path: jaulib_fat.jar
+
+Name: org/direct_bt/
+Sealed: true
+
+Name: tinyb/dbus/
+Sealed: true
+
+Name: jau/direct_bt/
+Sealed: true
+