forked from kato-im/ejwt
-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathrebar.config.script
35 lines (30 loc) · 978 Bytes
/
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
IsRebar3OrMix = case application:get_env(rebar, vsn) of
{ok, VSN} ->
[Major|_] = string:tokens(VSN, "."),
(list_to_integer(Major) >= 3);
undefined ->
%% mix is used?
lists:keymember(mix, 1, application:loaded_applications())
end,
GitDeps =
[ {base64url, ".*", {git, "https://github.com/dvv/base64url", {tag, "v1.0"}}}
, {jsx, ".*", {git, "https://github.com/talentdeficit/jsx", {tag, "2.8.0"}}}
],
Config = case IsRebar3OrMix of
true -> CONFIG;
_ -> lists:keyreplace(deps, 1, CONFIG, {deps, GitDeps})
end,
ConfigCI = case os:getenv("CI") of
"true" ->
Plugins = [rebar3_lint | proplists:get_value(plugins, Config, [])],
lists:keystore(plugins, 1, Config, {plugins, Plugins});
_ ->
Config
end,
case os:getenv("TRAVIS") of
"true" ->
JobId = os:getenv("TRAVIS_JOB_ID"),
lists:keystore(coveralls_service_job_id, 1, ConfigCI, {coveralls_service_job_id, JobId});
_ ->
ConfigCI
end.