You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2022/07/19 19:57:08 UTC

[GitHub] [couchdb] jiahuili430 commented on a diff in pull request #4120: Rebar3

jiahuili430 commented on code in PR #4120:
URL: https://github.com/apache/couchdb/pull/4120#discussion_r924905035


##########
configure:
##########
@@ -291,47 +274,38 @@ 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_rebar3() {
     if [ ! -x "${rootdir}/bin/rebar3" ]; then
-        if [ ! -d "${rootdir}/src/rebar3" ]; then
-            git clone --depth 1 --branch ${REBAR3_BRANCH} https://github.com/erlang/rebar3.git ${rootdir}/src/rebar3
+        if [ ! -d "${rootdir}/apps/rebar3" ]; then
+            git clone --depth 1 --branch ${REBAR3_BRANCH} https://github.com/erlang/rebar3.git ${rootdir}/apps/rebar3
         fi
-        cd src/rebar3
+        cd apps/rebar3
         ./bootstrap
-        mv ${rootdir}/src/rebar3/rebar3 ${rootdir}/bin/rebar3
+        mv ${rootdir}/apps/rebar3/rebar3 ${rootdir}/bin/rebar3
         cd ../..
     fi
 }
 
 install_local_erlfmt() {
     if [ ! -x "${rootdir}/bin/erlfmt" ]; then
-        if [ ! -d "${rootdir}/src/erlfmt" ]; then
-            git clone --depth 1 https://github.com/WhatsApp/erlfmt.git ${rootdir}/src/erlfmt
+        if [ ! -d "${rootdir}/apps/erlfmt" ]; then
+            git clone --depth 1 https://github.com/WhatsApp/erlfmt.git ${rootdir}/apps/erlfmt
         fi
-        cd "${rootdir}"/src/erlfmt
+        cd "${rootdir}"/apps/erlfmt
         ${REBAR3} as release escriptize
-        mv ${rootdir}/src/erlfmt/_build/release/bin/erlfmt ${rootdir}/bin/erlfmt
+        mv ${rootdir}/apps/erlfmt/_build/release/bin/erlfmt ${rootdir}/bin/erlfmt
         ${REBAR3} clean
         cd ../..
     fi
 }
 
-if [ -z "${REBAR}" ]; then
-    install_local_rebar
-    REBAR=${rootdir}/bin/rebar
-fi
+install_dependencies() {
+    # fauxton is a Non-Erlang deps, rebar3 cannot get it.
+    if [ ! -d "${rootdir}/apps/fauxton" ] && [ $WITH_FAUXTON == 1 ]; then
+        echo "==> Fetching fauxton"
+        git clone --depth 1 --branch v1.2.8 https://github.com/apache/couchdb-fauxton "${rootdir}/apps/fauxton"
+    fi
+}

Review Comment:
   Good idea!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org