From 7a7efe9e645d837aab57736735532281cd621699 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Thu, 11 Apr 2024 04:32:18 -0700 Subject: [PATCH] Add bzl_libraries to protobuf PiperOrigin-RevId: 623784182 --- bazel/BUILD | 26 ---------------- bazel/BUILD.bazel | 57 ++++++++++++++++++++++++++++++++++++ bazel/common/BUILD.bazel | 22 ++++++++++++++ bazel/private/BUILD.bazel | 8 +++++ bazel/toolchains/BUILD.bazel | 23 +++++++++++++++ 5 files changed, 110 insertions(+), 26 deletions(-) delete mode 100644 bazel/BUILD create mode 100644 bazel/BUILD.bazel diff --git a/bazel/BUILD b/bazel/BUILD deleted file mode 100644 index 89eb04943a..0000000000 --- a/bazel/BUILD +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2009-2021, Google LLC -# All rights reserved. -# -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file or at -# https://developers.google.com/open-source/licenses/bsd - -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - -# begin:google_only -# package(default_applicable_licenses = ["//upb:license"]) -# end:google_only - -licenses(["notice"]) - -bzl_library( - name = "upb_proto_library_bzl", - srcs = [ - "upb_c_proto_library.bzl", - "upb_minitable_proto_library.bzl", - "upb_proto_library.bzl", - "upb_proto_reflection_library.bzl", - ], - visibility = ["//visibility:public"], - deps = ["//bazel/private:upb_proto_library_internal_bzl"], -) diff --git a/bazel/BUILD.bazel b/bazel/BUILD.bazel new file mode 100644 index 0000000000..1d6749dd76 --- /dev/null +++ b/bazel/BUILD.bazel @@ -0,0 +1,57 @@ +# Copyright (c) 2009-2021, Google LLC +# All rights reserved. +# +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file or at +# https://developers.google.com/open-source/licenses/bsd + +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + +licenses(["notice"]) + +bzl_library( + name = "proto_library_bzl", + srcs = ["proto_library.bzl"], + visibility = ["//visibility:public"], +) + +bzl_library( + name = "cc_proto_library_bzl", + srcs = ["cc_proto_library.bzl"], + visibility = ["//visibility:public"], +) + +bzl_library( + name = "java_proto_library_bzl", + srcs = ["java_proto_library.bzl"], + visibility = ["//visibility:public"], +) + +bzl_library( + name = "java_lite_proto_library_bzl", + srcs = ["java_lite_proto_library.bzl"], + visibility = ["//visibility:public"], +) + +bzl_library( + name = "py_proto_library_bzl", + srcs = ["py_proto_library.bzl"], + visibility = ["//visibility:public"], + deps = [ + "//bazel/common:proto_common_bzl", + "//bazel/common:proto_info_bzl", + "@rules_python//python:py_info_bzl", + ], +) + +bzl_library( + name = "upb_proto_library_bzl", + srcs = [ + "upb_c_proto_library.bzl", + "upb_minitable_proto_library.bzl", + "upb_proto_library.bzl", + "upb_proto_reflection_library.bzl", + ], + visibility = ["//visibility:public"], + deps = ["//bazel/private:upb_proto_library_internal_bzl"], +) diff --git a/bazel/common/BUILD.bazel b/bazel/common/BUILD.bazel index fc024fea3c..a12df87ac9 100644 --- a/bazel/common/BUILD.bazel +++ b/bazel/common/BUILD.bazel @@ -10,3 +10,25 @@ bzl_library( "//bazel/private:native_bzl", ], ) + +bzl_library( + name = "proto_info_bzl", + srcs = [ + "proto_info.bzl", + ], + visibility = ["//visibility:public"], + deps = [ + "//bazel/private:native_bzl", + ], +) + +bzl_library( + name = "proto_lang_toolchain_info_bzl", + srcs = [ + "proto_lang_toolchain_info.bzl", + ], + visibility = ["//visibility:public"], + deps = [ + ":proto_common.bzl", + ], +) diff --git a/bazel/private/BUILD.bazel b/bazel/private/BUILD.bazel index d1f8a7c0c3..8e7ff0d8c4 100644 --- a/bazel/private/BUILD.bazel +++ b/bazel/private/BUILD.bazel @@ -32,3 +32,11 @@ bzl_library( ], visibility = ["//bazel:__subpackages__"], ) + +bzl_library( + name = "proto_toolchain_rule_bzl", + srcs = [ + "proto_toolchain_rule.bzl", + ], + visibility = ["//bazel:__subpackages__"], +) diff --git a/bazel/toolchains/BUILD.bazel b/bazel/toolchains/BUILD.bazel index e69de29bb2..34a45d5bbd 100644 --- a/bazel/toolchains/BUILD.bazel +++ b/bazel/toolchains/BUILD.bazel @@ -0,0 +1,23 @@ +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + +bzl_library( + name = "proto_toolchain_bzl", + srcs = [ + "proto_toolchain.bzl", + ], + visibility = ["//visibility:public"], + deps = [ + "//bazel/private:proto_toolchain_rule_bzl", + ], +) + +bzl_library( + name = "proto_lang_toolchain_bzl", + srcs = [ + "proto_lang_toolchain.bzl", + ], + visibility = ["//visibility:public"], + deps = [ + "//bazel/common:proto_common_bzl", + ], +)