bazel/tooling: Use toolshed `json_data` macro (#29790)

As this is used in the api as well as Envoy itself the dep has
been moved there.

Signed-off-by: phlax <phlax@users.noreply.github.com>

Mirrored from https://github.com/envoyproxy/envoy @ b0fec2ecdd54cf8a92a04a6d2481cdacd65c9d36
main
update-envoy[bot] 1 year ago
parent 3887ffe42b
commit 2879bdc243
  1. 2
      bazel/BUILD
  2. 4
      bazel/repositories.bzl
  3. 14
      bazel/repository_locations.bzl
  4. 18
      bazel/utils.bzl

@ -1,5 +1,5 @@
load("@envoy_toolshed//:macros.bzl", "json_data")
load("@io_bazel_rules_go//proto:compiler.bzl", "go_proto_compiler")
load(":utils.bzl", "json_data")
load(":repository_locations.bzl", "REPOSITORY_LOCATIONS_SPEC")
load(":repository_locations_utils.bzl", "load_repository_locations_spec")
load(

@ -56,6 +56,10 @@ def api_dependencies():
name = "com_github_chrusty_protoc_gen_jsonschema",
)
external_http_archive(
name = "envoy_toolshed",
)
PROMETHEUSMETRICS_BUILD_CONTENT = """
load("@envoy_api//bazel:api_build_system.bzl", "api_cc_py_proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")

@ -151,4 +151,18 @@ REPOSITORY_LOCATIONS_SPEC = dict(
use_category = ["build"],
release_date = "2023-05-30",
),
envoy_toolshed = dict(
project_name = "envoy_toolshed",
project_desc = "Tooling, libraries, runners and checkers for Envoy proxy's CI",
project_url = "https://github.com/envoyproxy/toolshed",
version = "0.0.6",
sha256 = "7047db983e49290ac14b2733459d439a8a521ff49e95fbd0b185a692bd6a6d86",
strip_prefix = "toolshed-bazel-v{version}/bazel",
urls = ["https://github.com/envoyproxy/toolshed/archive/refs/tags/bazel-v{version}.tar.gz"],
use_category = ["build"],
release_date = "2023-09-24",
cpe = "N/A",
license = "Apache-2.0",
license_url = "https://github.com/envoyproxy/envoy/blob/bazel-v{version}/LICENSE",
),
)

@ -1,18 +0,0 @@
load("@bazel_skylib//rules:write_file.bzl", "write_file")
def json_data(
name,
data,
visibility = ["//visibility:public"],
**kwargs):
"""Write a bazel object to a file
The provided `data` object should be json serializable.
"""
write_file(
name = name,
out = "%s.json" % name,
content = json.encode(data).split("\n"),
visibility = visibility,
**kwargs
)
Loading…
Cancel
Save