fix(mix): set enterprise compile flag
This commit is contained in:
parent
88ae489219
commit
9021b7e9b8
19
build
19
build
|
@ -224,6 +224,12 @@ make_docker_testing() {
|
||||||
-f "${DOCKERFILE_TESTING}" .
|
-f "${DOCKERFILE_TESTING}" .
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function join {
|
||||||
|
local IFS="$1"
|
||||||
|
shift
|
||||||
|
echo "$*"
|
||||||
|
}
|
||||||
|
|
||||||
# used to control the Elixir Mix Release output
|
# used to control the Elixir Mix Release output
|
||||||
# see docstring in `mix.exs`
|
# see docstring in `mix.exs`
|
||||||
export_release_vars() {
|
export_release_vars() {
|
||||||
|
@ -240,11 +246,22 @@ export_release_vars() {
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
export MIX_ENV="$profile"
|
export MIX_ENV="$profile"
|
||||||
|
|
||||||
|
local erl_opts=()
|
||||||
|
|
||||||
|
if [[ "$profile" = *enterprise* ]]
|
||||||
|
then
|
||||||
|
erl_opts+=( "{d,'EMQX_ENTERPRISE'}" )
|
||||||
|
fi
|
||||||
|
|
||||||
# At this time, Mix provides no easy way to pass `erl_opts' to
|
# At this time, Mix provides no easy way to pass `erl_opts' to
|
||||||
# dependencies. The workaround is to set this variable before
|
# dependencies. The workaround is to set this variable before
|
||||||
# compiling the project, so that `emqx_release.erl' picks up
|
# compiling the project, so that `emqx_release.erl' picks up
|
||||||
# `emqx_vsn' as if it was compiled by rebar3.
|
# `emqx_vsn' as if it was compiled by rebar3.
|
||||||
export ERL_COMPILER_OPTIONS="[{compile_info,[{emqx_vsn,\"${PKG_VSN}\"}]}]"
|
erl_opts+=( "{compile_info,[{emqx_vsn,\"${PKG_VSN}\"}]}" )
|
||||||
|
|
||||||
|
ERL_COMPILER_OPTIONS="[$(join , "${erl_opts[@]}")]"
|
||||||
|
export ERL_COMPILER_OPTIONS
|
||||||
}
|
}
|
||||||
|
|
||||||
log "building artifact=$ARTIFACT for profile=$PROFILE"
|
log "building artifact=$ARTIFACT for profile=$PROFILE"
|
||||||
|
|
Loading…
Reference in New Issue