Skip to content

Commit 2ac6f6c

Browse files
authored
Use .dsv file templates for environment hooks (#186)
* Use .dsv file templates for environment hooks. Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Use setup-ros@0.2.1 to fix GPG error. Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> * Use ament_java main branch, which includes .dsv templates. Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
1 parent cf36c0b commit 2ac6f6c

File tree

5 files changed

+26
-34
lines changed

5 files changed

+26
-34
lines changed

.github/workflows/build_and_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
sudo apt-get update -qq
1212
sudo apt-get install -y default-jdk gradle
1313
- uses: actions/checkout@v2
14-
- uses: ros-tooling/setup-ros@v0.1
14+
- uses: ros-tooling/setup-ros@0.2.1
1515
with:
1616
required-ros-distributions: dashing
1717
- uses: ros-tooling/action-ros-ci@v0.2

ament_cmake_export_jars/cmake/ament_export_jars.cmake

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ macro(ament_export_jars)
4141
list_append_unique(_AMENT_EXPORT_ABSOLUTE_JARS "${_arg}")
4242
endif()
4343
else()
44-
list_append_unique(_AMENT_EXPORT_RELATIVE_CLASSPATH "\$AMENT_CURRENT_PREFIX/${_arg}")
44+
list_append_unique(_AMENT_EXPORT_RELATIVE_CLASSPATH "${_arg}")
4545
set(_arg "\${${PROJECT_NAME}_DIR}/../../../${_arg}")
4646
list_append_unique(_AMENT_EXPORT_RELATIVE_JARS "${_arg}")
4747
endif()
@@ -51,26 +51,19 @@ macro(ament_export_jars)
5151
${_AMENT_EXPORT_RELATIVE_CLASSPATH}
5252
${_AMENT_EXPORT_ABSOLUTE_CLASSPATH})
5353

54-
if(WIN32)
55-
set(_ament_build_type_gradle_classpath_key "ament_build_type_gradle_classpath_bat")
56-
set(_ament_build_type_gradle_classpath_filename
57-
"${CMAKE_CURRENT_BINARY_DIR}/ament_build_type_gradle_classpath.bat.in")
58-
else()
59-
set(_ament_build_type_gradle_classpath_key "ament_build_type_gradle_classpath_sh")
60-
set(_ament_build_type_gradle_classpath_filename
61-
"${CMAKE_CURRENT_BINARY_DIR}/ament_build_type_gradle_classpath.sh.in")
62-
endif()
54+
set(_ament_build_type_gradle_dsv_key "ament_build_type_gradle_classpath_dsv")
55+
set(_ament_build_type_gradle_dsv_filename
56+
"${CMAKE_CURRENT_BINARY_DIR}/ament_build_type_gradle_classpath.dsv.in")
6357

6458
ament_index_get_resource(
65-
classpath_template "templates" "${_ament_build_type_gradle_classpath_key}")
59+
dsv_template "templates" "${_ament_build_type_gradle_dsv_key}")
6660

6761
file(WRITE
68-
"${_ament_build_type_gradle_classpath_filename}"
69-
"${classpath_template}")
62+
"${_ament_build_type_gradle_dsv_filename}"
63+
"${dsv_template}")
64+
65+
find_package(ament_cmake_core REQUIRED)
66+
ament_environment_hooks("${_ament_build_type_gradle_dsv_filename}")
7067

71-
if(NOT WIN32)
72-
find_package(ament_cmake_core QUIET REQUIRED)
73-
ament_environment_hooks("${_ament_build_type_gradle_classpath_filename}")
74-
endif()
7568
endif()
7669
endmacro()

ament_cmake_export_jni_libraries/cmake/ament_export_jni_libraries.cmake

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,25 @@ macro(ament_export_jni_libraries)
4848
endif()
4949
endforeach()
5050

51-
if(WIN32)
52-
set(_ament_build_type_gradle_jni_library_path_key "ament_build_type_gradle_jni_library_path_bat")
53-
set(_ament_build_type_gradle_jni_library_path_filename
54-
"${CMAKE_CURRENT_BINARY_DIR}/ament_build_type_gradle_jni_library_path.bat.in")
51+
if(APPLE)
52+
set(JNI_LIB_ENV_VAR "DYLD_LIBRARY_PATH")
53+
elseif(WIN32)
54+
set(JNI_LIB_ENV_VAR "PATH")
5555
else()
56-
set(_ament_build_type_gradle_jni_library_path_key "ament_build_type_gradle_jni_library_path_sh")
57-
set(_ament_build_type_gradle_jni_library_path_filename
58-
"${CMAKE_CURRENT_BINARY_DIR}/ament_build_type_gradle_jni_library_path.sh.in")
56+
set(JNI_LIB_ENV_VAR "LD_LIBRARY_PATH")
5957
endif()
6058

59+
set(_ament_build_type_gradle_jni_library_path_dsv_filename
60+
"${CMAKE_CURRENT_BINARY_DIR}/ament_build_type_gradle_jni_library_path.dsv.in")
61+
6162
ament_index_get_resource(
62-
jni_library_path_template "templates" "${_ament_build_type_gradle_jni_library_path_key}")
63+
jni_library_path_dsv_template "templates" "ament_build_type_gradle_jni_library_path_dsv")
6364

6465
file(WRITE
65-
"${_ament_build_type_gradle_jni_library_path_filename}"
66-
"${jni_library_path_template}")
66+
"${_ament_build_type_gradle_jni_library_path_dsv_filename}"
67+
"${jni_library_path_dsv_template}")
6768

68-
if(NOT WIN32)
69-
find_package(ament_cmake_core QUIET REQUIRED)
70-
ament_environment_hooks("${_ament_build_type_gradle_jni_library_path_filename}")
71-
endif()
69+
find_package(ament_cmake_core REQUIRED)
70+
ament_environment_hooks("${_ament_build_type_gradle_jni_library_path_dsv_filename}")
7271
endif()
7372
endmacro()

ros2_java_android.repos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ repositories:
2626
ament/ament_java:
2727
type: git
2828
url: https://github.com/ros2-java/ament_java.git
29-
version: master
29+
version: main
3030
eProsima/Fast-CDR:
3131
type: git
3232
url: https://github.com/eProsima/Fast-CDR.git

ros2_java_desktop.repos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ repositories:
22
ament/ament_java:
33
type: git
44
url: https://github.com/ros2-java/ament_java.git
5-
version: master
5+
version: main
66
ros2/common_interfaces:
77
type: git
88
url: https://github.com/ros2/common_interfaces.git

0 commit comments

Comments
 (0)