Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support updating of per app info by hooks #780

Merged
merged 3 commits into from
Sep 7, 2015

Conversation

tsloughter
Copy link
Collaborator

This patch allows for a hook to update the opts of an appinfo record, hopefully being enough for what @Licenser wants in #670

An example would be a provider that you define in provider_hooks to run before compile which adds to erl_opts:

do(State) ->
  AppInfo = rebar_state:current_app(State),
  ErlOpts = rebar_app_info:get(AppInfo, erl_opts, []),
  AppInfo1 = rebar_app_info:set(AppInfo, erl_opts, [{d, 'SOME_DEFINE'} | ErlOpts]),
  {ok, rebar_state:current_app(State, AppInfo1)}.

@ferd
Copy link
Collaborator

ferd commented Sep 7, 2015

+1

@tsloughter
Copy link
Collaborator Author

@Licenser confirmed in irc that this looks great, so ok to merge now?

ferd added a commit that referenced this pull request Sep 7, 2015
support updating of per app info by hooks
@ferd ferd merged commit 77e5e6b into erlang:master Sep 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants