[Proposal] no warning for external dependencies defined at root in umbrella apps

51 views
Skip to first unread message

Ken Cross

unread,
Oct 27, 2021, 12:55:30 AM10/27/21
to elixir-lang-core
First, sorry if this has been brought up before. I did a quick search and nothing stood out.

The idea is simple enough

my_umbrella/mix.exs
  external_deps
my_umbrella/apps/app1/mix.exs
  internal_deps
my_umbrella/apps/app2/mix.exs
  internal_deps

This would be ideal and does work however in most cases, with a ton of warnings when an external dep is actually used inside an app. It would be amazing to have first class support for this as a QOL improvement. I have no idea how much work this requires and I'm willing to dive in a bit myself but I'd have no idea where to begin and would need a bit of guidance.

Lastly, thanks for taking the time to entertain this proposal. Elixir has been great to work with over the past few years!

José Valim

unread,
Oct 27, 2021, 2:41:54 AM10/27/21
to elixir-l...@googlegroups.com
Hi Ken, this behaviour is by design. The apps inside the umbrella are still meant to run and work individually, so for example, you can run tests directly inside one of them.

For sharing code between mix.exs, you can however have a separate file, called shared.exs at the root of the umbrella, or inside the apps/ folder and then do:

Code.require_file "../shared.exs", __DIR__
# ...
  def project do
    [
      deps: Shared.deps() ++ deps()

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/b1259141-5fe8-4664-9f4c-5766c8805df6n%40googlegroups.com.

Ken Cross

unread,
Oct 30, 2021, 12:48:13 AM10/30/21
to elixir-lang-core
Okay, thanks for clearing this up. I thought since the config and deps are referenced at the root that it would be alright. I'll try the shared.exs file and see if that helps. Thanks again for the response, have a great weekend!

-ken
Reply all
Reply to author
Forward
0 new messages