Skip to content
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

Merged

Conversation

S1artie
Copy link
Contributor

@S1artie S1artie commented Feb 10, 2023

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.

@S1artie
Copy link
Contributor Author

S1artie commented Feb 22, 2023

Ping @sebastienvermeille - would be great if this could be merged. Let me know if you need anything besides what's currently in the PR!

@sebastienvermeille
Copy link
Owner

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.

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.
@sebastienvermeille sebastienvermeille merged commit 37d75d4 into sebastienvermeille:master Sep 8, 2023
@S1artie S1artie deleted the pullreq/fileSorting branch September 8, 2023 07:57
@sebastienvermeille sebastienvermeille mentioned this pull request Sep 8, 2023
@sebastienvermeille
Copy link
Owner

@S1artie I released it:

<dependency>
  <groupId>dev.cookiecode</groupId>
  <artifactId>another-protobuf-maven-plugin</artifactId>
  <version>2.1.0</version>
</dependency>

Might take a few hours till it's available on maven central 👍

@S1artie
Copy link
Contributor Author

S1artie commented Sep 11, 2023

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!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants