We've also had a fair amount of difficulty here, in a similar vein (but 
slightly different).

Specifically, we need to modify the `mix.exs` file to include a new 
dependency and do a recompile. I can understand that 
`Mix.Task.run("compile")` should remain as it is, but it would be great if 
there was some kind of magic `Mix.recompile` that would recompile the 
project including any file system changes or `mix.exs` changes, etc.

The goal would be that it was functionally equivalent to the user typing 
`mix compile` into their shell.

We've hacked around this by vendoring the `mix deps.compile` task and doing 
some goofy stuff to reload the mix project, but a proper core api for this 
would be wonderful.

On Monday, July 29, 2024 at 12:19:54 PM UTC-4 bcard...@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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/b2a67fc6-8d56-4b0f-96c5-1dae0c51ae32n%40googlegroups.com.

Reply via email to