Can I share sections of mix.exs files between umbrella child apps?

Because it is a script file (.exs), any dependency needs to be explicitly required/loaded.

So you can put the SharedStuffModule in the umbrella root in a file named “shared_stuff.exs” and then on each umbrella child you can add at the top:

Code.require_file "../../shared_stuff.exs", __DIR__

Note though that the umbrella children were designed so they don’t depend on the parent, so this will slightly break this assumption.

3 Likes