intellij-erlang icon indicating copy to clipboard operation
intellij-erlang copied to clipboard

Import from rebar.config.script

Open paulovap opened this issue 10 years ago • 6 comments

Is there a way?

paulovap avatar Aug 30 '13 19:08 paulovap

@paulovap What exactly would you like to get?

ignatov avatar Aug 30 '13 19:08 ignatov

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

paulovap avatar Aug 30 '13 19:08 paulovap

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?

marco-m avatar Sep 10 '14 19:09 marco-m

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])).

mremond avatar Dec 30 '14 12:12 mremond

ping

marco-m avatar Dec 19 '15 13:12 marco-m

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.

kennedyjosh avatar Aug 26 '22 18:08 kennedyjosh