Skip to content

Commit a1ba495

Browse files
committed
Merge remote-tracking branch 'origin/gz-plugin3' into scpeters/merge_3_main
2 parents 1777f47 + c3cbe4a commit a1ba495

File tree

9 files changed

+176
-70
lines changed

9 files changed

+176
-70
lines changed

.bazelrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
common --enable_bzlmod
2+
common --lockfile_mode=off
3+
4+
# Add C++17 compiler flags.
5+
build --cxxopt=-std=c++17
6+
build --host_cxxopt=-std=c++17
7+
8+
build --force_pic
9+
build --strip=never
10+
build --strict_system_includes
11+
build --fission=dbg
12+
build --features=per_object_debug_info

.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.3.1

.github/workflows/bazel.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Bazel CI
2+
on:
3+
push:
4+
branches: [gz-plugin3, main]
5+
pull_request:
6+
branches: [gz-plugin3, main]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
test:
14+
uses: bazel-contrib/.github/.github/workflows/bazel.yaml@v7
15+
with:
16+
folders: |
17+
[
18+
".",
19+
]
20+
exclude: |
21+
[
22+
{"folder": ".", "bzlmodEnabled": false},
23+
]

.github/workflows/ci.bazelrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file contains Bazel settings to apply on CI only.
2+
# It is referenced with a --bazelrc option in the call to bazel in ci.yaml
3+
4+
# Debug where options came from
5+
build --announce_rc
6+
# This directory is configured in GitHub actions to be persisted between runs.
7+
# We do not enable the repository cache to cache downloaded external artifacts
8+
# as these are generally faster to download again than to fetch them from the
9+
# GitHub actions cache.
10+
build --disk_cache=~/.cache/bazel
11+
# Don't rely on test logs being easily accessible from the test runner,
12+
# though it makes the log noisier.
13+
test --test_output=errors
14+
# Allows tests to run bazelisk-in-bazel, since this is the cache folder used
15+
test --test_env=XDG_CACHE_HOME

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ build_*
55
# OS generated files
66
.DS_Store
77
*.swp
8+
9+
# Bazel generated files
10+
bazel-*

BUILD.bazel

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
1-
load(
2-
"@gz//bazel/skylark:build_defs.bzl",
3-
"GZ_ROOT",
4-
"GZ_VISIBILITY",
5-
"gz_configure_header",
6-
"gz_export_header",
7-
"gz_include_header",
8-
)
1+
load("@rules_gazebo//gazebo:headers.bzl", "gz_configure_header", "gz_export_header")
2+
load("@rules_license//rules:license.bzl", "license")
93

104
package(
11-
default_visibility = GZ_VISIBILITY,
5+
default_applicable_licenses = [":license"],
6+
features = [
7+
"layering_check",
8+
"parse_headers",
9+
],
10+
)
11+
12+
license(
13+
name = "license",
14+
package_name = "gz-plugin",
1215
)
1316

14-
licenses(["notice"]) # Apache-2.0
17+
licenses(["notice"])
1518

1619
gz_configure_header(
17-
name = "config",
20+
name = "Config",
1821
src = "core/include/gz/plugin/config.hh.in",
19-
cmakelists = ["CMakeLists.txt"],
20-
package = "plugin",
22+
out = "core/include/gz/plugin/config.hh",
23+
package_xml = "package.xml",
2124
)
2225

2326
gz_export_header(
24-
name = "core/include/gz/plugin/Export.hh",
27+
name = "Export",
28+
out = "core/include/gz/plugin/Export.hh",
2529
export_base = "GZ_PLUGIN",
2630
lib_name = "gz-plugin",
27-
visibility = ["//visibility:private"],
2831
)
2932

3033
public_headers_no_gen = glob([
@@ -37,28 +40,19 @@ sources = glob(
3740
exclude = ["core/src/*_TEST.cc"],
3841
)
3942

40-
gz_include_header(
41-
name = "pluginhh_genrule",
42-
out = "core/include/gz/plugin.hh",
43-
hdrs = public_headers_no_gen + [
44-
"core/include/gz/plugin/Export.hh",
45-
"core/include/gz/plugin/config.hh",
46-
],
47-
)
48-
4943
public_headers = public_headers_no_gen + [
5044
"core/include/gz/plugin/config.hh",
5145
"core/include/gz/plugin/Export.hh",
52-
"core/include/gz/plugin.hh",
5346
]
5447

5548
cc_library(
5649
name = "core",
5750
srcs = sources,
5851
hdrs = public_headers,
5952
includes = ["core/include"],
53+
visibility = ["//visibility:public"],
6054
deps = [
61-
GZ_ROOT + "utils",
55+
"@gz-utils//:SuppressWarning",
6256
],
6357
)
6458

@@ -67,8 +61,8 @@ cc_library(
6761
srcs = [src],
6862
deps = [
6963
":core",
70-
"@gtest",
71-
"@gtest//:gtest_main",
64+
"@googletest//:gtest",
65+
"@googletest//:gtest_main",
7266
],
7367
) for src in glob(
7468
[
@@ -89,17 +83,18 @@ cc_library(
8983
includes = [
9084
"register/include",
9185
],
86+
visibility = ["//visibility:public"],
9287
deps = [
9388
":core",
9489
":loader",
9590
],
9691
)
9792

9893
gz_export_header(
99-
name = "loader/include/gz/plugin/loader/Export.hh",
94+
name = "loader_export",
95+
out = "loader/include/gz/plugin/loader/Export.hh",
10096
export_base = "GZ_PLUGIN_LOADER",
10197
lib_name = "gz-plugin-loader",
102-
visibility = ["//visibility:private"],
10398
)
10499

105100
cc_library(
@@ -117,26 +112,26 @@ cc_library(
117112
"loader/include/gz/plugin/loader/Export.hh",
118113
],
119114
includes = ["loader/include"],
115+
visibility = ["//visibility:public"],
120116
deps = [
121117
":core",
122-
GZ_ROOT + "utils",
118+
"@gz-utils//:SuppressWarning",
123119
],
124120
)
125121

126122
cc_test(
127123
name = "Loader_TEST",
128124
srcs = [
129125
"loader/src/Loader_TEST.cc",
130-
":config",
131126
],
132127
defines = [
133-
'GzDummyPlugins_LIB=\\"./plugin/test/libGzDummyPlugins.so\\"',
128+
'GzDummyPlugins_LIB=\\"./test/libGzDummyPlugins.so\\"',
134129
],
135130
deps = [
136131
":core",
137132
":loader",
138-
GZ_ROOT + "plugin/test:test_plugins",
139-
"@gtest",
140-
"@gtest//:gtest_main",
133+
"//test:test_plugins",
134+
"@googletest//:gtest",
135+
"@googletest//:gtest_main",
141136
],
142137
)

Changelog.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@
44

55
## Gazebo Plugin 3.x
66

7+
### Gazebo Plugin 3.1.0 (2025-05-14)
8+
9+
1. Migrate bazel build setup to use bzlmod
10+
* [Pull request #176](https://github.com/gazebosim/gz-plugin/pull/176)
11+
* [Pull request #177](https://github.com/gazebosim/gz-plugin/pull/177)
12+
13+
1. ci: run cppcheck, cpplint, doxygen on noble
14+
* [Pull request #172](https://github.com/gazebosim/gz-plugin/pull/172)
15+
16+
1. used codespell to fix spellcheck errors (#168)
17+
* [Pull request #169](https://github.com/gazebosim/gz-plugin/pull/#169)
18+
19+
1. Update README.md - fix windows badge
20+
* [Pull request #166](https://github.com/gazebosim/gz-plugin/pull/166)
21+
722
### Gazebo Plugin 3.0.1 (2025-02-12)
823

924
1. Require cmake 3.10.2 for consistency

MODULE.bazel

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## MODULE.bazel
2+
module(
3+
name = "gz-plugin",
4+
repo_name = "org_gazebosim_gz-plugin",
5+
)
6+
7+
bazel_dep(name = "googletest", version = "1.14.0")
8+
bazel_dep(name = "rules_license", version = "1.0.0")
9+
10+
# Gazebo Dependencies
11+
bazel_dep(name = "rules_gazebo", version = "0.0.2")
12+
bazel_dep(name = "gz-utils")
13+
14+
archive_override(
15+
module_name = "gz-utils",
16+
strip_prefix = "gz-utils-main",
17+
urls = ["https://github.com/gazebosim/gz-utils/archive/refs/heads/main.tar.gz"],
18+
)

0 commit comments

Comments
 (0)