Skip to content
Closed
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
9 changes: 1 addition & 8 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@
warn_export_all
]}.

{pre_hooks, [
{"(freebsd|netbsd|openbsd|dragonfly)", compile, "gmake -C c_src"},
{"(linux|darwin|solaris)", compile, "make -C c_src"}
]}.
{post_hooks, [
{"(freebsd|netbsd|openbsd|dragonfly)", clean, "gmake -C c_src clean"},
{"(linux|darwin|solaris)", clean, "make -C c_src clean"}
]}.
% `rebar.config.script` has the config for `edoc_opts`, `pre_hooks` and `post_hooks`

{plugins, [rebar3_hex, {rebar3_ex_doc, "0.2.12"}]}.
{hex, [{doc, ex_doc}]}.
Expand Down
20 changes: 19 additions & 1 deletion rebar.config.script
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,23 @@

Vsn = string:strip(os:cmd("git describe --always --tags --abbrev=0 | sed 's/^v//'"), right, $\n),

maps:to_list(maps:merge(maps:from_list(CONFIG), #{edoc_opts => [{def, {vsn, Vsn}}]})).
%% Determine optional target suffix
ExtraTargets =
case os:getenv("ERLEXEC_REBAR_COMPILE_INFO") of
"1" -> " info all";
_ -> ""
end,

CONFIG_FINAL = CONFIG ++ [
{edoc_opts, [{def, {vsn, Vsn}}]},
{pre_hooks, [
{"(freebsd|netbsd|openbsd|dragonfly)", compile, "gmake -C c_src" ++ ExtraTargets},
{"(linux|darwin|solaris)", compile, "make -C c_src" ++ ExtraTargets}
]},
{post_hooks, [
{"(freebsd|netbsd|openbsd|dragonfly)", clean, "gmake -C c_src clean"},
{"(linux|darwin|solaris)", clean, "make -C c_src clean"}
]}
],

maps:to_list(maps:from_list(CONFIG_FINAL)).