I have several modules's directories. For each module, I have include (containing *.hrl files) and src (containing *.erl files) folder separeated. How can I share *.hrl file from a module to another without duplicating them?
With rebar, I added {erl_opts, [{i, "folderContainsIncludeFile"}]} and it worked.
But with rebar3, the compilation is failed by saying can't find include file "include/xx.hrl"
I take it then you don't have an umbrella project, you just have multiple directories at the same level, each one with its own project managed with rebar3. Something like:
And you want to include
one.hrlintotwo.erl.If that's the case, you should consider one of these alternatives:
A. Moving to an umbrella project structure, like…
B. Using individual repos for each project and configuring them as dependencies from each other. The structure is like the one you currently have, but now you have to add
depsto rebar.config's. For instance, in our example, you should add the following line to project2's rebar.config:(if you manage to publish project1 in hex.pm)
C. Properly setting
$ERL_LIBSso that it includes the paths where your apps are built with rebar3. Something like…Hope this helps :)