Skip to content

Commit 685de11

Browse files
authored
Merge pull request #14 from ros2-java/revert-10-dsv_file_templates
Revert "Add templates for .dsv files"
2 parents d17e7cb + 5ac4c71 commit 685de11

File tree

7 files changed

+61
-6
lines changed

7 files changed

+61
-6
lines changed

ament_java_resources/CMakeLists.txt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,22 @@ find_package(ament_cmake REQUIRED)
66

77
ament_index_register_resource(
88
"templates"
9-
CONTENT_FILE "classpath.dsv.template"
10-
PACKAGE_NAME "ament_build_type_gradle_classpath_dsv")
9+
CONTENT_FILE "classpath.sh.template"
10+
PACKAGE_NAME "ament_build_type_gradle_classpath_sh")
1111

1212
ament_index_register_resource(
1313
"templates"
14-
CONTENT_FILE "jni_library_path.dsv.template"
15-
PACKAGE_NAME "ament_build_type_gradle_jni_library_path_dsv")
14+
CONTENT_FILE "classpath.bat.template"
15+
PACKAGE_NAME "ament_build_type_gradle_classpath_bat")
1616

17+
ament_index_register_resource(
18+
"templates"
19+
CONTENT_FILE "jni_library_path.sh.template"
20+
PACKAGE_NAME "ament_build_type_gradle_jni_library_path_sh")
21+
22+
ament_index_register_resource(
23+
"templates"
24+
CONTENT_FILE "jni_library_path.bat.template"
25+
PACKAGE_NAME "ament_build_type_gradle_jni_library_path_bat")
26+
1727
ament_package()
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ament_prepend_unique_value CLASSPATH "."
2+
REM https://ss64.com/nt/for.html
3+
FOR %%j IN (@_AMENT_EXPORT_JARS_CLASSPATH@) DO (
4+
ament_prepend_unique_value CLASSPATH "%%j"
5+
)

ament_java_resources/classpath.dsv.template

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
if [ -n "$ZSH_VERSION" ]; then
2+
if [[ $options[shwordsplit] = off ]]; then
3+
_AMENT_JAVA_SH_WORD_SPLIT=1
4+
setopt shwordsplit
5+
fi
6+
fi
7+
8+
ament_prepend_unique_value CLASSPATH "."
9+
_AMENT_JAVA_IFS=$IFS
10+
IFS=";"
11+
jars="@_AMENT_EXPORT_JARS_CLASSPATH@"
12+
13+
for jar in $jars
14+
do
15+
ament_prepend_unique_value CLASSPATH "$jar"
16+
done
17+
18+
IFS=$_AMENT_JAVA_IFS
19+
20+
unset jar
21+
unset jars
22+
unset AMENT_JAVA_IFS
23+
24+
if [ -n "$_AMENT_JAVA_SH_WORD_SPLIT" ]; then
25+
unsetopt shwordsplit
26+
unset _AMENT_JAVA_SH_WORD_SPLIT
27+
fi
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ament_prepend_unique_value PATH "%AMENT_CURRENT_PREFIX%\lib\jni"

ament_java_resources/jni_library_path.dsv.template

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# detect if running on Darwin platform
2+
_UNAME=`uname -s`
3+
_IS_DARWIN=0
4+
if [ "$_UNAME" = "Darwin" ]; then
5+
_IS_DARWIN=1
6+
fi
7+
unset _UNAME
8+
9+
if [ $_IS_DARWIN -eq 0 ]; then
10+
ament_prepend_unique_value LD_LIBRARY_PATH "$AMENT_CURRENT_PREFIX/lib/jni"
11+
else
12+
ament_prepend_unique_value DYLD_LIBRARY_PATH "$AMENT_CURRENT_PREFIX/lib/jni"
13+
fi
14+
unset _IS_DARWIN

0 commit comments

Comments
 (0)