lrascao / rebar3_gpb_plugin

A rebar3 plugin for automatically compiling .proto files using the gpb protobuf compiler
MIT License
55 stars 37 forks source link

Folder `include` required even if unused #138

Closed paulo-ferraz-oliveira closed 3 years ago

paulo-ferraz-oliveira commented 3 years ago

I'm using the plugin with a maps-based approach (option maps), so no o_hrl is required. I don't have an include folder (which the plugin "feels" it needs), so the plugin doesn't allow me to move forward (because of https://github.com/lrascao/rebar3_gpb_plugin/blob/develop/src/rebar3_gpb_compiler.erl#L36). My alternatives, at the moment, are:

Since that check seems useless we could probably do without it. I'm not sure maps is the only option that affects this. I'm willing to implement whatever we agree upon so this isn't an impediment to others.

paulo-ferraz-oliveira commented 3 years ago

@lrascao also told me some of this might be eventually be closely related to the integration with gpb itself, in the sense that it'll lead what needs to be done (and the plugin probably will do it - e.g. create a folder). One other fast way to move forward, though, would be to only perform the check when a given file actually has to be created (just before).

tomas-abrahamsson commented 3 years ago

Yes, the gpb_compile:list_io/2 will include a {hrl_output, DestFileName} only when generating for records and not when generating for maps (and a {nif_cc_output, DestFileName} tuple if nif). But unfortunately, that offending is still there also in #136. Didn't think about that at the time...

paulo-ferraz-oliveira commented 3 years ago

How do you think it's best to proceed, here, @tomas-abrahamsson?

Pull request so that include isn't checked if unused? Wait for gpb? Work around this, as per my initial description?

tomas-abrahamsson commented 3 years ago

Pull request so that include isn't checked if unused?

Yes, I think this would be the best solution.

paulo-ferraz-oliveira commented 3 years ago

I have no time to work on this, at the moment. Feel free to re-open if deemed important.