Easy way of loading project's Rebar dependencies in Erlang shell
Asked Answered
C

2

19

I've got a project that uses Rebar as build tool. When developing, I would like all my app dependencies that are specified in Rebar.config be compiled & loaded in the shell as easy as possible. I'm using the Erlang shell in Emacs. What's a quick way to do this?

Cryptoclastic answered 2/8, 2011 at 14:16 Comment(0)
T
20

I'm not using Emacs so I may miss the Emacs-specific side of your question, but when I want an Erlang shell with all my rebar dependencies loaded, I use:

erl -pa ebin deps/*/ebin
Teleology answered 2/8, 2011 at 18:21 Comment(4)
The second -pa isn't needed: erl -pa ebin deps/*/ebin also works. I suppose you could alias that if you want even fewer characters to type.Iquitos
I recommend using -pz instead of -pa. In case you ever have a module named lists.erl or gen_server.erl ... or one of your dependencies has such a module ... you can avoid mistaking your module with OTP's. :-)Immolation
Tnx for you answers. With what command can I now load all the modules inside the ebin and deps dir and start executing them in the shell?Cryptoclastic
Created a seperate question for this: #6923991Cryptoclastic
H
7
./rebar shell

should load all your dependencies.

Honour answered 12/5, 2015 at 3:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.