-
Notifications
You must be signed in to change notification settings - Fork 134
/
rebar.config.script
68 lines (62 loc) · 3.18 KB
/
rebar.config.script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
IsCentos6 = fun() ->
case file:read_file("/etc/centos-release") of
{ok, <<"CentOS release 6", _/binary >>} ->
true;
_ ->
false
end
end,
IsWin32 = fun() ->
win32 =:= element(1, os:type())
end,
Quicer = {quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.1.5"}}},
IsQuicSupp = not (IsCentos6() orelse IsWin32() orelse
false =/= os:getenv("BUILD_WITHOUT_QUIC")
),
Profiles = {profiles,[ {escript, []}
, {emqtt_bench,
[{relx, [ {release, {emqtt_bench, git}, [ kernel
, stdlib
, emqtt
, getopt
, cowboy
, prometheus
, jsx
| [ quicer || IsQuicSupp ]
] }
, {overlay_vars_values, [ {runner_root_dir, "$(cd $(dirname $(readlink $0 || echo $0))/..; pwd -P)"}
, {runner_escript_dir, "$RUNNER_ROOT_DIR/escript"}
]}
, {overlay, [ {mkdir, "bin"}
, {mkdir, "escript"}
, {copy, "_build/emqtt_bench/bin", "escript"}
, {copy, "bin/emqtt_bench","bin/emqtt_bench"}
, {copy, "topic_spec.json", "topic_spec.json"}
, {template,"bin/emqtt_bench","bin/emqtt_bench"}
]}
, {tar_hooks, [ "scripts/macos-sign-binaries.sh",
"scripts/macos-notarize-package.sh"]}
, {include_src, false}
, {include_erts, true}
, {extended_start_script, false}
, {generate_start_script, false}
, {sys_config, false}
, {vm_args, false}
]}
]
}
]},
ExtraDeps = fun(C) ->
{deps, Deps0} = lists:keyfind(deps, 1, C),
Deps = Deps0 ++
[ Quicer || IsQuicSupp ],
lists:keystore(deps, 1, C, {deps, Deps})
end,
NewConfig = [ {escript_incl_apps,
[emqtt_bench |
[ quicer || IsQuicSupp ]
]}
, Profiles
| ExtraDeps(CONFIG)],
% io:format("New Config: ~p~n", [NewConfig]),
NewConfig.