Add secondary hook for rebar_prv_compile #1048
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
erlc_compile, for before/after compiling .erls to .beams, but before .app.src to .app
After discussing #1044 some on IRC with @tsloughter and @talentdeficit, we concluded something in this form would be viable.
My understanding is that it was originally intended for providers to have only two hooks: pre and post. However, the ability to define arbitrary hook points allows for greater flexibility with respect to scoping out the responsibilities of a given provider. We arguably shouldn't need to separate two closely related operations into different modules just so we can put hooks in between them.
The more I think about this, though, the less certain I am that there is an "optimal" solution. It feels dirty to be adding a "provider hook" for something that's not really a provider. Maybe there's some space in the lexicon for something like pseudo-providers, but it seems kludgy without a formal way for rebar3 to know of their existence.
I can and will write tests for this if it's accepted.