summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill <w.young@schaetz-cro.ch>2021-12-14 13:09:47 +0000
committerNick Vatamaniuc <nickva@users.noreply.github.com>2021-12-17 10:57:02 -0500
commit8cc41b3f24ac0d15a21380b24ffa9b6dba91b3a8 (patch)
tree2dfb860594c53cdd2275228c887c3c0a121e4969
parent620a0c2caba7b601f4ba245c3d1bd9ba2a5d6c29 (diff)
downloadcouchdb-8cc41b3f24ac0d15a21380b24ffa9b6dba91b3a8.tar.gz
Add rebar3 and erlfmt install commands to configure.ps1 #3873
-rw-r--r--Makefile.win24
-rw-r--r--configure.ps140
-rw-r--r--rebar.config.script2
-rw-r--r--src/ebtree/rebar.config2
4 files changed, 55 insertions, 13 deletions
diff --git a/Makefile.win b/Makefile.win
index b81bd87df..87db5952f 100644
--- a/Makefile.win
+++ b/Makefile.win
@@ -17,8 +17,9 @@
include version.mk
SHELL=cmd.exe
-REBAR=bin\rebar.cmd
-ERLFMT=bin/erlfmt
+REBAR?=$(CURDIR)\bin\rebar.cmd
+PYTHON=python.exe
+ERLFMT?=$(CURDIR)\bin\erlfmt.cmd
MAKE=make -f Makefile.win
# REBAR?=$(shell where rebar.cmd)
@@ -77,7 +78,8 @@ DESTDIR=
# Rebar options
apps=
-skip_deps=folsom,meck,mochiweb,proper,bcrypt,hyper
+skip_deps=folsom,meck,mochiweb,proper,bcrypt,hyper,ibrowse,local
+
suites=
tests=
@@ -173,29 +175,31 @@ just-eunit: export ERL_AFLAGS = "-config $(shell echo %cd%)/rel/files/eunit.conf
just-eunit:
@$(REBAR) -r eunit $(EUNIT_OPTS)
+erlfmt-check: export ERLFMT_PATH := $(ERLFMT)
erlfmt-check:
- ERLFMT_PATH=bin\erlfmt python3 dev\format_check.py
+ @$(PYTHON) dev\format_check.py
+erlfmt-format: export ERLFMT_PATH := $(ERLFMT)
erlfmt-format:
- ERLFMT_PATH=bin\erlfmt python3 dev\format_all.py
+ @$(PYTHON) dev\format_all.py
.venv/bin/black:
- @python.exe -m venv .venv
+ @$(PYTHON) -m venv .venv
@.venv\Scripts\pip3.exe install black || copy /b .venv\Scripts\black.exe +,,
# Python code formatter - only runs if we're on Python 3.6 or greater
python-black: .venv/bin/black
- @python.exe -c "import sys; exit(1 if sys.version_info < (3,6) else 0)" || \
+ @$(PYTHON) -c "import sys; exit(1 if sys.version_info < (3,6) else 0)" || \
echo 'Python formatter not supported on Python < 3.6; check results on a newer platform'
- @python.exe -c "import sys; exit(1 if sys.version_info >= (3,6) else 0)" || \
+ @$(PYTHON) -c "import sys; exit(1 if sys.version_info >= (3,6) else 0)" || \
.venv\Scripts\black.exe --check \
--exclude="build/|buck-out/|dist/|_build/|\.git/|\.hg/|\.mypy_cache/|\.nox/|\.tox/|\.venv/|src/erlfmt|src/rebar/pr2relnotes.py|src/fauxton" \
build-aux dev\run dev\format_*.py src\mango\test src\docs\src\conf.py src\docs\ext .
python-black-update: .venv/bin/black
- @python.exe -c "import sys; exit(1 if sys.version_info < (3,6) else 0)" || \
+ @$(PYTHON) -c "import sys; exit(1 if sys.version_info < (3,6) else 0)" || \
echo 'Python formatter not supported on Python < 3.6; check results on a newer platform'
- @python.exe -c "import sys; exit(1 if sys.version_info >= (3,6) else 0)" || \
+ @$(PYTHON) -c "import sys; exit(1 if sys.version_info >= (3,6) else 0)" || \
.venv\Scripts\black.exe \
--exclude="build/|buck-out/|dist/|_build/|\.git/|\.hg/|\.mypy_cache/|\.nox/|\.tox/|\.venv/|src/erlfmt|src/rebar/pr2relnotes.py|src/fauxton" \
build-aux dev\run dev\format_*.py src\mango\test src\docs\src\conf.py src\docs\ext .
diff --git a/configure.ps1 b/configure.ps1
index f66c0d8df..54c63776e 100644
--- a/configure.ps1
+++ b/configure.ps1
@@ -186,6 +186,12 @@ $ConfigERL = @"
"@
$ConfigERL | Out-File "$rootdir\config.erl" -encoding ascii
+if (((Get-Command "rebar.cmd" -ErrorAction SilentlyContinue) -eq $null) -or
+ ((Get-Command "rebar3.cmd" -ErrorAction SilentlyContinue) -eq $null) -or
+ ((Get-Command "erlfmt.cmd" -ErrorAction SilentlyContinue) -eq $null)) {
+ $env:Path += ";$rootdir\bin"
+}
+
# check for rebar; if not found, build it and add it to our path
if ((Get-Command "rebar.cmd" -ErrorAction SilentlyContinue) -eq $null)
{
@@ -198,7 +204,39 @@ if ((Get-Command "rebar.cmd" -ErrorAction SilentlyContinue) -eq $null)
cp $rootdir\src\rebar\rebar $rootdir\bin\rebar
cp $rootdir\src\rebar\rebar.cmd $rootdir\bin\rebar.cmd
make -C $rootdir\src\rebar clean
- $env:Path += ";$rootdir\bin"
+}
+
+# check for rebar3; if not found, build it and add it to our path
+if ((Get-Command "rebar3.cmd" -ErrorAction SilentlyContinue) -eq $null)
+{
+ Write-Verbose "==> rebar3.cmd not found; bootstrapping..."
+ if (-Not (Test-Path "src\rebar3"))
+ {
+ git clone --depth 1 https://github.com/erlang/rebar3.git $rootdir\src\rebar3
+ }
+ cd src\rebar3
+ .\bootstrap.ps1
+ cp $rootdir\src\rebar3\rebar3 $rootdir\bin\rebar3
+ cp $rootdir\src\rebar3\rebar3.cmd $rootdir\bin\rebar3.cmd
+ cp $rootdir\src\rebar3\rebar3.ps1 $rootdir\bin\rebar3.ps1
+ make -C $rootdir\src\rebar3 clean
+ cd ..\..
+}
+
+# check for erlfmt; if not found, build it and add it to our path
+if ((Get-Command "erlfmt.cmd" -ErrorAction SilentlyContinue) -eq $null)
+{
+ Write-Verbose "==> erlfmt.cmd not found; bootstrapping..."
+ if (-Not (Test-Path "src\erlfmt"))
+ {
+ git clone --depth 1 https://github.com/WhatsApp/erlfmt.git $rootdir\src\erlfmt
+ }
+ cd src\erlfmt
+ rebar3 as release escriptize
+ cp $rootdir\src\erlfmt\_build\release\bin\erlfmt $rootdir\bin\erlfmt
+ cp $rootdir\src\erlfmt\_build\release\bin\erlfmt.cmd $rootdir\bin\erlfmt.cmd
+ make -C $rootdir\src\erlfmt clean
+ cd ..\..
}
# only update dependencies, when we are not in a release tarball
diff --git a/rebar.config.script b/rebar.config.script
index 4c3565e54..5cd6a7208 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -153,7 +153,7 @@ DepDescs = [
{hyper, "hyper", {tag, "CouchDB-2.2.0-7"}},
{ibrowse, "ibrowse", {tag, "CouchDB-4.4.2-5"}},
{jaeger_passage, "jaeger-passage", {tag, "CouchDB-0.1.14-4"}},
-{jiffy, "jiffy", {tag, "CouchDB-1.0.5-1"}},
+{jiffy, "jiffy", {tag, "CouchDB-1.0.9-1"}},
{local, "local", {tag, "0.2.1"}},
{mochiweb, "mochiweb", {tag, "CouchDB-v2.21.0-1"}},
{meck, "meck", {tag, "0.9.2"}},
diff --git a/src/ebtree/rebar.config b/src/ebtree/rebar.config
index edf6725c8..ca39a1d87 100644
--- a/src/ebtree/rebar.config
+++ b/src/ebtree/rebar.config
@@ -13,5 +13,5 @@
{erl_opts, [debug_info]}.
{cover_enabled, true}.
{deps, [
- {erlfdb, ".*", {git, "https://github.com/apache/couchdb-erlfdb", {tag, "v1.2.2"}}}
+ {erlfdb, ".*", {git, "https://github.com/apache/couchdb-erlfdb", {tag, "v1.3.4"}}}
]}.