aboutsummaryrefslogtreecommitdiff
path: root/server/_build/default/lib/jwt/rebar.config.script
blob: 45cbf929517c6597356479dc7305f14d58ffa936 (plain)
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.