diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c5d6422..abc9fe8 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,4 @@ # More info: # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners -* @mxgrey @ahcorde +* @ahcorde diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab45c94..5bb2b50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,12 @@ name: Ubuntu CI -on: [push, pull_request] +on: + pull_request: + push: + branches: + - 'ign-plugin[0-9]' + - 'gz-plugin[0-9]' + - 'main' jobs: jammy-ci: @@ -8,7 +14,7 @@ jobs: name: Ubuntu Jammy CI steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Compile and test id: ci uses: gazebo-tooling/action-gz-ci@jammy diff --git a/.github/workflows/package_xml.yml b/.github/workflows/package_xml.yml new file mode 100644 index 0000000..4bd4a9a --- /dev/null +++ b/.github/workflows/package_xml.yml @@ -0,0 +1,11 @@ +name: Validate package.xml + +on: + pull_request: + +jobs: + package-xml: + runs-on: ubuntu-latest + name: Validate package.xml + steps: + - uses: gazebo-tooling/action-gz-ci/validate_package_xml@jammy diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml index 2c94852..2332244 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/triage.yml @@ -14,4 +14,3 @@ jobs: with: project-url: https://github.com/orgs/gazebosim/projects/7 github-token: ${{ secrets.TRIAGE_TOKEN }} - diff --git a/BUILD.bazel b/BUILD.bazel index f1d9f49..4b62c57 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,6 +1,5 @@ load( "@gz//bazel/skylark:build_defs.bzl", - "GZ_FEATURES", "GZ_ROOT", "GZ_VISIBILITY", "gz_configure_header", @@ -10,7 +9,6 @@ load( package( default_visibility = GZ_VISIBILITY, - features = GZ_FEATURES, ) licenses(["notice"]) # Apache-2.0 @@ -43,8 +41,8 @@ gz_include_header( name = "pluginhh_genrule", out = "core/include/gz/plugin.hh", hdrs = public_headers_no_gen + [ - "core/include/gz/plugin/config.hh", "core/include/gz/plugin/Export.hh", + "core/include/gz/plugin/config.hh", ], ) @@ -93,6 +91,7 @@ cc_library( ], deps = [ ":core", + ":loader", ], ) @@ -126,11 +125,15 @@ cc_library( cc_test( name = "Loader_TEST", - srcs = ["loader/src/Loader_TEST.cc"], + srcs = [ + "loader/src/Loader_TEST.cc", + ":config", + ], defines = [ 'GzDummyPlugins_LIB=\\"./plugin/test/libGzDummyPlugins.so\\"', ], deps = [ + ":core", ":loader", GZ_ROOT + "plugin/test:test_plugins", "@gtest", diff --git a/Changelog.md b/Changelog.md index f2de16d..0658e51 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,27 @@ ## Gazebo Plugin 2.x +### Gazebo Plugin 2.0.3 (2024-04-08) + +1. Use relative install path for gz tool data + * [Pull request #140](https://github.com/gazebosim/gz-plugin/pull/140) + +1. Remove @mxgrey as codeowner and assign maintainership to @ahcorde + * [Pull request #137](https://github.com/gazebosim/gz-plugin/pull/137) + +1. Update CI badges in README + * [Pull request #134](https://github.com/gazebosim/gz-plugin/pull/134) + +1. Infrastructure + * [Pull request #132](https://github.com/gazebosim/gz-plugin/pull/132) + +1. Enable and fix gz test on windows + * [Pull request #128](https://github.com/gazebosim/gz-plugin/pull/128) + * [Pull request #131](https://github.com/gazebosim/gz-plugin/pull/131) + +1. Do not install CMakeLists.txt in loader/register + * [Pull request #123](https://github.com/gazebosim/gz-plugin/pull/123) + ### Gazebo Plugin 2.0.2 (2023-09-26) 1. Add explicit dependency on plugin library diff --git a/README.md b/README.md index ba01ee9..d0b46fb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Gazebo Plugin -**Maintainer:** grey [AT] openrobotics [DOT] org +**Maintainer:** ahcorde [AT] gmail [DOT] com [![GitHub open issues](https://img.shields.io/github/issues-raw/gazebosim/gz-plugin.svg)](https://github.com/gazebosim/gz-plugin/issues) [![GitHub open pull requests](https://img.shields.io/github/issues-pr-raw/gazebosim/gz-plugin.svg)](https://github.com/gazebosim/gz-plugin/pulls) @@ -9,13 +9,14 @@ Build | Status -- | -- -Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-plugin/branch/main/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-plugin/branch/main) -Ubuntu Focal | [![Build Status](https://build.osrfoundation.org/job/ignition_plugin-ci-main-focal-amd64/badge/icon)](https://build.osrfoundation.org/job/ignition_plugin-ci-main-focal-amd64/) -Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_plugin-ci-main-homebrew-amd64)](https://build.osrfoundation.org/job/ignition_plugin-ci-main-homebrew-amd64) -Windows | [![Build Status](https://build.osrfoundation.org/view/ign-garden/job/ign_plugin-gz-2-win/badge/icon)](https://build.osrfoundation.org/view/ign-garden/job/ign_plugin-gz-2-win/) +Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-plugin/tree/main/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-plugin/tree/main) +Ubuntu Jammy | [![Build Status](https://build.osrfoundation.org/job/gz_plugin-ci-main-jammy-amd64/badge/icon)](https://build.osrfoundation.org/job/gz_plugin-ci-main-jammy-amd64/) +Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_plugin-ci-main-homebrew-amd64)](https://build.osrfoundation.org/job/gz_plugin-ci-main-homebrew-amd64) +Windows | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_plugin-main-win)](https://build.osrfoundation.org/job/gz_plugin-main-win) + Gazebo Plugin is a component in the [Gazebo](http://gazebosim.org) framework, a set -of libraries designed to rapidly develop robot applications. +of libraries designed to rapidly develop robot applications. It is used to register plugin libraries and load them dynamically at runtime. [http://gazebosim.org](http://gazebosim.org) diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt index 184bc75..c9242c4 100644 --- a/loader/CMakeLists.txt +++ b/loader/CMakeLists.txt @@ -1,9 +1,10 @@ + # Collect source files into the "sources" variable and unit test files into the # "tests" variable gz_get_libsources_and_unittests(sources tests) # Disable gz_TEST if gz-tools is not found -if (MSVC OR NOT GZ_TOOLS_PROGRAM) +if (NOT GZ_TOOLS_PROGRAM) list(REMOVE_ITEM tests src/gz_TEST.cc) endif() @@ -53,7 +54,8 @@ endif() install( DIRECTORY include/ - DESTINATION ${GZ_INCLUDE_INSTALL_DIR_FULL}) + DESTINATION ${GZ_INCLUDE_INSTALL_DIR_FULL} + PATTERN "CMakeLists.txt" EXCLUDE) #============================================================================ # gz command line support diff --git a/loader/conf/CMakeLists.txt b/loader/conf/CMakeLists.txt index 026bd3d..36b24d4 100644 --- a/loader/conf/CMakeLists.txt +++ b/loader/conf/CMakeLists.txt @@ -24,7 +24,7 @@ configure_file( # Install the yaml configuration files in an unversioned location. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GZ_DESIGNATION}${PROJECT_VERSION_MAJOR}.yaml - DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/gz/) + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/gz/) # Tack version onto and install the bash completion script configure_file( @@ -34,4 +34,4 @@ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/plugin${PROJECT_VERSION_MAJOR}.bash_completion.sh DESTINATION - ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/gz/gz${GZ_TOOLS_VER}.completion.d) + ${CMAKE_INSTALL_DATAROOTDIR}/gz/gz${GZ_TOOLS_VER}.completion.d) diff --git a/loader/src/cmd/cmdplugin.rb.in b/loader/src/cmd/cmdplugin.rb.in index 936791e..715a7a2 100644 --- a/loader/src/cmd/cmdplugin.rb.in +++ b/loader/src/cmd/cmdplugin.rb.in @@ -15,6 +15,7 @@ # limitations under the License. require 'open3' +require 'pathname' # Constants. LIBRARY_VERSION = '@PROJECT_VERSION_FULL@' @@ -30,10 +31,7 @@ class Cmd command = args[0] exe_name = COMMANDS[command] - if exe_name[0] == '/' - # If the first character is a slash, we'll assume that we've been given an - # absolute path to the executable. This is only used during test mode. - else + unless Pathname.new(exe_name).absolute? # We're assuming that the library path is relative to the current # location of this script. exe_name = File.expand_path(File.join(File.dirname(__FILE__), exe_name)) diff --git a/loader/src/gz_TEST.cc b/loader/src/gz_TEST.cc index ef8179a..553cd66 100644 --- a/loader/src/gz_TEST.cc +++ b/loader/src/gz_TEST.cc @@ -20,6 +20,8 @@ #include #include +#include + #include "gtest/gtest.h" #include "gz/plugin/Loader.hh" @@ -211,7 +213,7 @@ TEST(gzTest, PluginInfoVerboseDummyPlugins) ////////////////////////////////////////////////// /// \brief Check --help message and bash completion script for consistent flags -TEST(gzTest, PluginHelpVsCompletionFlags) +TEST(gzTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(PluginHelpVsCompletionFlags)) { // Path to gz executable std::string gz = std::string(GZ_PATH); diff --git a/package.xml b/package.xml new file mode 100644 index 0000000..fcd110c --- /dev/null +++ b/package.xml @@ -0,0 +1,21 @@ + + + + gz-plugin3 + 3.0.0 + Gazebo Plugin : Cross-platform C++ library for dynamically loading plugins. + Alejandro Hernández Cordero + Apache License 2.0 + https://github.com/gazebosim/gz-plugin + + cmake + + gz-cmake4 + + gz-tools2 + gz-utils3 + + + cmake + + diff --git a/register/CMakeLists.txt b/register/CMakeLists.txt index a0a69f9..71478ef 100644 --- a/register/CMakeLists.txt +++ b/register/CMakeLists.txt @@ -2,4 +2,5 @@ gz_add_component(register INTERFACE) install( DIRECTORY include/ - DESTINATION ${GZ_INCLUDE_INSTALL_DIR_FULL}) + DESTINATION ${GZ_INCLUDE_INSTALL_DIR_FULL} + PATTERN "CMakeLists.txt" EXCLUDE)