Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bumps in ionic: gz-plugin3 #127

Merged
merged 5 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,17 @@ name: Ubuntu CI
on: [push, pull_request]

jobs:
focal-ci:
jammy-ci:
runs-on: ubuntu-latest
name: Ubuntu Focal CI
name: Ubuntu Jammy CI
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@focal
uses: gazebo-tooling/action-gz-ci@jammy
with:
codecov-enabled: true
cppcheck-enabled: true
cpplint-enabled: true
doxygen-enabled: true
jammy-ci:
runs-on: ubuntu-latest
name: Ubuntu Jammy CI
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@jammy
10 changes: 5 additions & 5 deletions MigrationFromCommon.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ framework. Some of the instructions here may also be useful to new adopters of
just wants to use `PluginPtr` objects can link to `core`, e.g.:

```
target_link_libraries(my_target PUBLIC gz-plugin2::core)
target_link_libraries(my_target PUBLIC gz-plugin3::core)
```

However, if your code wants to be able to load plugins, it should link to the
`loader` component. In most cases, it should probably link privately, unless you
need the `gz::plugin::Loader` class to be part of your library's API:

```
target_link_libraries(my_target PRIVATE gz-plugin2::loader)
target_link_libraries(my_target PRIVATE gz-plugin3::loader)
```

If `gz::plugin::PluginPtr` objects are part of your library's API, then
Expand All @@ -28,9 +28,9 @@ you may want `loader` to be private while `core` is public:
```
target_link_libraries(my_target
PUBLIC
gz-plugin2::core
gz-plugin3::core
PRIVATE
gz-plugin2::loader
gz-plugin3::loader
)
```

Expand All @@ -39,7 +39,7 @@ then you should link against the `register` component. This should almost always
be a private link, since plugin registration is purely internal for a library:

```
target_link_libraries(my_plugin PRIVATE gz-plugin2::register)
target_link_libraries(my_plugin PRIVATE gz-plugin3::register)
```

# Registering a plugin
Expand Down
8 changes: 4 additions & 4 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ project(examples)
find_package(gz-plugin3 QUIET REQUIRED COMPONENTS all)
set(GZ_PLUGIN_VER ${gz-plugin3_VERSION_MAJOR})

find_package(gz-common5 QUIET)
set(GZ_COMMON_VER ${gz-common5_VERSION_MAJOR})
find_package(gz-common6 QUIET)
set(GZ_COMMON_VER ${gz-common6_VERSION_MAJOR})

find_package(gz-math7 QUIET)
set(GZ_MATH_VER ${gz-math7_VERSION_MAJOR})
find_package(gz-math8 QUIET)
set(GZ_MATH_VER ${gz-math8_VERSION_MAJOR})

add_subdirectory(plugins)

Expand Down
4 changes: 2 additions & 2 deletions loader/conf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(gz_library_path "${CMAKE_BINARY_DIR}/test/lib/$<CONFIG>/ruby/gz/cmd${GZ_DESI

# Generate a configuration file for internal testing.
# Note that the major version of the library is included in the name.
# Ex: plugin2.yaml
# Ex: plugin3.yaml
configure_file(
"${GZ_DESIGNATION}.yaml.in"
"${CMAKE_CURRENT_BINARY_DIR}/${GZ_DESIGNATION}${PROJECT_VERSION_MAJOR}.yaml.configured" @ONLY)
Expand All @@ -17,7 +17,7 @@ set(gz_library_path "${CMAKE_INSTALL_PREFIX}/lib/ruby/gz/cmd${GZ_DESIGNATION}${P

# Generate the configuration file that is installed.
# Note that the major version of the library is included in the name.
# Ex: plugin2.yaml
# Ex: plugin3.yaml
configure_file(
"${GZ_DESIGNATION}.yaml.in"
"${CMAKE_CURRENT_BINARY_DIR}/${GZ_DESIGNATION}${PROJECT_VERSION_MAJOR}.yaml" @ONLY)
Expand Down
4 changes: 2 additions & 2 deletions loader/src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,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
# Ex: cmdplugin3.rb
set(cmd_script_generated_test "${CMAKE_BINARY_DIR}/test/lib/$<CONFIG>/ruby/gz/cmd${GZ_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb")
set(cmd_script_configured_test "${CMAKE_CURRENT_BINARY_DIR}/test_cmd${GZ_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb.configured")

Expand All @@ -46,7 +46,7 @@ file(GENERATE
# Used for the installed version.
# Generate the ruby script that gets installed.
# Note that the major version of the library is included in the name.
# Ex: cmdplugin2.rb
# Ex: cmdplugin3.rb
set(cmd_script_generated "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/cmd${GZ_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb")
set(cmd_script_configured "${CMAKE_CURRENT_BINARY_DIR}/cmd${GZ_DESIGNATION}${PROJECT_VERSION_MAJOR}.rb.configured")

Expand Down
46 changes: 23 additions & 23 deletions test/integration/plugin.cc
azeey marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -257,54 +257,54 @@ void TestSetAndMapUsage(
const gz::plugin::PluginPtr &plugin)
{
PluginPtrType1 plugin1 = plugin;
PluginPtrType2 plugin2 = plugin1;
PluginPtrType2 plugin3 = plugin1;

EXPECT_TRUE(plugin1 == plugin);
EXPECT_TRUE(plugin1 == plugin2);
EXPECT_FALSE(plugin1 != plugin2);
EXPECT_TRUE(plugin1 == plugin3);
EXPECT_FALSE(plugin1 != plugin3);

EXPECT_TRUE(plugin2 == plugin);
EXPECT_TRUE(plugin2 == plugin1);
EXPECT_FALSE(plugin2 != plugin1);
EXPECT_TRUE(plugin3 == plugin);
EXPECT_TRUE(plugin3 == plugin1);
EXPECT_FALSE(plugin3 != plugin1);

std::set<gz::plugin::PluginPtr> orderedSet;
EXPECT_TRUE(orderedSet.insert(plugin1).second);
EXPECT_FALSE(orderedSet.insert(plugin1).second);
EXPECT_FALSE(orderedSet.insert(plugin2).second);
EXPECT_FALSE(orderedSet.insert(plugin3).second);

std::unordered_set<gz::plugin::PluginPtr> unorderedSet;
EXPECT_TRUE(unorderedSet.insert(plugin1).second);
EXPECT_FALSE(unorderedSet.insert(plugin1).second);
EXPECT_FALSE(unorderedSet.insert(plugin2).second);
EXPECT_FALSE(unorderedSet.insert(plugin3).second);

std::map<gz::plugin::PluginPtr, std::string> orderedMap;
EXPECT_TRUE(orderedMap.insert(std::make_pair(plugin1, "some string")).second);
EXPECT_FALSE(orderedMap.insert(std::make_pair(plugin1, "a string")).second);
EXPECT_FALSE(orderedMap.insert(std::make_pair(plugin2, "chars")).second);
EXPECT_FALSE(orderedMap.insert(std::make_pair(plugin3, "chars")).second);

std::unordered_map<gz::plugin::PluginPtr, std::string> unorderedMap;
EXPECT_TRUE(unorderedMap.insert(std::make_pair(plugin1, "strings")).second);
EXPECT_FALSE(unorderedMap.insert(std::make_pair(plugin1, "letters")).second);
EXPECT_FALSE(unorderedMap.insert(std::make_pair(plugin2, "")).second);
EXPECT_FALSE(unorderedMap.insert(std::make_pair(plugin3, "")).second);


plugin2 = loader.Instantiate("test::util::DummyMultiPlugin");
EXPECT_TRUE(plugin1 != plugin2);
EXPECT_FALSE(plugin1 == plugin2);
EXPECT_TRUE(plugin2 != plugin1);
EXPECT_FALSE(plugin2 == plugin1);
plugin3 = loader.Instantiate("test::util::DummyMultiPlugin");
EXPECT_TRUE(plugin1 != plugin3);
EXPECT_FALSE(plugin1 == plugin3);
EXPECT_TRUE(plugin3 != plugin1);
EXPECT_FALSE(plugin3 == plugin1);

EXPECT_TRUE(orderedSet.insert(plugin2).second);
EXPECT_FALSE(orderedSet.insert(plugin2).second);
EXPECT_TRUE(orderedSet.insert(plugin3).second);
EXPECT_FALSE(orderedSet.insert(plugin3).second);

EXPECT_TRUE(unorderedSet.insert(plugin2).second);
EXPECT_FALSE(unorderedSet.insert(plugin2).second);
EXPECT_TRUE(unorderedSet.insert(plugin3).second);
EXPECT_FALSE(unorderedSet.insert(plugin3).second);

EXPECT_TRUE(orderedMap.insert(std::make_pair(plugin2, "letters")).second);
EXPECT_FALSE(orderedMap.insert(std::make_pair(plugin2, "chars")).second);
EXPECT_TRUE(orderedMap.insert(std::make_pair(plugin3, "letters")).second);
EXPECT_FALSE(orderedMap.insert(std::make_pair(plugin3, "chars")).second);

EXPECT_TRUE(unorderedMap.insert(std::make_pair(plugin2, "abc")).second);
EXPECT_FALSE(unorderedMap.insert(std::make_pair(plugin2, "def")).second);
EXPECT_TRUE(unorderedMap.insert(std::make_pair(plugin3, "abc")).second);
EXPECT_FALSE(unorderedMap.insert(std::make_pair(plugin3, "def")).second);
}

/////////////////////////////////////////////////
Expand Down
10 changes: 5 additions & 5 deletions tutorials/02_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
On Ubuntu systems, `apt-get` can be used to install `gz-plugin`:
```bash
sudo apt-get update
sudo apt install libgz-plugin2-dev
sudo apt install libgz-plugin3-dev
```

## Source Installation

1. Install Gazebo dependencies
```
sudo apt-get install libgz-cmake3-dev libgz-tools2-dev libgz-utils2-cli-dev
sudo apt-get install libgz-cmake4-dev libgz-tools3-dev libgz-utils3-cli-dev
```

1. Install Gazebo Tools if you want to use the `gz plugin` command line tool:
```bash
sudo apt-get install gz-tools2
sudo apt-get install gz-tools3
```

2. Clone the repository
Expand Down Expand Up @@ -91,15 +91,15 @@ Sierra (10.12) or later.
2. Run the following commands
```bash
brew tap osrf/simulation
brew install gz-plugin2
brew install gz-plugin3
```

## Source Installation

1. Install dependencies
```bash
brew tap osrf/simulation
brew install gz-plugin2 --only-dependencies
brew install gz-plugin3 --only-dependencies
```

2. Clone the repository
Expand Down