Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable SwiftPM build plugin to use the new code generator plugin #1938

Merged
merged 3 commits into from
Jun 18, 2024

Conversation

clintonpi
Copy link
Contributor

Motivation:

The SwiftPM build plugin could not be configured to use the new code generator plugin.

Modifications:

  • Add a _V2 boolean option to the SwiftPM build plugin configuration. If this option is set, it is passed to protoc-gen-grpc-swift which then uses the new code generator plugin.

Result:

The SwiftPM build plugin can now be configured use the new code generator plugin.

Comment on lines 232 to 235
if let v2 {
protocArgs.append("--grpc-swift_opt=_V2=\(v2)")
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this up to where the other protoc args are prepared?

@glbrntt glbrntt added the v2 A change for v2 label Jun 18, 2024
@clintonpi clintonpi force-pushed the port-over-swiftpm-build-plugin branch from 092eeb4 to 1daa6c6 Compare June 18, 2024 12:15
@clintonpi clintonpi requested a review from glbrntt June 18, 2024 12:18
Comment on lines 89 to 90
/// Whether this configuration is for `grpc-swift` v2.
var _V2: Bool?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't missed this the first time around but this should be part of the Invocation configuration struct above

Motivation:

The SwiftPM build plugin could not be configured to use the new code generator plugin.

Modifications:

- Add a `_V2` boolean option to the SwiftPM build plugin configuration. If this option is set, it is passed to protoc-gen-grpc-swift which then uses the new code generator plugin.

Result:

The SwiftPM build plugin can now be configured use the new code generator plugin.
@clintonpi clintonpi force-pushed the port-over-swiftpm-build-plugin branch from bcd1aff to df35a10 Compare June 18, 2024 14:14
@clintonpi clintonpi requested a review from glbrntt June 18, 2024 14:19
@glbrntt glbrntt merged commit 8ae0039 into grpc:main Jun 18, 2024
17 checks passed
@clintonpi clintonpi deleted the port-over-swiftpm-build-plugin branch June 18, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 A change for v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants