Skip to content

Commit

Permalink
Merge branch 'gz-msgs9' into arjo/feat/environment_data_messages
Browse files Browse the repository at this point in the history
  • Loading branch information
arjo129 authored Apr 13, 2023
2 parents 4c60886 + a167170 commit e4129c9
Show file tree
Hide file tree
Showing 13 changed files with 488 additions and 420 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Ubuntu Focal CI
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@focal
Expand All @@ -22,7 +22,7 @@ jobs:
name: Ubuntu Jammy CI
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@jammy
128 changes: 40 additions & 88 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,46 +1,32 @@
load(
"//gz_bazel:build_defs.bzl",
"@gz//bazel/skylark:build_defs.bzl",
"GZ_FEATURES",
"GZ_ROOT",
"GZ_VISIBILITY",
"cmake_configure_file",
"generate_include_header",
"generate_yaml",
"gz_config_header",
"gz_configure_header",
"gz_export_header",
"gz_include_header",
)
load(
":gz_msg_gen.bzl",
"@gz//msgs/tools:gz_msgs_generate.bzl",
"get_proto_headers",
"gz_msg_gen",
"gz_msgs_generate",
)

package(
default_visibility = GZ_VISIBILITY,
features = [
"-parse_headers",
"-layering_check",
],
features = GZ_FEATURES,
)

licenses(["notice"])
licenses(["notice"]) # Apache-2.0

exports_files(["LICENSE"])

PROJECT_NAME = "gz-msgs"

PROJECT_MAJOR = 8

PROJECT_MINOR = 0

PROJECT_PATCH = 0

# Generates config.hh based on the version numbers in CMake code.
gz_config_header(
name = "config",
gz_configure_header(
name = "msgs_config_hh",
src = "include/gz/msgs/config.hh.in",
cmakelists = ["CMakeLists.txt"],
project_name = PROJECT_NAME,
project_version = (PROJECT_MAJOR, PROJECT_MINOR, PROJECT_PATCH),
package = "msgs",
)

gz_export_header(
Expand All @@ -57,15 +43,15 @@ public_headers_no_gen = glob([

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

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

generate_include_header(
name = "msghh_genrule",
gz_include_header(
name = "msgs_hh_genrule",
out = "include/gz/msgs.hh",
hdrs = public_headers_no_gen + [
"include/gz/msgs/config.hh",
Expand Down Expand Up @@ -100,89 +86,55 @@ proto_library(
name = "gzmsgs_proto",
srcs = protos,
strip_import_prefix = "proto",
deps = [
"@com_google_protobuf//:any_proto",
],
)

# Create a library of our protobuf message files
proto_library(
name = "gzmsgs_proto_public",
srcs = protos,
strip_import_prefix = "proto",
)

# Generate our custom CC files from the protos
gz_msg_gen(
name = "gzmsgs_proto_cc",
deps = [":gzmsgs_proto"],
gz_msgs_generate(
name = "gzmsgs_cc_proto",
deps = [
":gzmsgs_proto",
"@com_google_protobuf//:any_proto",
],
)

cc_library(
name = "gz_msgs",
name = "msgs",
srcs = [
"src/Factory.cc",
"src/Filesystem.cc",
"src/Utility.cc",
":gzmsgs_proto_cc",
":gzmsgs_cc_proto",
],
hdrs = public_headers,
includes = ["include"],
deps = [
":gzmsgs_proto_cc",
GZ_ROOT + "gz_math",
":gzmsgs_cc_proto",
GZ_ROOT + "math",
"@com_google_protobuf//:protobuf",
"@tinyxml2",
],
)

# use shared library only when absolutely needd
cc_binary(
name = "libgz-msgs.so",
srcs = [
"src/gz.cc",
"src/gz.hh",
],
includes = ["include"],
linkshared = True,
linkstatic = True,
deps = [
":gz_msgs",
],
test_sources = glob(
include = ["src/*_TEST.cc"],
exclude = [],
)

[cc_test(
name = src.replace("/", "_").replace(".cc", "").replace("src_", ""),
srcs = [src],
data = [GZ_ROOT + "gz_msgs/test:desc/stringmsg.desc"],
data = [
"test/desc",
],
defines = [
'GZ_MSGS_TEST_PATH=\\"msgs/test\\"',
],
deps = [
":gz_msgs",
GZ_ROOT + "gz_math",
GZ_ROOT + "gz_msgs/test:test_utils",
":msgs",
GZ_ROOT + "common/testing",
"@gtest",
"@gtest//:gtest_main",
],
) for src in glob(
[
"src/*_TEST.cc",
],
)]

cmake_configure_file(
name = "msgs.rb",
src = "src/cmd/cmdmsgs.rb.in",
out = "cmdmsgs.rb",
cmakelists = ["CMakeLists.txt"],
defines = [
"library_location=libgz-msgs.so",
"PROJECT_VERSION_FULL=%d.%d.%d" % (PROJECT_MAJOR, PROJECT_MINOR, PROJECT_PATCH), # noqa
"GZ_LIBRARY_NAME=%s" % [PROJECT_NAME],
],
)

CMDS = " - msg : Print information about messages."

generate_yaml(
name = "msgs",
commands = CMDS,
library_name = PROJECT_NAME,
library_version = "%d.%d.%d" % (PROJECT_MAJOR, PROJECT_MINOR, PROJECT_PATCH),
ruby_target = "msgs.rb",
)
) for src in test_sources]
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
#============================================================================
# Initialize the project
#============================================================================
project(gz-msgs9 VERSION 9.3.0)
project(gz-msgs9 VERSION 9.4.0)

#============================================================================
# Find gz-cmake
Expand Down
178 changes: 0 additions & 178 deletions COPYING

This file was deleted.

Loading

0 comments on commit e4129c9

Please sign in to comment.