-
Notifications
You must be signed in to change notification settings - Fork 428
/
rebar.config
245 lines (212 loc) · 9.08 KB
/
rebar.config
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
{erl_opts, [debug_info,
{i, ["include"]},
{d, xml_nif},
{d, namespaced_types},
{platform_define, "^(20)", fun_stacktrace},
{platform_define, "^(25)", gen_server_request_id}]}.
%% For behaviour info
{erl_first_files, [
"src/gen_mod.erl",
"src/mod_event_pusher_sns.erl"
]}.
{xref_checks, [undefined_function_calls,
undefined_functions,
locals_not_used,
exports_not_used,
deprecated_function_calls,
deprecated_functions]}.
{xref_ignores, [
eldap_filter_yecc, 'XmppAddr', mongoose_xmpp_errors,
%% *_backend
mod_bosh_backend,
mod_global_distrib_mapping_backend,
mod_pubsub_db_backend,
mod_shared_roster,
ejabberd_c2s, ejabberd_c2s_state, ejabberd_local,
mongoose_c2s,
mongoose_c2s_acc,
%% Deprecated functions
{crypto, rand_uniform, 2},
{ranch, start_listener, 6},
{ranch, accept_ack, 1},
{mongoose_lib, deprecated_logging, 1},
{sys, get_debug, 3},
{httpd_util, integer_to_hexlist, 1}
]}.
{port_specs,
[
{".*", "priv/lib/ejabberd_zlib_drv.so", ["c_src/ejabberd_zlib_drv.c"], [{env, [{"LDFLAGS", "$LDFLAGS -lz"}]}]},
{".*", "priv/lib/mongoose_mam_id.so", ["c_src/mongoose_mam_id.cpp"], [{env, [{"CXXFLAGS", "$CXXFLAGS -O3 -std=c++11"}]}]}
]}.
{require_min_otp_vsn, "21"}.
%% We agreed to use https:// for deps because of possible firewall issues.
%%
%% If you still prefer git protocol, update your "~/.gitconfig" by running:
%% git config --global url."git://github".insteadOf https://github
{deps,
[
%%% Stateless parsers
{base16, "2.0.1"},
{exml, "3.4.1", {pkg, hexml}},
{jiffy, "1.1.1"},
{jid, "2.1.0", {pkg, mongoose_jid}},
{tomerl, "0.5.0"},
{bbmustache, "1.12.2"},
{erl_csv, "0.3.1"},
%%% Observability
{telemetry, "1.2.0"},
{exometer_core, {git, "https://github.com/esl/exometer_core.git", {branch, "master"}}},
{exometer_report_graphite, {git, "https://github.com/esl/exometer_report_graphite.git", {branch, "master"}}},
{exometer_report_statsd, {git, "https://github.com/esl/exometer_report_statsd.git", {branch, "master"}}},
{syslogger, "0.3.0"},
{flatlog, "0.1.2"},
{prometheus, "4.11.0"},
{prometheus_cowboy, "0.1.8"},
%%% Stateless libraries
{opuntia, "1.1.0"},
{fast_tls, "1.1.21"},
{fast_scram, "0.5.0"},
{idna, "6.1.1"},
{uuid, "2.0.5", {pkg, uuid_erl}},
{gen_fsm_compat, "0.3.0"},
%%% Stateful apps
{cache_tab, "1.0.30"},
{segmented_cache, "0.3.0"},
{worker_pool, "6.2.1"},
{cets, {git, "https://github.com/esl/cets.git", {branch, "main"}}},
%%% HTTP tools
{graphql, {git, "https://github.com/esl/graphql-erlang.git", {branch, "master"}}},
{ranch, "2.1.0"},
{cowboy, "2.9.0"},
{hackney, "1.18.1"},
{gun, "1.3.3"},
{fusco, "0.1.1"},
{lasse, "1.2.0"},
{trails, "2.3.0"},
{cowboy_swagger, "2.5.1"},
%%% Outgoing pools
{cqerl, {git, "https://github.com/esl/cqerl.git", {branch, "master"}}},
{mysql, "1.8.0"},
{epgsql, "4.7.1"},
{eodbc, "0.2.0"},
{tirerl, "1.2.0"},
{amqp_client, "3.13.0-rc.2"},
{rabbit_common, "3.13.4"},
{eredis, "1.7.0"},
{erlcloud, "3.6.5"},
%%% Internal monitoring and debugging tools
{recon, "2.5.3"},
{observer_cli, "1.7.4"},
{erlang_doctor, "0.2.6"},
%%% Testing deps
{proper, "1.4.0"},
{meck, "0.9.2"},
%%% Other
{pa, {git, "https://github.com/erszcz/pa.git", {branch, "master"}}},
{jwerl, "1.2.0"},
{cpool, "0.1.0"}, %% Do not upgrade cpool to version 0.1.1, it has bugs
{nksip, {git, "https://github.com/esl/nksip.git", {branch, "mongooseim"}}},
%% knservice pulls lua. We cannot override it, because it is listed in nkservice.app file
{luerl, "1.2.0"}
]}.
{relx, [{release, { mongooseim, {cmd, "cat VERSION | tr -d '\r\n'"} },
[]}, %%Apps list is dynamicaly set by rebar.config.script
%% Disable some warnings in systools:make_script/2 which are extremely slow (saves 30 seconds)
{src_tests, false},
{dev_mode, true},
%% TODO: extra copies waste space, but mongooseim script requires the files in a certain place
{include_erts, true},
{generate_start_script, false},
{extended_start_script, false},
%% Don't forget to update tools/test_runner/apply_templates.erl, when changing templates
{overlay, [
{mkdir, "priv/ssl"},
{copy, "tools/ssl/mongooseim/cert.pem", "priv/ssl/fake_cert.pem"},
{copy, "tools/ssl/mongooseim/key.pem", "priv/ssl/fake_key.pem"},
{copy, "tools/ssl/mongooseim/server.pem", "priv/ssl/fake_server.pem"},
{copy, "tools/ssl/mongooseim/dh_server.pem", "priv/ssl/fake_dh_server.pem"},
{copy, "tools/ssl/ca/cacert.pem", "priv/ssl/cacert.pem"},
%% Copy the whole directory scripts into scripts.
%% Still works, if the destination "scripts/" directory exists.
{copy, "rel/files/scripts", "./"},
{copy, "rel/files/templates", "./"},
{copy, "rel/files/templates.ini", "etc/templates.ini"},
{template, "rel/files/nodetool", "erts-\{\{erts_vsn\}\}/bin/nodetool"},
{template, "rel/files/mongooseim", "bin/mongooseim"},
{template, "rel/files/mongooseimctl", "bin/mongooseimctl"},
{template, "rel/files/app.config", "etc/app.config"},
{template, "rel/files/vm.args", "etc/vm.args"},
{template, "rel/files/vm.dist.args", "etc/vm.dist.args"},
{copy, "priv/logo.txt", "priv/logo.txt"},
{copy, "VERSION", "priv/VERSION"}
]}
]}.
{dist_node,
[{setcookie, mongooseim},
{sname, 'mongooseim@localhost'}
]}.
{profiles, [ {prod, [{relx, [ {dev_mode, false},
{overlay_vars, "rel/prod.vars-toml.config"},
{overlay, [{template, "rel/files/mongooseim.toml", "etc/mongooseim.toml"}]} ]},
{erl_opts, [{d, 'PROD_NODE'}]} ]},
%% development nodes
{mim1, [{relx, [ {overlay_vars, "rel/mim1.vars-toml.config"},
{overlay, [
{copy, "rel/files/cets_disco.txt", "etc/cets_disco.txt"},
{template, "rel/files/mongooseim.toml", "etc/mongooseim.toml"}]} ]}]},
{mim2, [{relx, [ {overlay_vars, "rel/mim2.vars-toml.config"},
{overlay, [
{copy, "rel/files/cets_disco.txt", "etc/cets_disco.txt"},
{template, "rel/files/mongooseim.toml", "etc/mongooseim.toml"}]} ]}]},
{mim3, [{relx, [ {overlay_vars, "rel/mim3.vars-toml.config"},
{overlay, [
{copy, "rel/files/cets_disco.txt", "etc/cets_disco.txt"},
{template, "rel/files/mongooseim.toml", "etc/mongooseim.toml"}]} ]}]},
{fed1, [{relx, [ {overlay_vars, "rel/fed1.vars-toml.config"},
{overlay, [{template, "rel/files/mongooseim.toml", "etc/mongooseim.toml"}]} ]}]},
{reg1, [{relx, [ {overlay_vars, "rel/reg1.vars-toml.config"},
{overlay, [{template, "rel/files/mongooseim.toml", "etc/mongooseim.toml"}]} ]}]},
{test, [{extra_src_dirs, [{"test", [{recursive, true}]}]}]}
]}.
{plugins,
[
{pc, "1.15.0"},
{provider_asn1, "0.3.0"},
{rebar3_codecov, "0.7.0"},
{rebar3_lint, "2.0.1"}
]}.
{provider_hooks,
[{pre, [{compile, {asn, compile}}, {compile, {pc, compile}}]},
{post, [{clean, {asn, clean}}, {clean, {pc, clean}}]
}]}.
{overrides,
[{override, stringprep,
[ {provider_hooks,
[ {post, [ {compile, {pc, compile}},
{clean, {pc, clean}} ] }] } ]},
%% Disable unsupported plugins for hamcrest-erlang
{override, hamcrest, [{plugins, []}]},
{del, eper, [{erl_opts, [warnings_as_errors]}]},
%% Erlang JWT Library is in elixir and wants elvis for tests
%% Remove elvis plugin to reduce deps
{override, jwerl, [{plugins, [rebar3_elixir, rebar3_hex]}]},
{override, worker_pool, [{minimum_otp_vsn, "24"}]}
]}.
{dialyzer, [
{warnings, [unknown]},
{plt_extra_apps, [jid, cowboy, cowlib, lasse, p1_utils, ranch, gen_fsm_compat, epgsql, cqerl,
common_test, tools, amqp_client, jiffy, erl_csv, inets, compiler, jsx,
mysql, eredis, erlcloud, eodbc, telemetry,
nksip, nklib, nkservice, nkpacket, prometheus]}]}.
{cover_print_enabled, true}.
{cover_export_enabled, true}.
{coveralls_coverdata, "/tmp/*.coverdata"}.
{coveralls_service_name, "github"}.
{coveralls_parallel, true}.
{codecov_opts,
[
%% Assuming /tmp/mongoose_combined.coverdata
{path, ["/tmp", "_build/test/cover"]},
{exclude_modules, ['XmppAddr', eldap_filter_yecc]}
]}.
{edoc_opts, [{preprocess, true}, {dir, "edoc"}]}.