|
| 1 | +# Copyright 2024 The Bazel Authors. All rights reserved. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +"""Bazel rules to define Swift libraries and executable binaries. |
| 16 | +
|
| 17 | +Users should load these rules from one or both of the following Bazel files: |
| 18 | +
|
| 19 | +```build |
| 20 | +@build_bazel_rules_swift//swift:swift.bzl |
| 21 | +@build_bazel_rules_swift//proto:proto.bzl |
| 22 | +``` |
| 23 | +
|
| 24 | +Do not import definitions from the `internal` subdirectory directly. |
| 25 | +
|
| 26 | +For example: |
| 27 | +
|
| 28 | +```build |
| 29 | +load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") |
| 30 | +load("@build_bazel_rules_swift//proto:proto.bzl", "swift_proto_library") |
| 31 | +``` |
| 32 | +""" |
| 33 | + |
| 34 | +load( |
| 35 | + "//proto:proto.bzl", |
| 36 | + # providers |
| 37 | + _SwiftProtoCompilerInfo = "SwiftProtoCompilerInfo", |
| 38 | + _SwiftProtoInfo = "SwiftProtoInfo", |
| 39 | + # api |
| 40 | + _swift_proto_common = "swift_proto_common", |
| 41 | + # rules |
| 42 | + _swift_proto_compiler = "swift_proto_compiler", |
| 43 | + _swift_proto_library = "swift_proto_library", |
| 44 | +) |
| 45 | +load( |
| 46 | + "//swift:swift.bzl", |
| 47 | + # providers |
| 48 | + _DeprecatedSwiftGRPCInfo = "SwiftGRPCInfo", |
| 49 | + _SwiftInfo = "SwiftInfo", |
| 50 | + _SwiftToolchainInfo = "SwiftToolchainInfo", |
| 51 | + _SwiftUsageInfo = "SwiftUsageInfo", |
| 52 | + # rules |
| 53 | + _deprecated_swift_grpc_library = "deprecated_swift_grpc_library", |
| 54 | + _deprecated_swift_proto_library = "deprecated_swift_proto_library", |
| 55 | + _swift_binary = "swift_binary", |
| 56 | + _swift_c_module = "swift_c_module", |
| 57 | + # api |
| 58 | + _swift_common = "swift_common", |
| 59 | + _swift_compiler_plugin = "swift_compiler_plugin", |
| 60 | + _swift_feature_allowlist = "swift_feature_allowlist", |
| 61 | + _swift_import = "swift_import", |
| 62 | + _swift_library = "swift_library", |
| 63 | + _swift_library_group = "swift_library_group", |
| 64 | + _swift_module_alias = "swift_module_alias", |
| 65 | + _swift_package_configuration = "swift_package_configuration", |
| 66 | + _swift_test = "swift_test", |
| 67 | + # aspects |
| 68 | + _swift_usage_aspect = "swift_usage_aspect", |
| 69 | + _universal_swift_compiler_plugin = "universal_swift_compiler_plugin", |
| 70 | +) |
| 71 | + |
| 72 | +# The following are re-exported symbols for consumption from stardoc. |
| 73 | + |
| 74 | +# proto symbols |
| 75 | +swift_proto_common = _swift_proto_common |
| 76 | +SwiftProtoCompilerInfo = _SwiftProtoCompilerInfo |
| 77 | +SwiftProtoInfo = _SwiftProtoInfo |
| 78 | +swift_proto_compiler = _swift_proto_compiler |
| 79 | +swift_proto_library = _swift_proto_library |
| 80 | + |
| 81 | +# swift symbols |
| 82 | +swift_common = _swift_common |
| 83 | +swift_usage_aspect = _swift_usage_aspect |
| 84 | +DeprecatedSwiftGRPCInfo = _DeprecatedSwiftGRPCInfo |
| 85 | +SwiftInfo = _SwiftInfo |
| 86 | +SwiftToolchainInfo = _SwiftToolchainInfo |
| 87 | +SwiftUsageInfo = _SwiftUsageInfo |
| 88 | +deprecated_swift_grpc_library = _deprecated_swift_grpc_library |
| 89 | +deprecated_swift_proto_library = _deprecated_swift_proto_library |
| 90 | +swift_binary = _swift_binary |
| 91 | +swift_c_module = _swift_c_module |
| 92 | +swift_compiler_plugin = _swift_compiler_plugin |
| 93 | +universal_swift_compiler_plugin = _universal_swift_compiler_plugin |
| 94 | +swift_feature_allowlist = _swift_feature_allowlist |
| 95 | +swift_import = _swift_import |
| 96 | +swift_library = _swift_library |
| 97 | +swift_library_group = _swift_library_group |
| 98 | +swift_module_alias = _swift_module_alias |
| 99 | +swift_package_configuration = _swift_package_configuration |
| 100 | +swift_test = _swift_test |
0 commit comments