• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Protocol Buffers - Google's data interchange format
2# Copyright 2008 Google Inc.  All rights reserved.
3#
4# Use of this source code is governed by a BSD-style
5# license that can be found in the LICENSE file or at
6# https://developers.google.com/open-source/licenses/bsd
7"""
8Macro of proto_library rule.
9"""
10
11load("@proto_bazel_features//:features.bzl", "bazel_features")
12load("//bazel/private:bazel_proto_library_rule.bzl", _proto_library = "proto_library")
13
14def proto_library(**kwattrs):
15    # This condition causes Starlark rules to be used only on Bazel >=7.0.0
16    if bazel_features.proto.starlark_proto_info:
17        _proto_library(**kwattrs)
18    else:
19        # On older Bazel versions keep using native rules, so that mismatch in ProtoInfo doesn't happen
20        native.proto_library(**kwattrs)
21