proto: adding java support proto libraries (#35092)

precursor to https://github.com/envoyproxy/envoy/pull/35021

Risk Level: low
Testing: n/a
Docs Changes: n/a
Release Notes: n/a

---------

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>

Mirrored from https://github.com/envoyproxy/envoy @ 25159be955f85bb276ce3649547fbed6ae11b3e2
main
update-envoy[bot] 9 months ago
parent 874e3aa8c3
commit 091cfd0442
  1. 11
      bazel/api_build_system.bzl
  2. 3
      bazel/repositories.bzl
  3. 13
      bazel/repository_locations.bzl

@ -22,6 +22,7 @@ _CC_PROTO_DESCRIPTOR_SUFFIX = "_cc_proto_descriptor"
_CC_GRPC_SUFFIX = "_cc_grpc"
_GO_PROTO_SUFFIX = "_go_proto"
_GO_IMPORTPATH_PREFIX = "github.com/envoyproxy/go-control-plane/"
_JAVA_PROTO_SUFFIX = "_java_proto"
_COMMON_PROTO_DEPS = [
"@com_google_protobuf//:any_proto",
@ -67,7 +68,8 @@ def api_cc_py_proto_library(
srcs = [],
deps = [],
linkstatic = 0,
has_services = 0):
has_services = 0,
java = True):
relative_name = ":" + name
proto_library(
name = name,
@ -109,6 +111,13 @@ def api_cc_py_proto_library(
visibility = ["//visibility:public"],
)
if java:
native.java_proto_library(
name = name + _JAVA_PROTO_SUFFIX,
visibility = ["//visibility:public"],
deps = [relative_name],
)
# Optionally define gRPC services
if has_services:
# TODO: when Python services are required, add to the below stub generations.

@ -16,6 +16,9 @@ def api_dependencies():
external_http_archive(
name = "bazel_skylib",
)
external_http_archive(
name = "rules_jvm_external",
)
external_http_archive(
name = "com_envoyproxy_protoc_gen_validate",
patch_args = ["-p1"],

@ -34,6 +34,19 @@ REPOSITORY_LOCATIONS_SPEC = dict(
license = "Apache-2.0",
license_url = "https://github.com/bufbuild/protoc-gen-validate/blob/v{version}/LICENSE",
),
rules_jvm_external = dict(
project_name = "Java Rules for Bazel",
project_desc = "Bazel rules for Java",
project_url = "https://github.com/bazelbuild/rules_jvm_external",
version = "6.1",
strip_prefix = "rules_jvm_external-{version}",
sha256 = "08ea921df02ffe9924123b0686dc04fd0ff875710bfadb7ad42badb931b0fd50",
urls = ["https://github.com/bazelbuild/rules_jvm_external/releases/download/{version}/rules_jvm_external-{version}.tar.gz"],
release_date = "2024-04-26",
use_category = ["build"],
license = "Apache-2.0",
license_url = "https://github.com/bazelbuild/rules_jvm_external/blob/{version}/LICENSE",
),
com_github_cncf_xds = dict(
project_name = "xDS API",
project_desc = "xDS API Working Group (xDS-WG)",

Loading…
Cancel
Save