If your task depends on configs I think you should do:

    @requirements [“app.config”]

See https://hexdocs.pm/mix/Mix.Task.html#module-module-attributes

> On 29 Jul 2024, at 18:19, Brian Cardarella <bcardare...@gmail.com> wrote:
> 
> For LiveView Native's setup task I am doing some codegen with Sourceror to 
> inject or modify existing config settings within config/config.exs and 
> config/dev.exs"
> 
> After that step I want to run generators but the generators themselves would 
> rely upon config settings.
> 
> There appears to be no way to do this in a single step within a Task at the 
> moment.
> 
> My naive approach was:
> 
> Mix.Task.reenable("compile")
> Mix.Task.run("compile")
> 
> but the Application.env was not changed after this within the runtime
> 
> What would be nice is if within a Mix task a full application recompilation 
> would be done. So without leaving the runtime a complete recompilation could 
> be triggered.
> 
> If there is a way to do this today any pointers would be greatly appreciated.
> 
> FWIW, Zach Daniels is also in need of this for Igniter.
> 
> -- 
> 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-core+unsubscr...@googlegroups.com 
> <mailto:elixir-lang-core+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/elixir-lang-core/d36e0659-ff98-4899-9455-8ae06036008fn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/elixir-lang-core/d36e0659-ff98-4899-9455-8ae06036008fn%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/7AEEA3E9-1E09-43BA-A604-B64BFF414C16%40wojtekmach.pl.

Reply via email to