ignatov / intellij-erlang

Erlang IDE
https://www.jetbrains.com/help/idea/2018.2/getting-started-with-erlang.html
Other
732 stars 121 forks source link

Import from rebar.config.script #295

Open paulovap opened 11 years ago

paulovap commented 11 years ago

Is there a way?

ignatov commented 11 years ago

@paulovap What exactly would you like to get?

paulovap commented 11 years ago

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

marco-m commented 10 years ago

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?

mremond commented 9 years ago

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])).
marco-m commented 8 years ago

ping

kennedyjosh commented 2 years ago

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.