Open cgrindel opened 1 year ago
Until we have a use-case for using plugins in Bazel, I am going to close this issue.
The following describes a use-case for plugin support.
So plugins are interesting because the Plugin itself is getting compiled with swiftc and then invoked to return those build commands. In Xcode these build commands are translated to shell scripts but we should probably translate them to gen rules in Bazel. The return build commands should give enough information to construct a proper bazel rule with all the input and outputs.
A use-case that comes to mind is just building a gRPC service. Grpc-swift also offers a SPM plugin: https://github.com/grpc/grpc-swift/blob/main/Sources/protoc-gen-grpc-swift/Docs.docc/spm-plugin.md
It would be great if we can have an example in your repository that builds a gRPC server where the proto file is part of the repo and the plugin is used to generate the Swift code from it.
Another use case: https://github.com/securevale/swift-confidential The plugin there would generate a Swift file with encrypted secrets, but that doesn't work with rules_swift_package_manager
Currently, just treating it as a library.