Merge pull request #8586 from thalesmg/mix-ee

chore(mix): configure ee apps in `mix.exs`
This commit is contained in:
Thales Macedo Garitezi 2022-07-28 14:10:20 -03:00 committed by GitHub
commit 5f49f9058f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 5 deletions

View File

@ -249,3 +249,4 @@ $(foreach tt,$(ALL_ELIXIR_TGZS),$(eval $(call gen-elixir-tgz-target,$(tt))))
fmt: $(REBAR)
@./scripts/erlfmt -w '{apps,lib-ee}/*/{src,include,test}/**/*.{erl,hrl,app.src}'
@./scripts/erlfmt -w 'rebar.config.erl'
@mix format

29
mix.exs
View File

@ -30,17 +30,17 @@ defmodule EMQXUmbrella.MixProject do
"""
def project() do
check_profile!()
profile_info = check_profile!()
[
app: :emqx_mix,
version: pkg_vsn(),
deps: deps(),
deps: deps(profile_info),
releases: releases()
]
end
defp deps() do
defp deps(profile_info) do
# we need several overrides here because dependencies specify
# other exact versions, and not ranges.
[
@ -89,7 +89,8 @@ defmodule EMQXUmbrella.MixProject do
github: "ninenines/ranch", ref: "a692f44567034dacf5efcaa24a24183788594eb7", override: true},
# in conflict by grpc and eetcd
{:gpb, "4.11.2", override: true, runtime: false}
] ++ umbrella_apps() ++ bcrypt_dep() ++ jq_dep() ++ quicer_dep()
] ++
umbrella_apps() ++ enterprise_apps(profile_info) ++ bcrypt_dep() ++ jq_dep() ++ quicer_dep()
end
defp umbrella_apps() do
@ -98,13 +99,31 @@ defmodule EMQXUmbrella.MixProject do
|> Enum.map(fn path ->
app =
path
|> String.trim_leading("apps/")
|> Path.basename()
|> String.to_atom()
{app, path: path, manager: :rebar3, override: true}
end)
end
defp enterprise_apps(_profile_info = %{edition_type: :enterprise}) do
"lib-ee/*"
|> Path.wildcard()
|> Enum.filter(&File.dir?/1)
|> Enum.map(fn path ->
app =
path
|> Path.basename()
|> String.to_atom()
{app, path: path, manager: :rebar3, override: true}
end)
end
defp enterprise_apps(_profile_info) do
[]
end
defp releases() do
[
emqx: fn ->