Allow plugins to participate in pre and post processing #129

Closed
wants to merge 1 commit into
from

4 participants

@hyperthunk

This patch modifies rebar_core to allow plugins to participate in the
pre and post processing steps, giving plugin authors more flexibility
and control.

@hyperthunk

The t_plugins ReTest is going to fail because we haven't integrated #123 yet. I don't think there's any bug introduced though, because I merge them in a local branch and all the integration tests are fine.

@hyperthunk

A good example of how useful this feature is can be found here.

@hyperthunk hyperthunk Allow plugins to participate in pre and post processing
This patch modifies rebar_core to allow plugins to participate in the
pre and post processing steps, giving plugin authors more flexibility
and control.
7e26289
@arcusfelis

Does it allow to run a user plugin before system plugins?

@hyperthunk

No. It allows plugins to participate in the special pre/post processing hooks that rebar uses in turn to (a) preprocess: determine whether there are any directories that need to be processed before the current one and (b) postprocess: clean up after the all the modules handling the current command have completed.

If you take a look at my example code, you'll see that it gives a plugin the opportunity to customise the runtime environment in order to work around difficult problems (like processing non-erlang code). This is the exact use-case for plugins - to do things that rebar doesn't want to do itself (because they're outside it's remit, or whatever other reason).

@tuncer

Thanks, merged.

@tuncer tuncer closed this Oct 20, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment