I have an Elixir
umbrella project. Each apps in this project can be compiled into executable file using mix escript.build
.
I am trying to run this command from the root of umbrella project and got the following error
** (RuntimeError) Trying to access Mix.Project.app_path for an umbrella project but umbrellas have no app
I understand why this won't work. So tried to create a custom mix task at the root of the umbrella project. Since the root don't have a lib
directory, I added one and created a mix task inside it. But that is not listed in mix help
.
How can I define a custom mix task at the root of an umbrella project?
Your umbrella projects do not have code. That's because the applications in the umbrella are meant to work regardless if they are inside the umbrella or not. If you want to have a task that is shared across multiple applications, you should define it inside a regular application in the umbrella, like any other, and have the other applications that use the task depend on it, like you would for any other piece of code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With