How to incorporate a Erlang source file into a Mix project?

In iex -S mix, typing recompile can compile all the Elixir source files under lib/.
I added an Erlang file lib/foo.erl, typing recompile does not compile this Erlang file.

Does Mix have any mechanism to do this kind of job?

# lib/foo.erl
-module(foo).
-record(person, {name, age}).

main()->
  Person=#person{name=yama, age=17},
  name=Person#person.name.

Hi and welcome,

You might create a src folder, put erlang files in it and add this to your project section of the mix file.

      erlc_paths: ["src"],
4 Likes

Yes it works. Thanks