diff --git a/api/bazel/BUILD b/api/bazel/BUILD index a8b7b161067fd..324a17d4fd374 100644 --- a/api/bazel/BUILD +++ b/api/bazel/BUILD @@ -1,6 +1,7 @@ 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") licenses(["notice"]) # Apache 2 @@ -20,5 +21,5 @@ go_proto_compiler( json_data( name = "repository_locations", - data = REPOSITORY_LOCATIONS_SPEC, + data = load_repository_locations_spec(REPOSITORY_LOCATIONS_SPEC), ) diff --git a/api/bazel/repository_locations_utils.bzl b/api/bazel/repository_locations_utils.bzl index 3b984e1bc580a..363659514fb32 100644 --- a/api/bazel/repository_locations_utils.bzl +++ b/api/bazel/repository_locations_utils.bzl @@ -18,3 +18,9 @@ def load_repository_locations_spec(repository_locations_spec): mutable_location["strip_prefix"] = _format_version(location["strip_prefix"], location["version"]) mutable_location["urls"] = [_format_version(url, location["version"]) for url in location["urls"]] return locations + +def merge_dicts(*dicts): + result = {} + for d in dicts: + result.update(d) + return result diff --git a/bazel/BUILD b/bazel/BUILD index b4f803b237032..85769e17555a7 100644 --- a/bazel/BUILD +++ b/bazel/BUILD @@ -5,6 +5,8 @@ load("//bazel:utils.bzl", "json_data") load("@bazel_skylib//lib:selects.bzl", "selects") load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") load(":repository_locations.bzl", "REPOSITORY_LOCATIONS_SPEC") +load("@envoy_api//bazel:repository_locations.bzl", API_REPOSITORY_LOCATIONS_SPEC = "REPOSITORY_LOCATIONS_SPEC") +load("@envoy_api//bazel:repository_locations_utils.bzl", "load_repository_locations_spec", "merge_dicts") licenses(["notice"]) # Apache 2 @@ -601,5 +603,13 @@ alias( json_data( name = "repository_locations", - data = REPOSITORY_LOCATIONS_SPEC, + data = load_repository_locations_spec(REPOSITORY_LOCATIONS_SPEC), +) + +json_data( + name = "all_repository_locations", + data = merge_dicts( + load_repository_locations_spec(REPOSITORY_LOCATIONS_SPEC), + load_repository_locations_spec(API_REPOSITORY_LOCATIONS_SPEC), + ), )