When using the gradle plugin for protoc it does not allow for passing additional command args for example there is not way to set --doc_opt . Instead it relies on the fact that protoc splits the --doc_out parameter on : and passes anything before the colon to the compile plugin method as an arg and everything after the colon as the output directory for the plugin. This is great because in theory it should be possible to configure this plugin like so --doc_out <TYPE|TEMPLATE_FILE>,<OUTPUT_FILE>:<EXCLUDE_PATTERN>,<EXCLUDE_PATTERN>*:
The unfortunate problem is that the : separator that protoc chose for indicating the end of options is the same as the exclude pattern separator that was chosen by this plugin and so the result is that the args passed to compile don't contain the exclude patterns but instead they are prepended to the output directory causing a "Directory does not exist" error.
Proposed solution to this problem is to accept an additional separator so that --doc_opt remains backwards compatible and it is also possible to use the --doc_out kludge to configure the exclude patterns from the gradle plugin.
When using the gradle plugin for protoc it does not allow for passing additional command args for example there is not way to set
--doc_opt
. Instead it relies on the fact that protoc splits the--doc_out
parameter on:
and passes anything before the colon to the compile plugin method as an arg and everything after the colon as the output directory for the plugin. This is great because in theory it should be possible to configure this plugin like so--doc_out <TYPE|TEMPLATE_FILE>,<OUTPUT_FILE>:<EXCLUDE_PATTERN>,<EXCLUDE_PATTERN>*
:Example
The unfortunate problem is that the
:
separator that protoc chose for indicating the end of options is the same as the exclude pattern separator that was chosen by this plugin and so the result is that the args passed to compile don't contain the exclude patterns but instead they are prepended to the output directory causing a "Directory does not exist" error.Proposed solution to this problem is to accept an additional separator so that
--doc_opt
remains backwards compatible and it is also possible to use the--doc_out
kludge to configure the exclude patterns from the gradle plugin.Example: