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?

Ward Bekker
  • 6,316
  • 9
  • 38
  • 61

2 Answers2

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
David Dossot
  • 33,403
  • 4
  • 38
  • 72
  • 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. – David Weldon Aug 02 '11 at 19:12
  • 9
    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. :-) – Scott Lystig Fritchie Aug 02 '11 at 20:50
  • 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? – Ward Bekker Aug 03 '11 at 06:19
  • Created a seperate question for this: http://stackoverflow.com/questions/6923491/load-all-erlang-modules-in-path – Ward Bekker Aug 03 '11 at 08:16
6
./rebar shell

should load all your dependencies.

Vishal
  • 1,169
  • 2
  • 12
  • 20