% 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 = {erl_opts, [
|
|
{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) of
|
|
true ->
|
|
% Don't override existing dependencies
|
|
NewConfig = case lists:keyfind(deps, 1, CONFIG) of
|
|
false ->
|
|
CONFIG ++ [{deps, Proper}];
|
|
{deps, DepsList} ->
|
|
lists:keyreplace(deps, 1, CONFIG, {deps, DepsList ++ Proper})
|
|
end,
|
|
NewConfig ++ [ErlOpts];
|
|
false ->
|
|
CONFIG
|
|
end.
|