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

1_x_branch: Add the file naming option (#1312) #1338

Merged
merged 1 commit into from
Nov 8, 2022

Conversation

thomasvl
Copy link
Collaborator

@thomasvl thomasvl commented Nov 7, 2022

  • Add the file naming option

Motivation

In some cases, it might be that the proto files in a single target have duplicate file names. This would result in a compilation failure since Swift does not allow duplicate files names in a single module. To resolve this protoc-gen-swift has a FileNaming option called PathToUnderscore to avoid this. We should expose this as an option in the SPM plugin.

Modification

This PR extends the SPM plugin config to set a fileNaming strategy. It defaults to the FullPath strategy if none is set.

Result

Fixes: #1310

* Add the file naming option

# Motivation
In some cases, it might be that the proto files in a single target have duplicate file names. This would result in a compilation failure since Swift does not allow duplicate files names in a single module. To resolve this `protoc-gen-swift` has a `FileNaming` option called `PathToUnderscore` to avoid this. We should expose this as an option in the SPM plugin.

# Modification
This PR extends the SPM plugin config to set a `fileNaming` strategy. It defaults to the `FullPath` strategy if none is set.

# Result
Fixes: apple#1310
@thomasvl thomasvl requested a review from tbkka November 7, 2022 16:14
@thomasvl
Copy link
Collaborator Author

thomasvl commented Nov 7, 2022

fyi @FranzBusch

@thomasvl thomasvl merged commit 1304dd8 into apple:1_x_release_branch Nov 8, 2022
@thomasvl thomasvl deleted the 1_x_file_naming branch November 8, 2022 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants