Livebook and Local mix Projects - is there a way to fetch the latest library state automatically?

I would like to use a local mix library projects in my livebook session. When I recompile my library, I have to reconnect to the Mix Runtime.

Is there a way to fetch the latest library state automatically, meaning not having to reconnect for every change?

1 Like

Hey,
I use:

defmodule R do
  def recompile() do
    Mix.Task.reenable("app.start")
    Mix.Task.reenable("compile")
    Mix.Task.reenable("compile.all")
    compilers = Mix.compilers()
    Enum.each(compilers, &Mix.Task.reenable("compile.#{&1}"))
    Mix.Task.run("compile.all")
  end
end

Then when I need to update

R.recompile()
:ok
3 Likes

That works, thanks!

1 Like