From aa8026104a5c2c8dce7b14d426d51fc72928fb4e Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Wed, 27 Jul 2022 12:04:43 -0300 Subject: [PATCH 1/3] chore(mix): configure ee apps in `mix.exs` --- mix.exs | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/mix.exs b/mix.exs index aba53d8e8..2177450f1 100644 --- a/mix.exs +++ b/mix.exs @@ -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 @@ -105,6 +106,24 @@ defmodule EMQXUmbrella.MixProject do 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 + |> String.trim_leading("lib-ee/") + |> String.to_atom() + + {app, path: path, manager: :rebar3, override: true} + end) + end + + defp enterprise_apps(_profile_info) do + [] + end + defp releases() do [ emqx: fn -> From 9cb37e06a2c081ffc6b4f42304885e051f1a4bdd Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Wed, 27 Jul 2022 16:36:03 -0300 Subject: [PATCH 2/3] ci: add `mix format` to `make fmt` --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index bde3e6d76..9f656eac3 100644 --- a/Makefile +++ b/Makefile @@ -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 From aff3afb3854bd75a4cd9d956c578dad89bcab587 Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Thu, 28 Jul 2022 10:23:14 -0300 Subject: [PATCH 3/3] ci: use `Path.basename` --- mix.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mix.exs b/mix.exs index 2177450f1..d67868ff8 100644 --- a/mix.exs +++ b/mix.exs @@ -99,7 +99,7 @@ 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} @@ -113,7 +113,7 @@ defmodule EMQXUmbrella.MixProject do |> Enum.map(fn path -> app = path - |> String.trim_leading("lib-ee/") + |> Path.basename() |> String.to_atom() {app, path: path, manager: :rebar3, override: true}