Multi-application Erlang code base schema. How?

Hello all!

My project contain 7 sub-applications. For now code base schema looks like each of applications have own Intellij IDE Erlang project. Build is making with rebar3 to different folder for each of applications, to Erlang Lib directory this applications added with making symlinks from build folders. Each of applications is in different repository. Some of them related to each other.

Everything works fine for production, but for the the Intellij IDE appeared some troubles with code base. Because of symlinks created to rebar3 build folder directly (it’s contain src, include, priv) it’s conflicting with files indexed with Intellij IDE. It looks like there are two different applications have the same files. For the case of Intellij IDE all of this file part of the Erlang Standard library.

Could someone make some suggestions about how to organiaze multi-application project with Intellij IDE?

Found few links about ‘umbrella’ projects:

But still have no clue of how to organize code base with Intellij IDE Erlang plugin that will resolve file conflicts.

If I understood you correctly, you should configure a project module and select which is the source code, which is excluded, and so on, for example:

1 Like

Thx for reply. You got it almost correctly.

My applications is different applications and all of them added to Erlang Library folder with symlinks to build directory. Because of it Intellij IDE have files collision from Erlang lib folder and from the project itself. When rebar3 compiling applications it’s making symlinks to sources and one source presented by different paths from project itself and from Erlang lib.

Somehow need to say Intellij IDE do not use project files that is from Standard Erlang Lib Folder. If there are deleted symlinks having troubles with compilation because all headers included like "-include_lib(“some_lib”).

Do you know how to do it?

I’ve only used IntelliJ + Zotonic (an umbrella app). To avoid duplication of files, I select the SDK, then the apps and apps_user folders as sources, and exclude the rest via the modules window, which I mentioned before. It’s basically what I do, but I don’t know if this can help you solve your problem.

1 Like

Will try to do it

Solution found.
Based on your approach made my own solution.

If anyone interested:

  1. Created empty Intellij IDE Erlang project without anything related to rebar3
  2. Added applications in the IntelliJ IDE project folder, for each of application different folder
  3. Inside of application folder defined rebar3 configuration
  4. Got configured with Bash/ShellScript plugin compile routines with defined REBAR_BASE_DIR, not rebar routines
  5. Defined in my home folder .erlang file where added lines code:add_path("/application/build/folder/ebin").

For now everything works for me.

1 Like