From aab347b3e22c71c78aaab9016bab72cac1ef9d69 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Fri, 17 Feb 2023 13:04:48 -0600 Subject: [PATCH] Add repo and dependencies for msgs Signed-off-by: Michael Carroll --- example/WORKSPACE.example | 10 ++++++++++ example/bazel.repos | 4 ++++ workspace/default.bzl | 3 +++ workspace/rules_proto/BUILD.bazel | 3 +++ workspace/rules_proto/repository.bzl | 14 ++++++++++++++ 5 files changed, 34 insertions(+) create mode 100644 workspace/rules_proto/BUILD.bazel create mode 100644 workspace/rules_proto/repository.bzl diff --git a/example/WORKSPACE.example b/example/WORKSPACE.example index 5733d18..c76e1c7 100644 --- a/example/WORKSPACE.example +++ b/example/WORKSPACE.example @@ -3,3 +3,13 @@ workspace(name = "gz") load("@gz//bazel/workspace:default.bzl", "add_default_workspace") add_default_workspace() + +load( + "@rules_proto//proto:repositories.bzl", + "rules_proto_dependencies", + "rules_proto_toolchains", +) + +rules_proto_dependencies() + +rules_proto_toolchains() diff --git a/example/bazel.repos b/example/bazel.repos index 1a18a90..0a3466c 100644 --- a/example/bazel.repos +++ b/example/bazel.repos @@ -7,6 +7,10 @@ repositories: type: git url: https://github.com/gazebosim/gz-math version: gz-math7 + msgs: + type: git + url: https://github.com/gazebosim/gz-msgs + version: mjcarroll/garden_bazel plugin: type: git url: https://github.com/gazebosim/gz-plugin diff --git a/workspace/default.bzl b/workspace/default.bzl index 7af468d..92e906d 100644 --- a/workspace/default.bzl +++ b/workspace/default.bzl @@ -5,6 +5,7 @@ load("@gz//bazel/workspace:os.bzl", "os_repository") load("@gz//bazel/workspace/bazel_skylib:repository.bzl", "bazel_skylib_repository") # noqa load("@gz//bazel/workspace/buildifier:repository.bzl", "buildifier_repository") # noqa load("@gz//bazel/workspace/pycodestyle:repository.bzl", "pycodestyle_repository") # noqa +load("@gz//bazel/workspace/rules_proto:repository.bzl", "rules_proto_repository") # noqa load("@gz//bazel/workspace/rules_python:repository.bzl", "rules_python_repository") # noqa def add_default_repositories(excludes = [], mirrors = DEFAULT_MIRRORS): @@ -22,6 +23,8 @@ def add_default_repositories(excludes = [], mirrors = DEFAULT_MIRRORS): buildifier_repository(name = "buildifier", mirrors = mirrors) if "pycodestyle" not in excludes: pycodestyle_repository(name = "pycodestyle", mirrors = mirrors) + if "rules_proto" not in excludes: + rules_proto_repository(name = "rules_proto", mirrors = mirrors) if "rules_python" not in excludes: rules_python_repository(name = "rules_python", mirrors = mirrors) diff --git a/workspace/rules_proto/BUILD.bazel b/workspace/rules_proto/BUILD.bazel new file mode 100644 index 0000000..1f52546 --- /dev/null +++ b/workspace/rules_proto/BUILD.bazel @@ -0,0 +1,3 @@ +load("@gz//bazel/lint:lint.bzl", "add_lint_tests") + +add_lint_tests() diff --git a/workspace/rules_proto/repository.bzl b/workspace/rules_proto/repository.bzl new file mode 100644 index 0000000..cc18d77 --- /dev/null +++ b/workspace/rules_proto/repository.bzl @@ -0,0 +1,14 @@ +# -*- python -*- + +load("@gz//bazel/workspace:github.bzl", "github_archive") + +def rules_proto_repository( + name, + mirrors = None): + github_archive( + name = name, + repository = "bazelbuild/rules_proto", # License: Apache-2.0 + commit = "4.0.0", + sha256 = "66bfdf8782796239d3875d37e7de19b1d94301e8972b3cbd2446b332429b4df1", # noqa + mirrors = mirrors, + )