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

Add configuration option to generate the binary proto descriptor #506

Merged
merged 8 commits into from
Dec 22, 2024

Conversation

lucarota
Copy link
Contributor

Ciao,

this PR adds an optional descriptorFile parameter which, if present, indicates the file to which the proto file description is to be saved.

Adds the --descriptor_set_out=FILE option to the protoc command.

Regards,
Luca

Copy link
Owner

@ascopes ascopes left a comment

Choose a reason for hiding this comment

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

This is great! Thanks so much for putting the time and effort into this!

Added a few comments, nothing major though.

@ascopes
Copy link
Owner

ascopes commented Dec 22, 2024

In protobuf-maven-plugin/src/site/markdown, we have documentation that generates the sites at https://ascopes.github.io/protobuf-maven-plugin/additional-language-support.html, it would probably be good to update that to describe the new feature.

@ascopes ascopes added the new feature A new user-facing feature. label Dec 22, 2024
@ascopes ascopes added this to the v2.9.x milestone Dec 22, 2024
Copy link

codecov bot commented Dec 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 87.54%. Comparing base (b59d440) to head (2030198).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...enplugin/generation/ProtobufBuildOrchestrator.java 0.00% 1 Missing and 1 partial ⚠️
...lugin/protoc/ProtocArgumentFileBuilderBuilder.java 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #506   +/-   ##
=======================================
  Coverage   87.54%   87.54%           
=======================================
  Files          40       40           
  Lines        1300     1300           
  Branches       88       88           
=======================================
  Hits         1138     1138           
  Misses        121      121           
  Partials       41       41           
Files with missing lines Coverage Δ
...protobufmavenplugin/mojo/AbstractGenerateMojo.java 100.00% <ø> (ø)
...enplugin/generation/ProtobufBuildOrchestrator.java 82.30% <0.00%> (ø)
...lugin/protoc/ProtocArgumentFileBuilderBuilder.java 92.60% <0.00%> (ø)

@ascopes
Copy link
Owner

ascopes commented Dec 22, 2024

I've just updated the CI pipeline... if you rebase onto the main branch, it should hopefully run the pipeline for you on this PR without me approving it each time first... hopefully.

@ascopes ascopes self-requested a review December 22, 2024 21:24
Copy link
Owner

@ascopes ascopes left a comment

Choose a reason for hiding this comment

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

Thanks!

@ascopes ascopes merged commit 9a7bc42 into ascopes:main Dec 22, 2024
12 of 13 checks passed
ascopes added a commit that referenced this pull request Jan 7, 2025
Extends GH-506 with support for descriptor configuration parameters that
can be passed to protoc.

- Add three new options:
- outputDescriptorIncludeImports - pass the --include_imports flag to
protoc.
- outputDescriptorIncludeSourceInfo - pass the --include_source_info
flag to protoc.
- outputDescriprorRetainOptions - pass the --retain_options flag to
protoc.
- Moved the documentation for descriptor files to a separate location.
- Fixed an edge case where incremental compilation could cause
inconsistent descriptor file outputs. Enabling descriptor files will now
disable incremental compilation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature A new user-facing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants