forked from davisp/jiffy
-
Notifications
You must be signed in to change notification settings - Fork 46
/
rebar.config.script
37 lines (32 loc) · 1.22 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
% This file is part of Jiffy released under the MIT license.
% See the LICENSE file for more information.
% Only include PropEr as a dependency when the JIFFY_DEV
% environment variable is defined. This allows downstream
% applications to avoid requiring PropEr.
%
% This script is based on the example provided with Rebar.
ErlOpts = [{d, 'JIFFY_DEV'}],
Proper = [
{proper, ".*", {git, "git://github.com/manopapad/proper.git", "master"}}
],
ConfigPath = filename:dirname(SCRIPT),
DevMarker = filename:join([ConfigPath, ".jiffy.dev"]),
case filelib:is_file(DevMarker) orelse os:getenv("TRAVIS") == "true" of
true ->
% Don't override existing dependencies
Config0 = case lists:keyfind(deps, 1, CONFIG) of
false ->
CONFIG ++ [{deps, Proper}];
{deps, DepsList} ->
lists:keyreplace(deps, 1, CONFIG, {deps, DepsList ++ Proper})
end,
Config1 = case lists:keyfind(erl_opts, 1, Config0) of
false ->
Config0 ++ [{erl_opts, ErlOpts}];
{erl_opts, Opts} ->
NewOpts = {erl_opts, Opts ++ ErlOpts},
lists:keyreplace(erl_opts, 1, Config0, NewOpts)
end;
false ->
CONFIG
end.