Internal change

PiperOrigin-RevId: 667891921
pull/17933/head
Protobuf Team Bot 6 months ago committed by Copybara-Service
parent 6e2fe5b8c9
commit 182699f8fd
  1. 0
      bazel/common/BUILD
  2. 30
      bazel/private/BUILD
  3. 0
      bazel/private/bazel_proto_library_rule.bzl
  4. 3
      bazel/private/proto_lang_toolchain_rule.bzl
  5. 7
      bazel/private/proto_toolchain_rule.bzl
  6. 2
      bazel/proto_library.bzl
  7. 7
      bazel/tests/proto_common_compile_tests.bzl
  8. 7
      bazel/tests/testdata/compile_rule.bzl
  9. 2
      bazel/toolchains/BUILD
  10. 7
      bazel/toolchains/proto_lang_toolchain.bzl
  11. 7
      bazel/toolchains/proto_toolchain.bzl

@ -1,15 +1,6 @@
# 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")
load("//bazel/private:native_bool_flag.bzl", "native_bool_flag")
licenses(["notice"])
toolchain_type(
name = "proto_toolchain_type",
)
@ -44,10 +35,25 @@ bzl_library(
"proto_toolchain_rule.bzl",
],
visibility = ["//bazel:__subpackages__"],
deps = [
"//bazel/common:proto_common_bzl",
"//bazel/common:proto_lang_toolchain_info_bzl",
"//bazel/private:toolchain_helpers_bzl",
],
)
bzl_library(
name = "proto_lang_toolchain_rule_bzl",
srcs = [
"proto_lang_toolchain_rule.bzl",
],
visibility = ["//bazel:__subpackages__"],
deps = [
":toolchain_helpers_bzl",
"//bazel/common:proto_common_bzl",
"//bazel/common:proto_info_bzl",
"//bazel/common:proto_lang_toolchain_info_bzl",
"@proto_bazel_features//:features",
],
)
@ -67,7 +73,7 @@ native_bool_flag(
name = "experimental_proto_descriptor_sets_include_source_info",
flag = "experimental_proto_descriptor_sets_include_source_info",
match_value = "true",
visibility = ["//visibility:public"],
visibility = ["//bazel:__subpackages__"],
)
native_bool_flag(
@ -75,7 +81,7 @@ native_bool_flag(
flag = "strict_proto_deps",
match_value = "off",
result = False,
visibility = ["//visibility:public"],
visibility = ["//bazel:__subpackages__"],
)
native_bool_flag(
@ -83,5 +89,5 @@ native_bool_flag(
flag = "strict_public_imports",
match_value = "off",
result = False,
visibility = ["//visibility:public"],
visibility = ["//bazel:__subpackages__"],
)

@ -1,9 +1,10 @@
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# Copyright 2024 Google Inc. 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
#
"""Implementation of the proto_lang_toolchain rule."""
load("@proto_bazel_features//:features.bzl", "bazel_features")

@ -1,3 +1,10 @@
# Protocol Buffers - Google's data interchange format
# Copyright 2024 Google Inc. 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
#
"""A Starlark implementation of the proto_toolchain rule."""
load("//bazel/common:proto_lang_toolchain_info.bzl", "ProtoLangToolchainInfo")

@ -9,7 +9,7 @@ Macro of proto_library rule.
"""
load("@proto_bazel_features//:features.bzl", "bazel_features")
load("//bazel/private:proto_library_rule.bzl", _proto_library = "proto_library")
load("//bazel/private:bazel_proto_library_rule.bzl", _proto_library = "proto_library")
def proto_library(**kwattrs):
# This condition causes Starlark rules to be used only on Bazel >=7.0.0

@ -1,3 +1,10 @@
# Protocol Buffers - Google's data interchange format
# Copyright 2024 Google Inc. 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
#
"""Tests for `proto_common.compile` function."""
load("@rules_testing//lib:analysis_test.bzl", "analysis_test", "test_suite")

@ -1,3 +1,10 @@
# Protocol Buffers - Google's data interchange format
# Copyright 2024 Google Inc. 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
#
"""Testing function for proto_common module"""
load("//bazel/common:proto_common.bzl", "proto_common")

@ -20,5 +20,7 @@ bzl_library(
visibility = ["//visibility:public"],
deps = [
"//bazel/common:proto_common_bzl",
"//bazel/private:proto_lang_toolchain_rule_bzl",
"@proto_bazel_features//:features",
],
)

@ -1,3 +1,10 @@
# Protocol Buffers - Google's data interchange format
# Copyright 2024 Google Inc. 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
#
"""proto_lang_toolchain rule"""
load("@proto_bazel_features//:features.bzl", "bazel_features")

@ -1,3 +1,10 @@
# Protocol Buffers - Google's data interchange format
# Copyright 2024 Google Inc. 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
#
"""Macro wrapping the proto_toolchain implementation.
The macro additionally creates toolchain target when toolchain_type is given.

Loading…
Cancel
Save