intellij-erlang
intellij-erlang copied to clipboard
Import from rebar.config.script
Is there a way?
@paulovap What exactly would you like to get?
I would like to import a project that don't have an rebar.config. I'm talking about this one: https://github.com/processone/ejabberd
Sergey, have a look at https://github.com/rebar/rebar/wiki/Dynamic-configuration. If a file named rebar.config.script exists, rebar reads it with file:script/2. The equivalent rebar.config can or cannot exist, it doesn't matter.
The problem is that the Erlang plugin runs rebar with, I think, a modified rebar.conf file, in a temporary directory, with
rebar -C /tmp/foo/rebar.conf
The problem of this is that then rebar looks for rebar.conf.script in /tmp/foo, NOT in the project directory where the original rebar.conf exists.
So, the build inside IDEA with the plugin is different / breaks compared to the build from the command-line...
Any workaround in your opinion?
I indeed confirm I had to use a workaround to import project dependancies for ejabberd.
I temporarily did generate a rebar.config file to be able to import project:
1> {ok, Data} = file:script("rebar.config.script").
2> file:write_file("rebar.config", io_lib:fwrite("~p.\n", [Data])).
ping
I believe this is still an issue that requires a workaround, however I cannot get the one above to work for me.
I am running a modified version of ejabberd and it is clear my rebar.config.script
is not running, causing some issues with my eunit tests. I know it isn't running because I added a print to the end, and it doesn't print when I run from IntelliJ's rebar configuration – only from the command line. Accordingly, the issues only happen when I try to run eunit tests from IntelliJ – everything passes when running it from the command line.