Merge pull request #4459 from badlop/maybe
Enable maybe expression for Erlang 25 and 26
This commit is contained in:
@@ -164,16 +164,7 @@ jobs:
|
||||
|
||||
- name: Run tests
|
||||
id: ct
|
||||
run: |
|
||||
(cd priv && ln -sf ../sql)
|
||||
sed -i -e 's/ct:pal/ct:log/' test/suite.erl
|
||||
COMMIT=`echo $GITHUB_SHA | cut -c 1-7`
|
||||
DATE=`date +%s`
|
||||
REF_NAME=`echo $GITHUB_REF_NAME | tr "/" "_"`
|
||||
NODENAME=$DATE@$GITHUB_RUN_NUMBER-$GITHUB_ACTOR-$REF_NAME-$COMMIT
|
||||
LABEL=`git show -s --format=%s | cut -c 1-30`
|
||||
./rebar3 ct --name $NODENAME --label "$LABEL"
|
||||
./rebar3 cover
|
||||
run: make test
|
||||
|
||||
- name: Check results
|
||||
if: always() && (steps.ct.outcome != 'skipped')
|
||||
|
||||
@@ -31,11 +31,9 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
otp: ['24', '25', '26', '27', '28']
|
||||
otp: ['25', '26', '27', '28']
|
||||
rebar: ['rebar', 'rebar3']
|
||||
exclude:
|
||||
- otp: '24'
|
||||
rebar: 'rebar'
|
||||
- otp: '27'
|
||||
rebar: 'rebar'
|
||||
- otp: '28'
|
||||
|
||||
+6
-3
@@ -2,8 +2,11 @@
|
||||
#' definitions
|
||||
#
|
||||
|
||||
# Only required for Erlang/OTP 25
|
||||
MAYBE=ERL_FLAGS="-enable-feature maybe_expr"
|
||||
|
||||
ESCRIPT = @ESCRIPT@
|
||||
REBAR = @rebar@ # rebar|rebar3|mix binary (or path to binary)
|
||||
REBAR = $(MAYBE) @rebar@ # rebar|rebar3|mix binary (or path to binary)
|
||||
REBAR3 = @REBAR3@ # path to rebar3 binary
|
||||
MIX = @rebar@
|
||||
AWK = @AWK@
|
||||
@@ -123,7 +126,7 @@ REBAR_VER_318:=$(shell $(REBAR) --version | $(AWK) -F '[ .]' '/rebar / {print ($
|
||||
endif
|
||||
|
||||
ifeq "$(REBAR_VER)" "6"
|
||||
REBAR=$(MIX)
|
||||
REBAR=$(MAYBE) $(MIX)
|
||||
SKIPDEPS=
|
||||
LISTDEPS=deps.tree
|
||||
UPDATEDEPS=deps.update
|
||||
@@ -141,7 +144,7 @@ ifeq "$(REBAR_VER)" "6"
|
||||
ELIXIR_LIBDIR=":$(ELIXIR_LIBDIR_RAW)"
|
||||
REBARREL=MIX_ENV=prod $(REBAR) release --overwrite
|
||||
REBARDEV=MIX_ENV=dev $(REBAR) release --overwrite
|
||||
RELIVECMD=$(ESCRIPT) rel/relive.escript && MIX_ENV=dev RELIVE=true $(IEX) --name ejabberd@localhost -S mix run
|
||||
RELIVECMD=$(ESCRIPT) rel/relive.escript && MIX_ENV=dev RELIVE=true $(MAYBE) $(IEX) --name ejabberd@localhost -S mix run
|
||||
REL_LIB_DIR = _build/dev/rel/ejabberd/lib
|
||||
COPY_REL_TARGET = dev
|
||||
GET_DEPS_TRANSLATIONS=MIX_ENV=translations $(REBAR) $(GET_DEPS)
|
||||
|
||||
@@ -121,6 +121,9 @@ export CONTRIB_MODULES_CONF_DIR
|
||||
export ERL_LIBS
|
||||
export SCRIPT_DIR
|
||||
|
||||
# Only required for Erlang/OTP 25:
|
||||
export ERL_FLAGS="$ERL_FLAGS -enable-feature maybe_expr"
|
||||
|
||||
set_dist_client()
|
||||
{
|
||||
[ -n "$ERL_DIST_PORT" ] && ERLANG_OPTS="$ERLANG_OPTS -dist_listen false"
|
||||
|
||||
@@ -98,6 +98,7 @@ defmodule Ejabberd.MixProject do
|
||||
if_version_below(~c"25", [{:d, :OTP_BELOW_25}]) ++
|
||||
if_version_below(~c"26", [{:d, :OTP_BELOW_26}]) ++
|
||||
if_version_below(~c"27", [{:d, :OTP_BELOW_27}]) ++
|
||||
if_version_below(~c"27", [{:feature, :maybe_expr, :enable}]) ++
|
||||
if_version_below(~c"28", [{:d, :OTP_BELOW_28}])
|
||||
defines = for {:d, value} <- result, do: {:d, value}
|
||||
result ++ [{:d, :ALL_DEFS, defines}]
|
||||
|
||||
@@ -139,6 +139,7 @@
|
||||
{if_version_below, "25", {d, 'OTP_BELOW_25'}},
|
||||
{if_version_below, "26", {d, 'OTP_BELOW_26'}},
|
||||
{if_version_below, "27", {d, 'OTP_BELOW_27'}},
|
||||
{if_version_below, "27", {feature, maybe_expr, enable}},
|
||||
{if_version_below, "28", {d, 'OTP_BELOW_28'}},
|
||||
{if_var_false, debug, no_debug_info},
|
||||
{if_var_true, debug, debug_info},
|
||||
|
||||
+2
-1
@@ -678,7 +678,8 @@ maybe_define_lager_macro() ->
|
||||
end.
|
||||
|
||||
compile_options() ->
|
||||
[verbose, report_errors, report_warnings, debug_info, ?ALL_DEFS]
|
||||
[verbose, report_errors, report_warnings, debug_info, ?ALL_DEFS,
|
||||
{feature, maybe_expr, enable}]
|
||||
++ maybe_define_lager_macro()
|
||||
++ [{i, filename:join(app_dir(App), "include")}
|
||||
|| App <- [fast_xml, xmpp, p1_utils, ejabberd]]
|
||||
|
||||
Reference in New Issue
Block a user