Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions ament_java_resources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,22 @@ find_package(ament_cmake REQUIRED)

ament_index_register_resource(
"templates"
CONTENT_FILE "classpath.dsv.template"
PACKAGE_NAME "ament_build_type_gradle_classpath_dsv")
CONTENT_FILE "classpath.sh.template"
PACKAGE_NAME "ament_build_type_gradle_classpath_sh")

ament_index_register_resource(
"templates"
CONTENT_FILE "jni_library_path.dsv.template"
PACKAGE_NAME "ament_build_type_gradle_jni_library_path_dsv")
CONTENT_FILE "classpath.bat.template"
PACKAGE_NAME "ament_build_type_gradle_classpath_bat")

ament_index_register_resource(
"templates"
CONTENT_FILE "jni_library_path.sh.template"
PACKAGE_NAME "ament_build_type_gradle_jni_library_path_sh")

ament_index_register_resource(
"templates"
CONTENT_FILE "jni_library_path.bat.template"
PACKAGE_NAME "ament_build_type_gradle_jni_library_path_bat")

ament_package()
5 changes: 5 additions & 0 deletions ament_java_resources/classpath.bat.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ament_prepend_unique_value CLASSPATH "."
REM https://ss64.com/nt/for.html
FOR %%j IN (@_AMENT_EXPORT_JARS_CLASSPATH@) DO (
ament_prepend_unique_value CLASSPATH "%%j"
)
1 change: 0 additions & 1 deletion ament_java_resources/classpath.dsv.template

This file was deleted.

27 changes: 27 additions & 0 deletions ament_java_resources/classpath.sh.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
if [ -n "$ZSH_VERSION" ]; then
if [[ $options[shwordsplit] = off ]]; then
_AMENT_JAVA_SH_WORD_SPLIT=1
setopt shwordsplit
fi
fi

ament_prepend_unique_value CLASSPATH "."
_AMENT_JAVA_IFS=$IFS
IFS=";"
jars="@_AMENT_EXPORT_JARS_CLASSPATH@"

for jar in $jars
do
ament_prepend_unique_value CLASSPATH "$jar"
done

IFS=$_AMENT_JAVA_IFS

unset jar
unset jars
unset AMENT_JAVA_IFS

if [ -n "$_AMENT_JAVA_SH_WORD_SPLIT" ]; then
unsetopt shwordsplit
unset _AMENT_JAVA_SH_WORD_SPLIT
fi
1 change: 1 addition & 0 deletions ament_java_resources/jni_library_path.bat.template
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ament_prepend_unique_value PATH "%AMENT_CURRENT_PREFIX%\lib\jni"
1 change: 0 additions & 1 deletion ament_java_resources/jni_library_path.dsv.template

This file was deleted.

14 changes: 14 additions & 0 deletions ament_java_resources/jni_library_path.sh.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# detect if running on Darwin platform
_UNAME=`uname -s`
_IS_DARWIN=0
if [ "$_UNAME" = "Darwin" ]; then
_IS_DARWIN=1
fi
unset _UNAME

if [ $_IS_DARWIN -eq 0 ]; then
ament_prepend_unique_value LD_LIBRARY_PATH "$AMENT_CURRENT_PREFIX/lib/jni"
else
ament_prepend_unique_value DYLD_LIBRARY_PATH "$AMENT_CURRENT_PREFIX/lib/jni"
fi
unset _IS_DARWIN