You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2019/02/28 16:17:46 UTC

[couchdb] branch optional-proper created (now 0e455d2)

This is an automated email from the ASF dual-hosted git repository.

rnewson pushed a change to branch optional-proper
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


      at 0e455d2  Make PropEr an optional (test) dependency

This branch includes the following new commits:

     new 0e455d2  Make PropEr an optional (test) dependency

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[couchdb] 01/01: Make PropEr an optional (test) dependency

Posted by rn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rnewson pushed a commit to branch optional-proper
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 0e455d2b5bf5ebdd34c0e136b6bec219fd080059
Author: Robert Newson <rn...@apache.org>
AuthorDate: Thu Feb 28 14:01:53 2019 +0000

    Make PropEr an optional (test) dependency
---
 configure           |  8 ++++++++
 rebar.config.script | 22 +++++++++++++++++++---
 2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index b9a021d..1c3f2d8 100755
--- a/configure
+++ b/configure
@@ -23,6 +23,7 @@ PACKAGE_AUTHOR_NAME="The Apache Software Foundation"
 
 # TEST=0
 WITH_CURL="false"
+WITH_PROPER="false"
 WITH_FAUXTON=1
 WITH_DOCS=1
 ERLANG_MD5="false"
@@ -68,6 +69,12 @@ parse_opts() {
                 continue
                 ;;
 
+            --with-proper|-c)
+                WITH_PROPER="true"
+                shift
+                continue
+                ;;
+
             --disable-fauxton)
                 WITH_FAUXTON=0
                 shift
@@ -203,6 +210,7 @@ EOF
 
 cat > $rootdir/config.erl << EOF
 {with_curl, $WITH_CURL}.
+{with_proper, $WITH_PROPER}.
 {erlang_md5, $ERLANG_MD5}.
 EOF
 
diff --git a/rebar.config.script b/rebar.config.script
index 5de05e0..6968b06 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -56,6 +56,14 @@ os:putenv("COUCHDB_ROOT", COUCHDB_ROOT).
 ConfigureEnv = filename:join(COUCHDB_ROOT, "config.erl").
 os:putenv("COUCHDB_CONFIG", ConfigureEnv).
 
+CouchConfig = case filelib:is_file(ConfigureEnv) of
+    true ->
+        {ok, Result} = file:consult(ConfigureEnv),
+        Result;
+    false ->
+        []
+end.
+
 os:putenv("COUCHDB_APPS_CONFIG_DIR", filename:join([COUCHDB_ROOT, "rel/apps"])).
 
 SubDirs = [
@@ -90,8 +98,8 @@ DepDescs = [
 {ets_lru,          "ets-lru",          {tag, "1.0.0"}},
 {khash,            "khash",            {tag, "1.0.1"}},
 {snappy,           "snappy",           {tag, "CouchDB-1.0.2"}},
-{ioq,              "ioq",              {tag, "2.0.0"}},
-{hqueue,           "hqueue",           {tag, "1.0.0"}},
+{ioq,              "ioq",              {branch, "optional-proper"}},
+{hqueue,           "hqueue",           {branch, "optional-proper"}},
 {smoosh,           "smoosh",           {tag, "1.0.1"}},
 {ken,              "ken",              {tag, "1.0.3"}},
 
@@ -109,6 +117,14 @@ DepDescs = [
 {meck,             "meck",             {tag, "0.8.8"}}
 ],
 
+WithProper = lists:keyfind(with_proper, 1, CouchConfig) == {with_proper, true},
+
+OptionalDeps = case WithProper of
+    true ->
+        [{proper, {url, "https://github.com/proper-testing/proper"}, {tag, "v1.3"}}];
+    false ->
+        []
+end,
 
 BaseUrl = "https://github.com/apache/",
 
@@ -133,7 +149,7 @@ end,
 AddConfig = [
     {require_otp_vsn, "19|20|21"},
     {deps_dir, "src"},
-    {deps, lists:map(MakeDep, DepDescs)},
+    {deps, lists:map(MakeDep, DepDescs ++ OptionalDeps)},
     {sub_dirs, SubDirs},
     {lib_dirs, ["src"]},
     {erl_opts, [{i, "../"} | ErlOpts]},