Skip to content

Commit

Permalink
Merge branch 'gazebosim:gz-msgs10' into pr-camtrack-gz-msgs9
Browse files Browse the repository at this point in the history
  • Loading branch information
bperseghetti authored May 6, 2024
2 parents f2c7ce5 + a163b16 commit 0a8a74d
Show file tree
Hide file tree
Showing 126 changed files with 6,540 additions and 4,156 deletions.
2 changes: 2 additions & 0 deletions .github/ci/after_make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# It's necessary to install the python modules for the test.
make install
2 changes: 2 additions & 0 deletions .github/ci/packages.apt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ libprotoc-dev
libtinyxml2-dev
protobuf-compiler
ruby
python3-pytest
python3-protobuf
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
11 changes: 11 additions & 0 deletions .github/workflows/package_xml.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ build_*
.DS_Store
*.swp
*.orig

# Python generated files
__pycache__
185 changes: 153 additions & 32 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,41 @@ load(
"GZ_FEATURES",
"GZ_ROOT",
"GZ_VISIBILITY",
"gz_configure_file",
"gz_configure_header",
"gz_export_header",
"gz_include_header",
)
load(
"@gz//bazel/lint:lint.bzl",
"add_lint_tests",
)
load(
"@gz//msgs/tools:gz_msgs_generate.bzl",
"get_proto_headers",
"gz_msgs_generate",
"gz_proto_factory",
"gz_proto_library",
)
load("@rules_license//rules:license.bzl", "license")

package(
default_applicable_licenses = [GZ_ROOT + "msgs:license"],
default_visibility = GZ_VISIBILITY,
features = GZ_FEATURES,
)

licenses(["notice"]) # Apache-2.0
license(
name = "license",
package_name = "gz-msgs",
)

licenses(["notice"])

exports_files(["LICENSE"])

gz_configure_header(
name = "msgs_config_hh",
src = "include/gz/msgs/config.hh.in",
src = "core/include/gz/msgs/config.hh.in",
out = "include/gz/msgs/config.hh",
cmakelists = ["CMakeLists.txt"],
package = "msgs",
)
Expand All @@ -37,43 +50,29 @@ gz_export_header(
)

public_headers_no_gen = glob([
"include/gz/msgs/*.hh",
"include/gz/msgs/detail/*.hh",
"core/include/gz/msgs/*.hh",
"core/include/gz/msgs/convert/*.hh",
"core/include/gz/msgs/detail/*.hh",
])

protos = glob(["proto/gz/msgs/*.proto"])

gz_include_header(
name = "messagetypes_hh_genrule",
out = "include/gz/msgs/MessageTypes.hh",
hdrs = get_proto_headers(protos),
strip_prefix = ["gz_msgs"],
)

gz_include_header(
name = "msgs_hh_genrule",
out = "include/gz/msgs.hh",
hdrs = public_headers_no_gen + [
"include/gz/msgs/config.hh",
"include/gz/msgs/Export.hh",
"include/gz/msgs/MessageTypes.hh",
],
)

public_headers = public_headers_no_gen + [
"include/gz/msgs/config.hh",
"include/gz/msgs/Export.hh",
"include/gz/msgs/MessageTypes.hh",
"include/gz/msgs.hh",
]

# Custom Gazebo Protoc plugin
cc_binary(
name = "gz_msgs_gen",
srcs = [
"src/Generator.cc",
"src/Generator.hh",
"src/generator_main.cc",
"core/generator_lite/Generator.cc",
"core/generator_lite/Generator.hh",
"core/generator_lite/generator_main.cc",
],
deps = [
"@com_google_protobuf//:protobuf",
Expand All @@ -91,26 +90,51 @@ proto_library(
],
)

gz_msgs_generate(
gz_proto_library(
name = "gzmsgs_cc_proto",
proto_deps = [":gzmsgs_proto"],
deps = [
":gzmsgs_proto",
"@com_google_protobuf//:any_proto",
"@com_google_protobuf//:protobuf",
],
)

gz_proto_factory(
name = "gzmsgs_proto_factory",
cc_output = "core/src/RegisterMsgs.cc",
hh_output = "include/gz/msgs/MessageTypes.hh",
deps = [":gzmsgs_proto"],
)

public_headers = public_headers_no_gen + [
"include/gz/msgs/config.hh",
"include/gz/msgs/Export.hh",
"include/gz/msgs.hh",
"include/gz/msgs/MessageTypes.hh",
]

cc_library(
name = "msgs",
srcs = [
"src/Factory.cc",
"src/Filesystem.cc",
"src/Utility.cc",
":gzmsgs_cc_proto",
"core/src/DynamicFactory.cc",
"core/src/DynamicFactory.hh",
"core/src/Factory.cc",
"core/src/MessageFactory.cc",
"core/src/RegisterMsgs.cc",
"core/src/impl/InstallationDirectories.cc",
],
hdrs = public_headers,
includes = ["include"],
copts = [
"-Wno-duplicate-decl-specifier",
"-fexceptions",
],
includes = [
"core/include",
"core/src",
"include",
],
deps = [
":gzmsgs_cc_proto",
":gzmsgs_proto_factory",
GZ_ROOT + "math",
"@com_google_protobuf//:protobuf",
"@tinyxml2",
Expand Down Expand Up @@ -138,3 +162,100 @@ test_sources = glob(
"@gtest//:gtest_main",
],
) for src in test_sources]

cc_test(
name = "INTEGRATION_headers",
srcs = ["test/integration/headers.cc"],
deps = [
":gzmsgs_cc_proto",
"@gtest",
"@gtest//:gtest_main",
],
)

cc_test(
name = "INTEGRATION_image_msg",
srcs = ["test/integration/image_msg.cc"],
deps = [
":gzmsgs_cc_proto",
"@gtest",
"@gtest//:gtest_main",
],
)

cc_test(
name = "INTEGRATION_Utility",
srcs = ["test/integration/Utility_TEST.cc"],
deps = [
":msgs",
GZ_ROOT + "common/testing",
"@gtest",
"@gtest//:gtest_main",
],
)

cc_test(
name = "INTEGRATION_Factory",
srcs = ["test/integration/Factory_TEST.cc"],
data = ["test/desc/stringmsg.desc"],
defines = [
'GZ_MSGS_TEST_PATH=\\"msgs/test\\"',
],
deps = [
":msgs",
GZ_ROOT + "common/testing",
"@gtest",
"@gtest//:gtest_main",
],
)

cc_test(
name = "INTEGRATION_descriptors",
srcs = ["test/integration/descriptors.cc"],
data = ["test/desc"],
defines = [
'GZ_MSGS_TEST_PATH=\\"msgs/test\\"',
],
deps = [
":msgs",
GZ_ROOT + "common/testing",
"@gtest",
"@gtest//:gtest_main",
],
)

gz_configure_file(
name = "msgs_yaml",
src = "conf/msgs.yaml.in",
out = "msgs.yaml",
defines = [
"PROJECT_NAME_NO_VERSION_LOWER=msgs",
"gz_library_path=msgs/cmdmsgs",
],
package = "msgs",
)

gz_configure_file(
name = "msgs_rb",
src = "core/src/cmd/cmdmsgs.rb.in",
out = "cmdmsgs.rb",
defines = [
"library_location=libgz-msgs.so",
],
package = "msgs",
)

cc_binary(
name = "gz-msgs",
srcs = ["core/src/gz.cc"],
data = [
"cmdmsgs.rb",
"msgs.yaml",
":gzmsgs_proto",
],
linkshared = True,
linkstatic = True,
deps = [":msgs"],
)

add_lint_tests()
Loading

0 comments on commit 0a8a74d

Please sign in to comment.