Open westito opened 3 months ago
Ah! I found the problem. I use option java_multiple_files = true;
in proto file. When I turn it off, the problem goes. This is not really necessary for me so I leave it off, but you should mention this in docs, or handle by wrapping the factories in this case (in a *Factory outer class), so I could use DataFactory.DataClassDto
for ex.
@westito Thank you for all the reports, they are very helpful.
I don't quite understand the problem, so could you share a proto file that reproduces the issue?
java_multiple_files = true;
is working fine in my environment.
https://github.com/be-hase/protoc-gen-kotlin-ext/blob/main/functional-test/src/main/proto/example/all_type.proto#L6
The factory function generated under the same package name and the same name as the Builder so it is ambiguous for the compiler. In my case the compiler try to use the private constructor of the original java generated code.
There should be an option for package name prefix or factory function name postfix. For ex.
DataClassDtoFactory(...)
By the way: This plugin saves my live! 😄 The original generator should be like this.