-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
New feature: sorting of .proto files #20
New feature: sorting of .proto files #20
Conversation
Ping @sebastienvermeille - would be great if this could be merged. Let me know if you need anything besides what's currently in the PR! |
Hi @S1artie I am very sorry for the very late notice, I will try to resurrect this project and dedicate time to it periodically. Should be good till end of the week. |
src/main/java/dev/cookiecode/maven/plugin/protobuf/AbstractProtocMojo.java
Show resolved
Hide resolved
0872bf7
to
b7e14b9
Compare
The order in which .proto files are given to the compiler is file system dependent, and thus by extension also operating system dependent, which doesn't matter much for code generation, but can be critical for documentation generation (for which protoc plugins exist!). This commit adds an optional parameter "sortProtoFiles" which can be set to true (defaults to false) to have the .proto files be sorted lexicographically according to their path and file names.
b7e14b9
to
97b1298
Compare
@S1artie I released it:
Might take a few hours till it's available on maven central 👍 |
Hey, thanks for releasing a new version! However, I still can't find it on Maven Central. Not even the older version seems to be there anymore...? [edit] Now it's there! |
The order in which .proto files are given to the compiler is file system dependent, and thus by extension also operating system dependent, which doesn't matter much for code generation, but can be critical for documentation generation (for which protoc plugins exist). This commit adds an optional parameter "sortProtoFiles" which can be set to true (defaults to false) to have the .proto files be sorted lexicographically according to their path and file names.
The result has been successfully tested on Windows, macOS and Linux with the protoc-gen-doc plugin to generate identical, well-sorted documentation for a tree of .proto files.