You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
968 B

  1. % This file is part of Jiffy released under the MIT license.
  2. % See the LICENSE file for more information.
  3. % Only include PropEr as a dependency when the JIFFY_DEV
  4. % environment variable is defined. This allows downstream
  5. % applications to avoid requiring PropEr.
  6. %
  7. % This script is based on the example provided with Rebar.
  8. ErlOpts = {erl_opts, [
  9. {d, 'JIFFY_DEV'}
  10. ]},
  11. Proper = [
  12. {proper, ".*", {git, "git://github.com/manopapad/proper.git", "master"}}
  13. ],
  14. ConfigPath = filename:dirname(SCRIPT),
  15. DevMarker = filename:join([ConfigPath, ".jiffy.dev"]),
  16. case filelib:is_file(DevMarker) of
  17. true ->
  18. % Don't override existing dependencies
  19. NewConfig = case lists:keyfind(deps, 1, CONFIG) of
  20. false ->
  21. CONFIG ++ [{deps, Proper}];
  22. {deps, DepsList} ->
  23. lists:keyreplace(deps, 1, CONFIG, {deps, DepsList ++ Proper})
  24. end,
  25. NewConfig ++ [ErlOpts];
  26. false ->
  27. CONFIG
  28. end.