Skip to content
Permalink
Browse files
Make PropEr a soft dependency
This prevents applications that depend on Jiffy from requiring PropEr as
a dependency just to run Jiffy's full test suite. If you want to run the
full test suite you'll have to run Jiffy's Makefile directly which
creates a `.jiffy.dev` marker that enables the full test suite.
  • Loading branch information
davisp committed Oct 29, 2012
1 parent a7b9f35 commit 6468ae831438192396d96dbb227c2c73ed577a84
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 7 deletions.
@@ -1,3 +1,4 @@
.jiffy.dev
*.app
*.beam
*.o
@@ -15,11 +15,13 @@ distclean: clean
git clean -fxd


depends:
devmarker:
touch .jiffy.dev


depends: devmarker
@if test ! -d ./deps; then \
$(REBAR) get-deps; \
else \
$(REBAR) update-deps; \
fi


BIN +12.2 KB (110%) rebar
Binary file not shown.
@@ -1,7 +1,3 @@
{deps, [
{proper, ".*", {git, "git://github.com/manopapad/proper.git", "master"}}
]}.

{port_specs, [{"priv/jiffy.so", ["c_src/*.c"]}]}.

{port_env, [
@@ -0,0 +1,26 @@
% 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'}
]},

Deps = {deps, [
{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 ->
CONFIG ++ [ErlOpts, Deps];
false ->
CONFIG
end.
@@ -3,6 +3,8 @@

-module(jiffy_tests).

-ifdef(JIFFY_DEV).

-include_lib("proper/include/proper.hrl").
-include_lib("eunit/include/eunit.hrl").

@@ -130,3 +132,4 @@ escaped_char() ->
end
).

-endif.

0 comments on commit 6468ae8

Please sign in to comment.