You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2022/02/22 16:29:20 UTC

[couchdb] branch rebar3-second-try created (now 2d4a469)

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

vatamane pushed a change to branch rebar3-second-try
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


      at 2d4a469  Try using rebar3

This branch includes the following new commits:

     new 2d4a469  Try using rebar3

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: Try using rebar3

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

vatamane pushed a commit to branch rebar3-second-try
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 2d4a469a0e4751fe24a360aab58d6fbc947daa47
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Tue Feb 22 11:28:17 2022 -0500

    Try using rebar3
    
     * Use 3.15.2 version which is compatible with Erlang 20
     * Use Basho's rebar_raw_resource for raw deps
---
 Makefile            |  2 +-
 configure           | 68 ++++++++++++++++++++++++++---------------------------
 rebar.config.script |  5 +++-
 3 files changed, 39 insertions(+), 36 deletions(-)

diff --git a/Makefile b/Makefile
index eed3a8d..ef794c5 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,7 @@
 
 include version.mk
 
-REBAR?=$(shell echo `pwd`/bin/rebar)
+REBAR?=$(shell echo `pwd`/bin/rebar3)
 ERLFMT?=$(shell echo `pwd`/bin/erlfmt)
 
 # Handle the following scenarios:
diff --git a/configure b/configure
index 0bcbfae..b504a37 100755
--- a/configure
+++ b/configure
@@ -21,7 +21,7 @@ basename=`basename $0`
 
 PACKAGE_AUTHOR_NAME="The Apache Software Foundation"
 
-REBAR3_BRANCH="main"
+REBAR3_BRANCH="3.15.2"
 
 # TEST=0
 WITH_PROPER="true"
@@ -126,21 +126,21 @@ parse_opts() {
                 continue
                 ;;
 
-            --rebar)
-                if [ -x "$2" ]; then
-                    version=`$2 --version 2> /dev/null | grep -o "2\.[6-9]\.[0-9]"`
-                    if [ $? -ne 0 ]; then
-                        printf 'Rebar >=2.6.0 and <3.0.0 required' >&2
-                        exit 1
-                    fi
-                    eval REBAR=$2
-                    shift 2
-                    continue
-                else
-                    printf 'ERROR: "--rebar" requires valid path to executable.\n' >&2
-                    exit 1
-                fi
-                ;;
+            # --rebar)
+            #     if [ -x "$2" ]; then
+            #         version=`$2 --version 2> /dev/null | grep -o "2\.[6-9]\.[0-9]"`
+            #         if [ $? -ne 0 ]; then
+            #             printf 'Rebar >=2.6.0 and <3.0.0 required' >&2
+            #             exit 1
+            #         fi
+            #         eval REBAR=$2
+            #         shift 2
+            #         continue
+            #     else
+            #         printf 'ERROR: "--rebar" requires valid path to executable.\n' >&2
+            #         exit 1
+            #     fi
+            #     ;;
 
             --rebar3)
                 if [ -x "$2" ]; then
@@ -290,17 +290,17 @@ cat > $rootdir/config.erl << EOF
 {spidermonkey_version, "$SM_VSN"}.
 EOF
 
-install_local_rebar() {
-    if [ ! -x "${rootdir}/bin/rebar" ]; then
-        if [ ! -d "${rootdir}/src/rebar" ]; then
-            # git clone --depth 1 https://github.com/apache/couchdb-rebar.git ${rootdir}/src/rebar
-            git clone https://github.com/apache/couchdb-rebar.git ${rootdir}/src/rebar
-        fi
-        make -C ${rootdir}/src/rebar
-        mv ${rootdir}/src/rebar/rebar ${rootdir}/bin/rebar
-        make -C ${rootdir}/src/rebar clean
-    fi
-}
+# install_local_rebar() {
+#     if [ ! -x "${rootdir}/bin/rebar" ]; then
+#         if [ ! -d "${rootdir}/src/rebar" ]; then
+#             # git clone --depth 1 https://github.com/apache/couchdb-rebar.git ${rootdir}/src/rebar
+#             git clone https://github.com/apache/couchdb-rebar.git ${rootdir}/src/rebar
+#         fi
+#         make -C ${rootdir}/src/rebar
+#         mv ${rootdir}/src/rebar/rebar ${rootdir}/bin/rebar
+#         make -C ${rootdir}/src/rebar clean
+#     fi
+# }
 
 install_local_rebar3() {
     if [ ! -x "${rootdir}/bin/rebar3" ]; then
@@ -327,15 +327,15 @@ install_local_erlfmt() {
     fi
 }
 
-if [ -z "${REBAR}" ]; then
-    install_local_rebar
-    REBAR=${rootdir}/bin/rebar
-fi
+# if [ -z "${REBAR}" ]; then
+#     install_local_rebar
+#     REBAR=${rootdir}/bin/rebar
+# fi
 
-if [ -z "${REBAR3}" ] && [ "${ERLANG_VER}" != "20" ]; then
+#if [ -z "${REBAR3}" ] && [ "${ERLANG_VER}" != "20" ]; then
     install_local_rebar3
     REBAR3=${rootdir}/bin/rebar3
-fi
+#fi
 
 if [ -z "${ERLFMT}" ] && [ "${ERLANG_VER}" != "20" ]; then
     install_local_erlfmt
@@ -345,7 +345,7 @@ fi
 # only update dependencies, when we are not in a release tarball
 if [ -d .git  -a $SKIP_DEPS -ne 1 ]; then
     echo "==> updating dependencies"
-    ${REBAR} get-deps update-deps
+    ${REBAR3} get-deps update-deps
 fi
 
 # External repos frequently become integrated with the primary repo,
diff --git a/rebar.config.script b/rebar.config.script
index da3fc58..c1a857c 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -199,7 +199,10 @@ AddConfig = [
     {lib_dirs, ["src"]},
     {erl_opts, [{i, "../"}, {d, 'COUCHDB_ERLANG_VERSION', VerString}]},
     {eunit_opts, [verbose, {report,{eunit_surefire,[{dir,"."}]}}]},
-    {plugins, [eunit_plugin]},
+    {plugins, [
+        eunit_plugin,
+        {rebar_raw_resource, {git, "git://github.com/basho/rebar_raw_resource.git",{branch, "master"}}}
+    ]},
     {dialyzer, [
         {plt_location, local},
         {plt_location, COUCHDB_ROOT},