rules_swift_package_manager icon indicating copy to clipboard operation
rules_swift_package_manager copied to clipboard

Support target type `plugin` (module_type is `PluginTarget`)

Open cgrindel opened this issue 2 years ago • 3 comments

Currently, just treating it as a library.

cgrindel avatar Dec 08 '22 16:12 cgrindel

Until we have a use-case for using plugins in Bazel, I am going to close this issue.

cgrindel avatar Jan 11 '23 21:01 cgrindel

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.

cgrindel avatar Jan 24 '23 15:01 cgrindel

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

GevaZeichner avatar Apr 03 '24 17:04 GevaZeichner