Skip to content

Commit

Permalink
Add rebar3 and erlfmt install commands to configure.ps1 apache#3873
Browse files Browse the repository at this point in the history
  • Loading branch information
Will committed Dec 14, 2021
1 parent 620a0c2 commit 98e6ed7
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
40 changes: 39 additions & 1 deletion configure.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ $ConfigERL = @"
"@
$ConfigERL | Out-File "$rootdir\config.erl" -encoding ascii

if (((Get-Command "rebar.cmd" -ErrorAction SilentlyContinue) -eq $null) ||
((Get-Command "rebar3.cmd" -ErrorAction SilentlyContinue) -eq $null) ||
((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)
{
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rebar.config.script
Original file line number Diff line number Diff line change
Expand Up @@ -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"}},
Expand Down
2 changes: 1 addition & 1 deletion src/ebtree/rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}}
]}.

0 comments on commit 98e6ed7

Please sign in to comment.