-
Notifications
You must be signed in to change notification settings - Fork 19
/
rebar.config.script
54 lines (45 loc) · 1.79 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
%%% -*- mode: erlang -*-
CurlVerHex = string:strip(os:cmd("curl-config --vernum 2>/dev/null"), right, $\n).
CurlVerInt = erlang:list_to_integer(CurlVerHex, 16).
%% CURLOPT_TCP_FASTOPEN since 7.49.0 (471296)
CurlOptTcpFastopen = case CurlVerInt >= 471296 of
true ->
[{d, tcp_fastopen_available}];
false ->
[]
end.
%% CURLOPT_UNIX_SOCKET_PATH since 7.40.0 (468992)
CurlOptUnixSocketPath = case CurlVerInt >= 468992 of
true ->
[{d, unix_socket_path_available}];
false ->
[]
end.
%% CURLOPT_DOHURL since 7.62.0 (474624)
CurlOptDOHURL = case CurlVerInt >= 474624 of
true ->
[{d, doh_url_available}];
false ->
[]
end.
%% CURLOPT_SSLKEY_BLOB since 7.71.0 (476928)
CurlOptSSLKeyBlob = case CurlVerInt >= 476928 of
true ->
[{d, sslkey_blob_available}];
false ->
[]
end.
{_, ErlOpts} = lists:keyfind(erl_opts, 1, CONFIG).
ErlOpts2 = ErlOpts ++
CurlOptTcpFastopen ++
CurlOptUnixSocketPath ++
CurlOptDOHURL ++
CurlOptSSLKeyBlob.
Config1 = lists:keystore(erl_opts, 1, CONFIG, {erl_opts, ErlOpts2}).
case os:getenv("TRAVIS") of
"true" ->
JobId = os:getenv("TRAVIS_JOB_ID"),
lists:keystore(coveralls_service_job_id, 1, Config1, {coveralls_service_job_id, JobId});
_ ->
Config1
end.