Configuration in umbrella project

239 views
Skip to first unread message

Tomáš Brukner

unread,
Aug 6, 2015, 8:24:15 AM8/6/15
to elixir-lang-talk
I have an umbrella project, where applications need paths to certain files outside of the project. For that I use in-umbrella application - Paths - which provides these paths among with some path joining for convenience. Other applications have in-umbrella dependency on this application. It itself uses Application.get_env(:paths, ...) to get the raw configuration. 

However, I have trouble with configuration. If I run the application from the parent directory, everything works fine; but if I want to work on a single application and I run it or test it from it's directory, the configuration is not loaded, even though the Paths application is available (because it is a dependency). When I have configuration hard-coded in Paths' mix.exs file, the problem is gone.

I am aware that is mentioned in the generated config.exs file, but is there a solution to this problem? That is, how to have in-umbrella dependencies get it's configuration?

José Valim

unread,
Aug 6, 2015, 9:24:48 AM8/6/15
to elixir-l...@googlegroups.com
The configuration is per application, they will never be shared unless explicitly told do so. So if you really want to share configuration, you can do import_config "../../umbrella_sibling/config/config.exs" or some something similar. Just make sure the path is correct.



José Valim
Skype: jv.ptec
Founder and Director of R&D

--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-talk/b9be481b-9f0f-46a9-a6c3-4aa5472eb512%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tomáš Brukner

unread,
Aug 7, 2015, 3:14:43 AM8/7/15
to elixir-lang-talk, jose....@plataformatec.com.br
Thank you José for your answer.

Is this the correct way to solve the problem, or am I missing something?

Dne čtvrtek 6. srpna 2015 15:24:48 UTC+2 José Valim napsal(a):
Reply all
Reply to author
Forward
0 new messages