From b36a59bef4e81040f058c020adf57ce3271851a2 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Wed, 16 Oct 2019 17:00:21 -0700 Subject: [PATCH 1/6] Add templates for .dsv files For more information about the introduction of .dsv files, see - https://github.com/colcon/colcon-core/pull/209 - https://github.com/ament/ament_package/pull/89 Signed-off-by: Jacob Perron --- ament_java_resources/CMakeLists.txt | 12 +++++++++++- ament_java_resources/classpath.dsv.template | 1 + ament_java_resources/jni_library_path.dsv.template | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 ament_java_resources/classpath.dsv.template create mode 100644 ament_java_resources/jni_library_path.dsv.template diff --git a/ament_java_resources/CMakeLists.txt b/ament_java_resources/CMakeLists.txt index a0bbf00..1eb5f90 100644 --- a/ament_java_resources/CMakeLists.txt +++ b/ament_java_resources/CMakeLists.txt @@ -9,6 +9,11 @@ ament_index_register_resource( CONTENT_FILE "classpath.sh.template" PACKAGE_NAME "ament_build_type_gradle_classpath_sh") +ament_index_register_resource( + "templates" + CONTENT_FILE "classpath.dsv.template" + PACKAGE_NAME "ament_build_type_gradle_classpath_dsv") + ament_index_register_resource( "templates" CONTENT_FILE "classpath.bat.template" @@ -23,5 +28,10 @@ ament_index_register_resource( "templates" CONTENT_FILE "jni_library_path.bat.template" PACKAGE_NAME "ament_build_type_gradle_jni_library_path_bat") - + +ament_index_register_resource( + "templates" + CONTENT_FILE "jni_library_path.dsv.template" + PACKAGE_NAME "ament_build_type_gradle_jni_library_path_dsv") + ament_package() diff --git a/ament_java_resources/classpath.dsv.template b/ament_java_resources/classpath.dsv.template new file mode 100644 index 0000000..428e14d --- /dev/null +++ b/ament_java_resources/classpath.dsv.template @@ -0,0 +1 @@ +prepend-non-duplicate;CLASSPATH;@_AMENT_EXPORT_JARS_CLASSPATH@ diff --git a/ament_java_resources/jni_library_path.dsv.template b/ament_java_resources/jni_library_path.dsv.template new file mode 100644 index 0000000..640bff5 --- /dev/null +++ b/ament_java_resources/jni_library_path.dsv.template @@ -0,0 +1 @@ +prepend-non-duplicate;@JNI_LIB_ENV_VAR@;lib/jni From dcb45ee6a240850591ffc8c37f422269326880f7 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Tue, 7 Apr 2020 21:05:43 +0000 Subject: [PATCH 2/6] Drop old sh/bat templates Signed-off-by: Jacob Perron --- ament_java_resources/CMakeLists.txt | 20 -------------- ament_java_resources/classpath.bat.template | 5 ---- ament_java_resources/classpath.sh.template | 27 ------------------- .../jni_library_path.bat.template | 1 - .../jni_library_path.sh.template | 14 ---------- 5 files changed, 67 deletions(-) delete mode 100644 ament_java_resources/classpath.bat.template delete mode 100644 ament_java_resources/classpath.sh.template delete mode 100644 ament_java_resources/jni_library_path.bat.template delete mode 100644 ament_java_resources/jni_library_path.sh.template diff --git a/ament_java_resources/CMakeLists.txt b/ament_java_resources/CMakeLists.txt index 1eb5f90..fab14ab 100644 --- a/ament_java_resources/CMakeLists.txt +++ b/ament_java_resources/CMakeLists.txt @@ -4,31 +4,11 @@ project(ament_java_resources NONE) find_package(ament_cmake REQUIRED) -ament_index_register_resource( - "templates" - CONTENT_FILE "classpath.sh.template" - PACKAGE_NAME "ament_build_type_gradle_classpath_sh") - ament_index_register_resource( "templates" CONTENT_FILE "classpath.dsv.template" PACKAGE_NAME "ament_build_type_gradle_classpath_dsv") -ament_index_register_resource( - "templates" - 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_index_register_resource( "templates" CONTENT_FILE "jni_library_path.dsv.template" diff --git a/ament_java_resources/classpath.bat.template b/ament_java_resources/classpath.bat.template deleted file mode 100644 index 6dc448a..0000000 --- a/ament_java_resources/classpath.bat.template +++ /dev/null @@ -1,5 +0,0 @@ -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" -) diff --git a/ament_java_resources/classpath.sh.template b/ament_java_resources/classpath.sh.template deleted file mode 100644 index fc8ace3..0000000 --- a/ament_java_resources/classpath.sh.template +++ /dev/null @@ -1,27 +0,0 @@ -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 diff --git a/ament_java_resources/jni_library_path.bat.template b/ament_java_resources/jni_library_path.bat.template deleted file mode 100644 index f759d3a..0000000 --- a/ament_java_resources/jni_library_path.bat.template +++ /dev/null @@ -1 +0,0 @@ -ament_prepend_unique_value PATH "%AMENT_CURRENT_PREFIX%\lib\jni" diff --git a/ament_java_resources/jni_library_path.sh.template b/ament_java_resources/jni_library_path.sh.template deleted file mode 100644 index f2ccd76..0000000 --- a/ament_java_resources/jni_library_path.sh.template +++ /dev/null @@ -1,14 +0,0 @@ -# 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 From 5ac4c71f4d9d56a1809e11c717198fed190596b7 Mon Sep 17 00:00:00 2001 From: Esteve Fernandez Date: Sat, 9 May 2020 11:47:24 +0200 Subject: [PATCH 3/6] Revert "Add templates for .dsv files" --- ament_java_resources/CMakeLists.txt | 18 ++++++++++--- ament_java_resources/classpath.bat.template | 5 ++++ ament_java_resources/classpath.dsv.template | 1 - ament_java_resources/classpath.sh.template | 27 +++++++++++++++++++ .../jni_library_path.bat.template | 1 + .../jni_library_path.dsv.template | 1 - .../jni_library_path.sh.template | 14 ++++++++++ 7 files changed, 61 insertions(+), 6 deletions(-) create mode 100644 ament_java_resources/classpath.bat.template delete mode 100644 ament_java_resources/classpath.dsv.template create mode 100644 ament_java_resources/classpath.sh.template create mode 100644 ament_java_resources/jni_library_path.bat.template delete mode 100644 ament_java_resources/jni_library_path.dsv.template create mode 100644 ament_java_resources/jni_library_path.sh.template diff --git a/ament_java_resources/CMakeLists.txt b/ament_java_resources/CMakeLists.txt index fab14ab..a0bbf00 100644 --- a/ament_java_resources/CMakeLists.txt +++ b/ament_java_resources/CMakeLists.txt @@ -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() diff --git a/ament_java_resources/classpath.bat.template b/ament_java_resources/classpath.bat.template new file mode 100644 index 0000000..6dc448a --- /dev/null +++ b/ament_java_resources/classpath.bat.template @@ -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" +) diff --git a/ament_java_resources/classpath.dsv.template b/ament_java_resources/classpath.dsv.template deleted file mode 100644 index 428e14d..0000000 --- a/ament_java_resources/classpath.dsv.template +++ /dev/null @@ -1 +0,0 @@ -prepend-non-duplicate;CLASSPATH;@_AMENT_EXPORT_JARS_CLASSPATH@ diff --git a/ament_java_resources/classpath.sh.template b/ament_java_resources/classpath.sh.template new file mode 100644 index 0000000..fc8ace3 --- /dev/null +++ b/ament_java_resources/classpath.sh.template @@ -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 diff --git a/ament_java_resources/jni_library_path.bat.template b/ament_java_resources/jni_library_path.bat.template new file mode 100644 index 0000000..f759d3a --- /dev/null +++ b/ament_java_resources/jni_library_path.bat.template @@ -0,0 +1 @@ +ament_prepend_unique_value PATH "%AMENT_CURRENT_PREFIX%\lib\jni" diff --git a/ament_java_resources/jni_library_path.dsv.template b/ament_java_resources/jni_library_path.dsv.template deleted file mode 100644 index 640bff5..0000000 --- a/ament_java_resources/jni_library_path.dsv.template +++ /dev/null @@ -1 +0,0 @@ -prepend-non-duplicate;@JNI_LIB_ENV_VAR@;lib/jni diff --git a/ament_java_resources/jni_library_path.sh.template b/ament_java_resources/jni_library_path.sh.template new file mode 100644 index 0000000..f2ccd76 --- /dev/null +++ b/ament_java_resources/jni_library_path.sh.template @@ -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 From 61239ce260f598437adab767a729743fc56629b8 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Thu, 17 Jun 2021 07:38:47 -0700 Subject: [PATCH 4/6] Revert "Revert "Add templates for .dsv files"" (#15) This reverts commit 5ac4c71f4d9d56a1809e11c717198fed190596b7. --- ament_java_resources/CMakeLists.txt | 18 +++---------- ament_java_resources/classpath.bat.template | 5 ---- ament_java_resources/classpath.dsv.template | 1 + ament_java_resources/classpath.sh.template | 27 ------------------- .../jni_library_path.bat.template | 1 - .../jni_library_path.dsv.template | 1 + .../jni_library_path.sh.template | 14 ---------- 7 files changed, 6 insertions(+), 61 deletions(-) delete mode 100644 ament_java_resources/classpath.bat.template create mode 100644 ament_java_resources/classpath.dsv.template delete mode 100644 ament_java_resources/classpath.sh.template delete mode 100644 ament_java_resources/jni_library_path.bat.template create mode 100644 ament_java_resources/jni_library_path.dsv.template delete mode 100644 ament_java_resources/jni_library_path.sh.template diff --git a/ament_java_resources/CMakeLists.txt b/ament_java_resources/CMakeLists.txt index a0bbf00..fab14ab 100644 --- a/ament_java_resources/CMakeLists.txt +++ b/ament_java_resources/CMakeLists.txt @@ -6,22 +6,12 @@ find_package(ament_cmake REQUIRED) ament_index_register_resource( "templates" - CONTENT_FILE "classpath.sh.template" - PACKAGE_NAME "ament_build_type_gradle_classpath_sh") + CONTENT_FILE "classpath.dsv.template" + PACKAGE_NAME "ament_build_type_gradle_classpath_dsv") ament_index_register_resource( "templates" - CONTENT_FILE "classpath.bat.template" - PACKAGE_NAME "ament_build_type_gradle_classpath_bat") + CONTENT_FILE "jni_library_path.dsv.template" + PACKAGE_NAME "ament_build_type_gradle_jni_library_path_dsv") -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() diff --git a/ament_java_resources/classpath.bat.template b/ament_java_resources/classpath.bat.template deleted file mode 100644 index 6dc448a..0000000 --- a/ament_java_resources/classpath.bat.template +++ /dev/null @@ -1,5 +0,0 @@ -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" -) diff --git a/ament_java_resources/classpath.dsv.template b/ament_java_resources/classpath.dsv.template new file mode 100644 index 0000000..428e14d --- /dev/null +++ b/ament_java_resources/classpath.dsv.template @@ -0,0 +1 @@ +prepend-non-duplicate;CLASSPATH;@_AMENT_EXPORT_JARS_CLASSPATH@ diff --git a/ament_java_resources/classpath.sh.template b/ament_java_resources/classpath.sh.template deleted file mode 100644 index fc8ace3..0000000 --- a/ament_java_resources/classpath.sh.template +++ /dev/null @@ -1,27 +0,0 @@ -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 diff --git a/ament_java_resources/jni_library_path.bat.template b/ament_java_resources/jni_library_path.bat.template deleted file mode 100644 index f759d3a..0000000 --- a/ament_java_resources/jni_library_path.bat.template +++ /dev/null @@ -1 +0,0 @@ -ament_prepend_unique_value PATH "%AMENT_CURRENT_PREFIX%\lib\jni" diff --git a/ament_java_resources/jni_library_path.dsv.template b/ament_java_resources/jni_library_path.dsv.template new file mode 100644 index 0000000..640bff5 --- /dev/null +++ b/ament_java_resources/jni_library_path.dsv.template @@ -0,0 +1 @@ +prepend-non-duplicate;@JNI_LIB_ENV_VAR@;lib/jni diff --git a/ament_java_resources/jni_library_path.sh.template b/ament_java_resources/jni_library_path.sh.template deleted file mode 100644 index f2ccd76..0000000 --- a/ament_java_resources/jni_library_path.sh.template +++ /dev/null @@ -1,14 +0,0 @@ -# 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 From 6fd444c282f123b50878ba4bf63b8cca5b159fcc Mon Sep 17 00:00:00 2001 From: Ivan Santiago Paunovic Date: Tue, 22 Jun 2021 17:59:05 -0300 Subject: [PATCH 5/6] [ament_build_type_gradle] Install package marker and package.xml (#16) Signed-off-by: Ivan Santiago Paunovic --- .../resource/ament_build_type_gradle | 0 ament_build_type_gradle/setup.py | 13 ++++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 ament_build_type_gradle/resource/ament_build_type_gradle diff --git a/ament_build_type_gradle/resource/ament_build_type_gradle b/ament_build_type_gradle/resource/ament_build_type_gradle new file mode 100644 index 0000000..e69de29 diff --git a/ament_build_type_gradle/setup.py b/ament_build_type_gradle/setup.py index 3d8c803..b20dec2 100644 --- a/ament_build_type_gradle/setup.py +++ b/ament_build_type_gradle/setup.py @@ -3,10 +3,17 @@ from setuptools import find_packages from setuptools import setup +package_name = 'ament_build_type_gradle' + setup( - name='ament_build_type_gradle', + name=package_name, version='0.0.0', packages=find_packages(exclude=['test']), + data_files=[ + ('share/' + package_name, ['package.xml']), + ('share/ament_index/resource_index/packages', + ['resource/' + package_name]), + ], install_requires=['ament-package', 'osrf_pycommon'], zip_safe=True, author='Esteve Fernandez', @@ -24,6 +31,6 @@ license='Apache License, Version 2.0', test_suite='test', entry_points={ - 'ament.build_types': ['ament_gradle = ament_build_type_gradle:AmentGradleBuildType', ], + 'ament.build_types': [f'ament_gradle = {package_name}:AmentGradleBuildType', ], }, - package_data={'ament_build_type_gradle': ['template/environment_hook/*.in']}, ) + package_data={f'{package_name}': ['template/environment_hook/*.in']}, ) From c430324f0e8aa12106e67799795994b8aede10a9 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Fri, 13 May 2022 11:28:18 -0700 Subject: [PATCH 6/6] Remove unused test dependency declarations (#17) When following install instructions for ros2-java, rosdep cannot resolve 'ament_pep8'. Since we are not actually running any tests for this package, remove all test dependency declarations. Signed-off-by: Jacob Perron --- ament_build_type_gradle/package.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ament_build_type_gradle/package.xml b/ament_build_type_gradle/package.xml index c6fd0bd..044789f 100644 --- a/ament_build_type_gradle/package.xml +++ b/ament_build_type_gradle/package.xml @@ -13,11 +13,6 @@ ament_java_resources ament_java_resources - ament_copyright - ament_pep257 - ament_pep8 - ament_pyflakes - ament_python