You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provides information needed to generate Swift code from `ProtoInfo` providers
@@ -72,7 +72,8 @@ Provides information needed to generate Swift code from `ProtoInfo` providers
72
72
73
73
| Name | Description |
74
74
| :------------- | :------------- |
75
-
| <aid="SwiftProtoCompilerInfo-compile"></a>compile | A function which compiles Swift source files from `ProtoInfo` providers.<br><br>Args: ctx: the `swift_proto_library` target's context swift_proto_compiler_info: this `SwiftProtoCompilerInfo` provider additional_compiler_info: information passed from the `swift_proto_library` target to the compiler proto_infos: the list of `ProtoInfo` providers to compile module_mappings: the module_mappings field of the `SwiftProtoInfo` for the `swift_proto_library` target<br><br>Returns: A list of .swift Files generated by the compiler. |
75
+
| <aid="SwiftProtoCompilerInfo-bundled_proto_paths"></a>bundled_proto_paths | List of proto paths for which to skip generation because they're built into the modules imported by the generated Swift proto code, e.g., SwiftProtobuf. |
76
+
| <aid="SwiftProtoCompilerInfo-compile"></a>compile | A function which compiles Swift source files from `ProtoInfo` providers.<br><br>Args: label: The label of the target for which the Swift files are being generated. actions: The actions object used to declare the files to be generated and the actions that generate them. swift_proto_compiler_info: This `SwiftProtoCompilerInfo` provider. additional_compiler_info: Additional information passed from the target target to the compiler. proto_infos: The list of `ProtoInfo` providers to compile. module_mappings: The module_mappings field of the `SwiftProtoInfo` for the target.<br><br>Returns: A list of .swift Files generated by the compiler. |
76
77
| <aid="SwiftProtoCompilerInfo-compiler_deps"></a>compiler_deps | List of targets providing SwiftInfo and CcInfo. These are added as dependencies to the swift compile action of the swift_proto_library. Typically these are proto runtime libraries.<br><br>Well Known Types should be added as dependencies of the swift_proto_library targets as needed to avoid compiling them unnecessarily. |
77
78
| <aid="SwiftProtoCompilerInfo-internal"></a>internal | Opaque struct passing information from the compiler target to the compile function. |
| <aid="swift_proto_compiler-name"></a>name | A unique name for this target. | <ahref="https://bazel.build/concepts/labels#target-names">Name</a> | required ||
609
610
| <aid="swift_proto_compiler-deps"></a>deps | List of targets providing SwiftInfo and CcInfo. Added as implicit dependencies for any swift_proto_library using this compiler. Typically, these are Well Known Types and proto runtime libraries. | <ahref="https://bazel.build/concepts/labels">List of labels</a> | optional |`[]`|
611
+
| <aid="swift_proto_compiler-bundled_proto_paths"></a>bundled_proto_paths | List of proto paths for which to skip generation because they're built into the modules imported by the generated Swift proto code, e.g., SwiftProtobuf. | List of strings | optional |`["google/protobuf/any.proto", "google/protobuf/api.proto", "google/protobuf/descriptor.proto", "google/protobuf/duration.proto", "google/protobuf/empty.proto", "google/protobuf/field_mask.proto", "google/protobuf/source_context.proto", "google/protobuf/struct.proto", "google/protobuf/timestamp.proto", "google/protobuf/type.proto", "google/protobuf/wrappers.proto"]`|
610
612
| <aid="swift_proto_compiler-plugin"></a>plugin | A proto compiler plugin executable binary.<br><br>For example: "//tools/protoc_wrapper:protoc-gen-grpc-swift" "//tools/protoc_wrapper:ProtoCompilerPlugin" | <ahref="https://bazel.build/concepts/labels">Label</a> | required ||
611
613
| <aid="swift_proto_compiler-plugin_name"></a>plugin_name | Name of the proto compiler plugin passed to protoc.<br><br>For example:<br><br><pre><code>protoc --plugin=protoc-gen-NAME=path/to/plugin/binary</code></pre><br><br>This name will be used to prefix the option and output directory arguments. E.g.:<br><br><pre><code>protoc --plugin=protoc-gen-NAME=path/to/mybinary --NAME_out=OUT_DIR --NAME_opt=Visibility=Public</code></pre><br><br>See the [protobuf API reference](https://protobuf.dev/reference/cpp/api-docs/google.protobuf.compiler.plugin) for more information. | String | required ||
612
614
| <aid="swift_proto_compiler-plugin_option_allowlist"></a>plugin_option_allowlist | Allowlist of options allowed by the plugin. This is used to filter out any irrelevant plugin options passed down to the compiler from the library, which is especially useful when using multiple plugins in combination like GRPC and SwiftProtobuf. | List of strings | required ||
@@ -690,6 +692,84 @@ swift_proto_library(
690
692
| <aid="swift_proto_library-swiftc_inputs"></a>swiftc_inputs | Additional files that are referenced using `$(location ...)` in attributes that support location expansion. | <ahref="https://bazel.build/concepts/labels">List of labels</a> | optional |`[]`|
| <aid="swift_proto_library_group-name"></a>name | A unique name for this target. | <ahref="https://bazel.build/concepts/labels#target-names">Name</a> | required ||
769
+
| <aid="swift_proto_library_group-compiler"></a>compiler | A `swift_proto_compiler` target (or target producing `SwiftProtoCompilerInfo`), from which the Swift protos will be generated. | <ahref="https://bazel.build/concepts/labels">Label</a> | optional |`"@build_bazel_rules_swift//proto/compilers:swift_proto"`|
770
+
| <aid="swift_proto_library_group-proto"></a>proto | Exactly one `proto_library` target (or target producing `ProtoInfo`), from which the Swift source files should be generated. | <ahref="https://bazel.build/concepts/labels">Label</a> | required ||
0 commit comments