I am undergoing trouble writing the custom protoc plugin. I posted this question but no response. Atleast Kindly please let me know answers to few questions. I really need to do this. I havent gone past first step itself.
From this question, how do they link shell script with plugin name protoc-gen-code.
java -cp ./codegen.jar CodeGeneratorMain "$@"
With respect to the above implementation in the question and google proto buffer documentation, what exactly would be there in the path.. is it the path of the Shell Script? would the shell script be named as protoc-gen-code?
Can someone please respond to these queries.
protoccan generate code for several different languages with one invocation. The way you specify which languages you want is to use the command line arguments of the form--LANG_outwhereLANGis the language you want. So--cpp_outgives you C++ code, directory,--js_outgives you JavaScript etc. Ifprotocdoesn't recognizeLANGthen it looks for a plugin calledprotoc-gen-LANGand uses it as the code generator.The shell script can be called whatever. Let's say you call it
mygen.shand you decide you want to usemylangas LANG. Then theprotocinvocation looks like: