mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-30 17:43:57 +01:00
ext_mod: Support to compile nested *.erl, and include other deps *.hrl
This is useful to compile as a dependency https://github.com/deadtrickster/prometheus.erl
This commit is contained in:
parent
cafe28fdea
commit
394ba26d1d
@ -594,15 +594,15 @@ compile_deps(LibDir) ->
|
||||
|
||||
compile(LibDir) ->
|
||||
Bin = filename:join(LibDir, "ebin"),
|
||||
Inc = filename:join(LibDir, "include"),
|
||||
Lib = filename:join(LibDir, "lib"),
|
||||
Src = filename:join(LibDir, "src"),
|
||||
Options = [{outdir, Bin}, {i, Inc} | compile_options()],
|
||||
Includes = [{i, Inc} || Inc <- filelib:wildcard(LibDir++"/../../**/include")],
|
||||
Options = [{outdir, Bin}, {i, LibDir++"/.."} | Includes ++ compile_options()],
|
||||
filelib:ensure_dir(filename:join(Bin, ".")),
|
||||
[copy(App, Bin) || App <- filelib:wildcard(Src++"/*.app")],
|
||||
compile_c_files(LibDir),
|
||||
Er = [compile_erlang_file(Bin, File, Options)
|
||||
|| File <- filelib:wildcard(Src++"/*.erl")],
|
||||
|| File <- filelib:wildcard(Src++"/**/*.erl")],
|
||||
Ex = [compile_elixir_file(Bin, File)
|
||||
|| File <- filelib:wildcard(Lib ++ "/**/*.ex")],
|
||||
compile_result(lists:flatten([Er, Ex])).
|
||||
|
Loading…
Reference in New Issue
Block a user