Skip to content

Commit

Permalink
Internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 667891921
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Aug 27, 2024
1 parent 6e2fe5b commit 182699f
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 14 deletions.
File renamed without changes.
30 changes: 18 additions & 12 deletions bazel/private/BUILD.bazel → bazel/private/BUILD
Original file line number Diff line number Diff line change
@@ -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",
)
Expand Down Expand Up @@ -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",
],
)

Expand All @@ -67,21 +73,21 @@ 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(
name = "strict_proto_deps",
flag = "strict_proto_deps",
match_value = "off",
result = False,
visibility = ["//visibility:public"],
visibility = ["//bazel:__subpackages__"],
)

native_bool_flag(
name = "strict_public_imports",
flag = "strict_public_imports",
match_value = "off",
result = False,
visibility = ["//visibility:public"],
visibility = ["//bazel:__subpackages__"],
)
File renamed without changes.
3 changes: 2 additions & 1 deletion bazel/private/proto_lang_toolchain_rule.bzl
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
7 changes: 7 additions & 0 deletions bazel/private/proto_toolchain_rule.bzl
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
2 changes: 1 addition & 1 deletion bazel/proto_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions bazel/tests/proto_common_compile_tests.bzl
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
7 changes: 7 additions & 0 deletions bazel/tests/testdata/compile_rule.bzl
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
2 changes: 2 additions & 0 deletions bazel/toolchains/BUILD.bazel → bazel/toolchains/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
)
7 changes: 7 additions & 0 deletions bazel/toolchains/proto_lang_toolchain.bzl
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
7 changes: 7 additions & 0 deletions bazel/toolchains/proto_toolchain.bzl
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 182699f

Please sign in to comment.