diff --git a/CMakeLists.txt b/CMakeLists.txt index 354f210d..c3bba23a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,7 @@ gz_find_package(DL #-------------------------------------- # Find ignition-tools -find_program(GZ_TOOLS_PROGRAM ign) +find_program(GZ_TOOLS_PROGRAM gz) #-------------------------------------- diff --git a/Changelog.md b/Changelog.md index 54180054..b4dce546 100644 --- a/Changelog.md +++ b/Changelog.md @@ -10,7 +10,7 @@ * [Pull request #52](https://github.com/gazebosim/gz-plugin/pull/52) * [Pull request #51](https://github.com/gazebosim/gz-plugin/pull/51) -1. Find ign program instead of ignition-tools +1. Find gz program instead of ignition-tools * [Pull request #57](https://github.com/gazebosim/gz-plugin/pull/57) 1. Remove ign-tools from CMakeLists.txt. Not used @@ -37,7 +37,7 @@ 1. Fix downstream Windows builds * [Pull request #38](https://github.com/gazebosim/gz-plugin/pull/38) -1. Add `ign plugin --info` to print plugin info +1. Add `gz plugin --info` to print plugin info * [Pull request #32](https://github.com/gazebosim/gz-plugin/pull/32) 1. Add Windows installation diff --git a/README.md b/README.md index c558b164..7e021238 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ of libraries designed to rapidly develop robot applications. * Querying of interfaces **by C++ type or name string**. * **Dynamically load** plugins at runtime according to the interfaces they provide. * **Reference counting** of plugin objects to unload libraries no longer in use. -* **Command line tool** `ign plugin` to inspect plugins. +* **Command line tool** `gz plugin` to inspect plugins. ## Installation diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt index 49ea3c23..68283289 100644 --- a/loader/CMakeLists.txt +++ b/loader/CMakeLists.txt @@ -2,9 +2,9 @@ # "tests" variable gz_get_libsources_and_unittests(sources tests) -# Disable ign_TEST if ignition-tools is not found +# Disable gz_TEST if ignition-tools is not found if (MSVC OR NOT GZ_TOOLS_PROGRAM) - list(REMOVE_ITEM tests src/ign_TEST.cc) + list(REMOVE_ITEM tests src/gz_TEST.cc) endif() # Create the library target @@ -40,11 +40,11 @@ foreach(test ${test_targets}) endforeach() -if(TARGET UNIT_ign_TEST) +if(TARGET UNIT_gz_TEST) set(_env_vars) list(APPEND _env_vars "GZ_CONFIG_PATH=${CMAKE_BINARY_DIR}/test/conf/$") - set_tests_properties(UNIT_ign_TEST PROPERTIES + set_tests_properties(UNIT_gz_TEST PROPERTIES ENVIRONMENT "${_env_vars}") endif() @@ -53,7 +53,7 @@ install( DESTINATION ${IGN_INCLUDE_INSTALL_DIR_FULL}) #============================================================================ -# ign command line support +# gz command line support #============================================================================ add_subdirectory(conf) add_subdirectory(src) diff --git a/loader/conf/CMakeLists.txt b/loader/conf/CMakeLists.txt index f5dd31fd..9df9116b 100644 --- a/loader/conf/CMakeLists.txt +++ b/loader/conf/CMakeLists.txt @@ -1,5 +1,5 @@ # Used only for internal testing. -set(gz_library_path "${CMAKE_BINARY_DIR}/test/lib/$/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}") +set(gz_library_path "${CMAKE_BINARY_DIR}/test/lib/$/ruby/gz/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}") # Generate a configuration file for internal testing. # Note that the major version of the library is included in the name. @@ -13,7 +13,7 @@ file(GENERATE INPUT "${CMAKE_CURRENT_BINARY_DIR}/${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.yaml.configured") # Used for the installed version. -set(gz_library_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}") +set(gz_library_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/gz/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}") # Generate the configuration file that is installed. # Note that the major version of the library is included in the name. diff --git a/loader/src/cmd/CMakeLists.txt b/loader/src/cmd/CMakeLists.txt index 3a11fbdd..7a5b1e9a 100644 --- a/loader/src/cmd/CMakeLists.txt +++ b/loader/src/cmd/CMakeLists.txt @@ -1,13 +1,13 @@ -add_library(ign STATIC ign.cc) -target_include_directories(ign PUBLIC ${CMAKE_SOURCE_DIR}/loader/include) -target_link_libraries(ign PUBLIC +add_library(gz STATIC gz.cc) +target_include_directories(gz PUBLIC ${CMAKE_SOURCE_DIR}/loader/include) +target_link_libraries(gz PUBLIC ${PROJECT_LIBRARY_TARGET_NAME} ) set(plugin_executable ign-plugin) add_executable(${plugin_executable} plugin_main.cc) target_link_libraries(${plugin_executable} - ign + gz ignition-utils${IGN_UTILS_VER}::cli ${loader} ) @@ -25,7 +25,7 @@ install( # Generate the ruby script for internal testing. # Note that the major version of the library is included in the name. # Ex: cmdplugin2.rb -set(cmd_script_generated_test "${CMAKE_BINARY_DIR}/test/lib/$/ruby/ignition/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb") +set(cmd_script_generated_test "${CMAKE_BINARY_DIR}/test/lib/$/ruby/gz/cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb") set(cmd_script_configured_test "${CMAKE_CURRENT_BINARY_DIR}/test_cmd${IGN_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb.configured") # Set the library_location variable to the full path of the library file within @@ -64,4 +64,4 @@ file(GENERATE INPUT "${cmd_script_configured}") # Install the ruby command line library in an unversioned location. -install(FILES ${cmd_script_generated} DESTINATION lib/ruby/ignition) +install(FILES ${cmd_script_generated} DESTINATION lib/ruby/gz) diff --git a/loader/src/cmd/ign.cc b/loader/src/cmd/gz.cc similarity index 99% rename from loader/src/cmd/ign.cc rename to loader/src/cmd/gz.cc index aa6af1a2..64709378 100644 --- a/loader/src/cmd/ign.cc +++ b/loader/src/cmd/gz.cc @@ -22,7 +22,7 @@ #include "gz/plugin/Loader.hh" #include "gz/plugin/config.hh" -#include "ign.hh" +#include "gz.hh" ////////////////////////////////////////////////// extern "C" void cmdPluginInfo( diff --git a/loader/src/cmd/ign.hh b/loader/src/cmd/gz.hh similarity index 100% rename from loader/src/cmd/ign.hh rename to loader/src/cmd/gz.hh diff --git a/loader/src/cmd/plugin_main.cc b/loader/src/cmd/plugin_main.cc index 3855104c..9327ea71 100644 --- a/loader/src/cmd/plugin_main.cc +++ b/loader/src/cmd/plugin_main.cc @@ -16,7 +16,7 @@ */ #include -#include "ign.hh" +#include "gz.hh" ////////////////////////////////////////////////// /// \brief Enumeration of available commands diff --git a/loader/src/ign_TEST.cc b/loader/src/gz_TEST.cc similarity index 76% rename from loader/src/ign_TEST.cc rename to loader/src/gz_TEST.cc index ab9e84db..69d266ab 100644 --- a/loader/src/ign_TEST.cc +++ b/loader/src/gz_TEST.cc @@ -28,7 +28,7 @@ using namespace gz; -static const std::string g_ignVersion("--force-version " + // NOLINT(*) +static const std::string g_gzVersion("--force-version " + // NOLINT(*) std::string(GZ_VERSION_FULL)); ///////////////////////////////////////////////// @@ -54,12 +54,12 @@ std::string custom_exec_str(std::string _cmd) } ////////////////////////////////////////////////// -/// \brief Check 'ign plugin --help'. -TEST(ignTest, IgnPluginHelp) +/// \brief Check 'gz plugin --help'. +TEST(gzTest, IgnPluginHelp) { - // Path to ign executable - std::string ign = std::string(GZ_PATH); - std::string output = custom_exec_str(ign + " plugin --help"); + // Path to gz executable + std::string gz = std::string(GZ_PATH); + std::string output = custom_exec_str(gz + " plugin --help"); EXPECT_NE(std::string::npos, output.find("-i,--info Get info about a plugin.")) << output; @@ -67,7 +67,7 @@ TEST(ignTest, IgnPluginHelp) output.find("-p,--plugin TEXT Needs: --info")) << output; - output = custom_exec_str(ign + " plugin"); + output = custom_exec_str(gz + " plugin"); EXPECT_NE(std::string::npos, output.find("-i,--info Get info about a plugin.")) << output; @@ -77,13 +77,13 @@ TEST(ignTest, IgnPluginHelp) } ////////////////////////////////////////////////// -/// \brief Check 'ign plugin --info' for a non-existent file. -TEST(ignTest, PluginInfoNonexistentLibrary) +/// \brief Check 'gz plugin --info' for a non-existent file. +TEST(gzTest, PluginInfoNonexistentLibrary) { - // Path to ign executable - std::string ign = std::string(GZ_PATH); + // Path to gz executable + std::string gz = std::string(GZ_PATH); - std::string output = custom_exec_str(ign + " plugin --info --plugin " + + std::string output = custom_exec_str(gz + " plugin --info --plugin " + "/path/to/libDoesNotExist.so"); EXPECT_NE(std::string::npos, output.find("Error while loading the library")) @@ -95,13 +95,13 @@ TEST(ignTest, PluginInfoNonexistentLibrary) } ////////////////////////////////////////////////// -/// \brief Check 'ign plugin --info' for a file that isn't a shared library. -TEST(ignTest, PluginInfoNonLibrary) +/// \brief Check 'gz plugin --info' for a file that isn't a shared library. +TEST(gzTest, PluginInfoNonLibrary) { - // Path to ign executable - std::string ign = std::string(GZ_PATH); + // Path to gz executable + std::string gz = std::string(GZ_PATH); - std::string output = custom_exec_str(ign + " plugin --info --plugin " + + std::string output = custom_exec_str(gz + " plugin --info --plugin " + std::string(GZ_PLUGIN_SOURCE_DIR) + "/core/src/Plugin.cc"); EXPECT_NE(std::string::npos, output.find("Error while loading the library")) @@ -113,13 +113,13 @@ TEST(ignTest, PluginInfoNonLibrary) } ////////////////////////////////////////////////// -/// \brief Check 'ign plugin --info' for a library that has no plugins. -TEST(ignTest, PluginInfoNonPluginLibrary) +/// \brief Check 'gz plugin --info' for a library that has no plugins. +TEST(gzTest, PluginInfoNonPluginLibrary) { - // Path to ign executable - std::string ign = std::string(GZ_PATH); + // Path to gz executable + std::string gz = std::string(GZ_PATH); - std::string output = custom_exec_str(ign + " plugin --info --plugin " + + std::string output = custom_exec_str(gz + " plugin --info --plugin " + GZ_PLUGIN_LIB); EXPECT_NE(std::string::npos, output.find("does not export any plugins. The " @@ -132,13 +132,13 @@ TEST(ignTest, PluginInfoNonPluginLibrary) } ////////////////////////////////////////////////// -/// \brief Check 'ign plugin --info' for a library with plugins. -TEST(ignTest, PluginInfoDummyPlugins) +/// \brief Check 'gz plugin --info' for a library with plugins. +TEST(gzTest, PluginInfoDummyPlugins) { - // Path to ign executable - std::string ign = std::string(GZ_PATH); + // Path to gz executable + std::string gz = std::string(GZ_PATH); - std::string output = custom_exec_str(ign + " plugin --info --plugin " + + std::string output = custom_exec_str(gz + " plugin --info --plugin " + GzDummyPlugins_LIB); EXPECT_NE(std::string::npos, output.find("Found 3 plugins in library file")) @@ -171,13 +171,13 @@ TEST(ignTest, PluginInfoDummyPlugins) } ////////////////////////////////////////////////// -/// \brief Check 'ign plugin --info' with verbose output. -TEST(ignTest, PluginInfoVerboseDummyPlugins) +/// \brief Check 'gz plugin --info' with verbose output. +TEST(gzTest, PluginInfoVerboseDummyPlugins) { - // Path to ign executable - std::string ign = std::string(GZ_PATH); + // Path to gz executable + std::string gz = std::string(GZ_PATH); - std::string output = custom_exec_str(ign + " plugin --info --plugin " + + std::string output = custom_exec_str(gz + " plugin --info --plugin " + GzDummyPlugins_LIB + " --verbose"); EXPECT_NE(std::string::npos, output.find("Known Interfaces: 7")) diff --git a/tutorials/02_installation.md b/tutorials/02_installation.md index b5d1744f..5aa3ea9c 100644 --- a/tutorials/02_installation.md +++ b/tutorials/02_installation.md @@ -45,7 +45,7 @@ sudo apt install libignition-plugin2-dev sudo apt-get install libignition-cmake3-dev libignition-tools2-dev libignition-utils2-cli-dev ``` -1. Install Gazebo Tools if you want to use the `ign plugin` command line tool: +1. Install Gazebo Tools if you want to use the `gz plugin` command line tool: ```bash sudo apt-get install ignition-tools2 @@ -128,8 +128,8 @@ Navigate to `condabin` if necessary to use the `conda` command (i.e., if Conda i Create if necessary, and activate a Conda environment: ```bash -conda create -n ign-ws -conda activate ign-ws +conda create -n gz-ws +conda activate gz-ws ``` ## Binary Installation