I have a question, why you do not compile the dependencies in another folder and move all ebin file to your project?
for example using: Code.prepend_path()
def prepend_compiled_apps(files_list) do
files_list
|> Enum.map(
&{String.to_atom(&1),
Path.join(get_build_path() <> "/" <> &1, "ebin") |> Code.prepend_path()}
)
|> Enum.filter(fn {_app, status} -> status == {:error, :bad_directory} end)
|> case do
[] -> {:ok, :prepend_compiled_apps}
list -> {:error, :prepend_compiled_apps, :bad_directory, list}
end
end
defp application_ensure({:ok, :prepend_compiled_apps}, app, :add) do
with {:load, :ok} <- {:load, Application.load(app)},
{:sure_all_started, {:ok, _apps}} <-
{:sure_all_started, Application.ensure_all_started(app)} do
{:ok, :application_ensure}
else
{:load, {:error, term}} ->
{:error, :application_ensure, :load, term}
{:sure_all_started, {:error, {app, term}}} ->
{:error, :application_ensure, :sure_all_started, {app, term}}
end
end
for updating
defp application_ensure({:ok, :prepend_compiled_apps}, app, :force_update) do
Application.stop(app)
with {:unload, :ok} <- {:unload, Application.unload(app)},
{:load, :ok} <- {:load, Application.load(app)},
{:sure_all_started, {:ok, _apps}} <-
{:sure_all_started, Application.ensure_all_started(app)} do
{:ok, :application_ensure}
else
{:unload, {:error, term}} ->
{:error, :application_ensure, :unload, term}
{:load, {:error, term}} ->
{:error, :application_ensure, :load, term}
{:sure_all_started, {:error, {app, term}}} ->
{:error, :application_ensure, :sure_all_started, {app, term}}
end
end
for scanning project version
with {:ok, tokens, _} <- :erl_scan.string(String.to_charlist(bin)) do
:erl_parse.parse_term(tokens)
end
for phoenix in runtime
If you are using Phoenix as developer mode, please disable live_reload in dev.exs . Please add reloadable_apps: [:mishka_installer] to your endpoint config in config.exs file.
https://github.com/mishka-group/mishka_installer/blob/2813e7593ed10bbe7a437045705f44e30461caa7/lib/installer/run_time_sourcing.ex
And with Port you can monitor the command line real time! I think it can fix your problem? Am I wrong?
Update
I just do not know, this commit effects on my way or not
https://github.com/elixir-lang/elixir/commit/7890e56c3ca006b4d96fb40f2a00d69c895f99ba