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

Follow behaviour parents when generating appup files #63

Open
tothlac opened this issue Jan 9, 2020 · 0 comments
Open

Follow behaviour parents when generating appup files #63

tothlac opened this issue Jan 9, 2020 · 0 comments

Comments

@tothlac
Copy link

tothlac commented Jan 9, 2020

My problem is the following:

As far as I know rebar3 appup generate currently generates {upgrade, Mod, ...} instructions into the .appup file only if the module has been changed and it implements an OTP behaviour.

I've implemented a behaviour, let's call it my_behaviour and the module using this behaviour my_behaviour_impl.erl.

The module my_behaviour implements gen_server, and MyBehaviourState being part of the gen_server's state is passed from my_behaviour.erl to the modules implementing this behaviour.

It would be a good feature if appup generate could automatically figure out that the behavioural parent of my_behaviour_impl.erl is my_behaviour.erl and because it implements an otp behaviour, it should automatically add {update, my_behaviour, ...} instructions to the generated .appup file. So the following instructions in upgrade/downgrade sections of the .appup file:

[
  {load_module, my_behaviour_impl, ...}
]

should be converted into:

[
  {upgrade, my_behaviour, ...}
  {load_module, my_behaviour_impl, ...}
]

Do you think that adding such a feature would be doable in rebar3_appup_generate.erl and also would it be a nice place for inserting these additional instructions into the .appup file?

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

No branches or pull requests

1 participant