Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/exsync/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ defmodule ExSync.Config do
Application.get_env(application(), :reload_callback)
end

def compile_callback do
Application.get_env(application(), :compile_callback)
end

def beam_dirs do
if Mix.Project.umbrella?() do
for %Mix.Dep{app: app, opts: opts} <- Mix.Dep.Umbrella.loaded() do
Expand Down
10 changes: 8 additions & 2 deletions lib/exsync/utils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ defmodule ExSync.Utils do
def recomplete do
ExSync.Logger.debug("running mix compile")

System.cmd("mix", ["compile"], cd: ExSync.Config.app_source_dir(), stderr_to_stdout: true)
|> log_compile_cmd()
result = System.cmd("mix", ["compile"], cd: ExSync.Config.app_source_dir(), stderr_to_stdout: true)

if callback = ExSync.Config.compile_callback() do
{mod, fun, args} = callback
apply(mod, fun, [result | args])
end

log_compile_cmd(result)
end

def unload(module) when is_atom(module) do
Expand Down