diff --git a/.gitignore b/.gitignore index 0195569..67903ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.jiffy.dev *.app *.beam *.o diff --git a/Makefile b/Makefile index 446445b..1aa9a1b 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/rebar b/rebar index ceabf62..36ef011 100755 Binary files a/rebar and b/rebar differ diff --git a/rebar.config b/rebar.config index 71a41f8..fe9e06a 100644 --- a/rebar.config +++ b/rebar.config @@ -1,7 +1,3 @@ -{deps, [ - {proper, ".*", {git, "git://github.com/manopapad/proper.git", "master"}} -]}. - {port_specs, [{"priv/jiffy.so", ["c_src/*.c"]}]}. {port_env, [ diff --git a/rebar.config.script b/rebar.config.script new file mode 100644 index 0000000..4b71f42 --- /dev/null +++ b/rebar.config.script @@ -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. diff --git a/test/jiffy_tests.erl b/test/jiffy_tests.erl index 8d3929a..0655b0d 100644 --- a/test/jiffy_tests.erl +++ b/test/jiffy_tests.erl @@ -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.