Skip to content

Commit

Permalink
Add repo and dependencies for msgs
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <michael@openrobotics.org>
  • Loading branch information
mjcarroll committed Feb 17, 2023
1 parent 3fd8a5b commit aab347b
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 0 deletions.
10 changes: 10 additions & 0 deletions example/WORKSPACE.example
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 4 additions & 0 deletions example/bazel.repos
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions workspace/default.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions workspace/rules_proto/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
load("@gz//bazel/lint:lint.bzl", "add_lint_tests")

add_lint_tests()
14 changes: 14 additions & 0 deletions workspace/rules_proto/repository.bzl
Original file line number Diff line number Diff line change
@@ -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,
)

0 comments on commit aab347b

Please sign in to comment.