xolstice / protobuf-maven-plugin

Maven Plugin that executes the Protocol Buffers (protoc) compiler
https://www.xolstice.org/protobuf-maven-plugin/
Other
232 stars 76 forks source link

Added support for versioned extensions (e.g. .proto2, .proto3) #57

Closed daynamreichert closed 5 years ago

daynamreichert commented 5 years ago

Description Some like to organize their files by adding a version number to their proto files if they're using proto3 syntax vs older versions. This add support for that as well as any other version numbers that might come along.

sergei-ivanov commented 5 years ago

I have just merged the changes, I managed to get it all to work, although Windows gave me a fair amount of grief with Appveyor build failing. I ended up using the same relaxed pattern in scanning for files in directories and jars. Word of caution: I am not sure if protoc is going to support protobuf imports with extensions different from .proto. It seems to work fine in one of my integration tests, but that is not a guarantee that it will work in all cases for all output targets.

sergei-ivanov commented 5 years ago

For the reference, see this function in protobuf compiler code (there are similar functions for other language outputs).

It looks like it does assume certain file extensions, so I am not sure if that can be an issue or not. I may have to back out this change later on, if it causes regressions.