couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [30/50] [abbrv] git commit: Make PropEr a soft dependency
Date Fri, 17 Jan 2014 22:12:01 GMT
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.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/commit/6468ae83
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/tree/6468ae83
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/diff/6468ae83

Branch: refs/heads/import
Commit: 6468ae831438192396d96dbb227c2c73ed577a84
Parents: a7b9f35
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Mon Oct 29 16:01:08 2012 -0500
Committer: Paul J. Davis <paul.joseph.davis@gmail.com>
Committed: Mon Oct 29 16:01:08 2012 -0500

----------------------------------------------------------------------
 .gitignore           |   1 +
 Makefile             |   8 +++++---
 rebar                | Bin 119440 -> 131900 bytes
 rebar.config         |   4 ----
 rebar.config.script  |  26 ++++++++++++++++++++++++++
 test/jiffy_tests.erl |   3 +++
 6 files changed, 35 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/blob/6468ae83/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 0195569..67903ef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+.jiffy.dev
 *.app
 *.beam
 *.o

http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/blob/6468ae83/Makefile
----------------------------------------------------------------------
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
 
 

http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/blob/6468ae83/rebar
----------------------------------------------------------------------
diff --git a/rebar b/rebar
index ceabf62..36ef011 100755
Binary files a/rebar and b/rebar differ

http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/blob/6468ae83/rebar.config
----------------------------------------------------------------------
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, [

http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/blob/6468ae83/rebar.config.script
----------------------------------------------------------------------
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.

http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/blob/6468ae83/test/jiffy_tests.erl
----------------------------------------------------------------------
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.


Mime
View raw message