mirror of
https://github.com/processone/ejabberd.git
synced 2024-07-19 00:11:01 +02: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) ->
|
compile(LibDir) ->
|
||||||
Bin = filename:join(LibDir, "ebin"),
|
Bin = filename:join(LibDir, "ebin"),
|
||||||
Inc = filename:join(LibDir, "include"),
|
|
||||||
Lib = filename:join(LibDir, "lib"),
|
Lib = filename:join(LibDir, "lib"),
|
||||||
Src = filename:join(LibDir, "src"),
|
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, ".")),
|
filelib:ensure_dir(filename:join(Bin, ".")),
|
||||||
[copy(App, Bin) || App <- filelib:wildcard(Src++"/*.app")],
|
[copy(App, Bin) || App <- filelib:wildcard(Src++"/*.app")],
|
||||||
compile_c_files(LibDir),
|
compile_c_files(LibDir),
|
||||||
Er = [compile_erlang_file(Bin, File, Options)
|
Er = [compile_erlang_file(Bin, File, Options)
|
||||||
|| File <- filelib:wildcard(Src++"/*.erl")],
|
|| File <- filelib:wildcard(Src++"/**/*.erl")],
|
||||||
Ex = [compile_elixir_file(Bin, File)
|
Ex = [compile_elixir_file(Bin, File)
|
||||||
|| File <- filelib:wildcard(Lib ++ "/**/*.ex")],
|
|| File <- filelib:wildcard(Lib ++ "/**/*.ex")],
|
||||||
compile_result(lists:flatten([Er, Ex])).
|
compile_result(lists:flatten([Er, Ex])).
|
||||||
|
|
Loading…
Reference in New Issue
Block a user