diff --git a/.github/workflows/static_checks.yaml b/.github/workflows/static_checks.yaml index 758c3712b..cb8740b1a 100644 --- a/.github/workflows/static_checks.yaml +++ b/.github/workflows/static_checks.yaml @@ -40,7 +40,7 @@ jobs: - uses: actions/cache@v3 with: path: "emqx_dialyzer_${{ matrix.otp }}_plt" - key: rebar3-dialyzer-plt-${{ matrix.profile }}-${{ matrix.otp }}-${{ hashFiles('rebar.*', 'apps/*/rebar.*', 'lib-ee/*/rebar.*') }} + key: rebar3-dialyzer-plt-${{ matrix.profile }}-${{ matrix.otp }}-${{ hashFiles('rebar.*', 'apps/*/rebar.*') }} restore-keys: | rebar3-dialyzer-plt-${{ matrix.profile }}-${{ matrix.otp }}- - name: run static checks diff --git a/Makefile b/Makefile index 3d11491f9..3a7227362 100644 --- a/Makefile +++ b/Makefile @@ -296,7 +296,7 @@ $(foreach tt,$(ALL_ELIXIR_TGZS),$(eval $(call gen-elixir-tgz-target,$(tt)))) .PHONY: fmt fmt: $(REBAR) - @$(SCRIPTS)/erlfmt -w '{apps,lib-ee}/*/{src,include,priv,test,integration_test}/**/*.{erl,hrl,app.src,eterm}' + @$(SCRIPTS)/erlfmt -w 'apps/*/{src,include,priv,test,integration_test}/**/*.{erl,hrl,app.src,eterm}' @$(SCRIPTS)/erlfmt -w 'rebar.config.erl' @mix format diff --git a/dev b/dev index 7622c72fc..67cb6e969 100755 --- a/dev +++ b/dev @@ -336,13 +336,6 @@ copy_other_conf_files() { is_current_profile_app() { local app="$1" case "$app" in - lib-ee*) - if [ "$PROFILE" = 'emqx-enterprise' ]; then - return 0 - else - return 1 - fi - ;; *emqx_telemetry*) if [ "$PROFILE" = 'emqx-enterprise' ]; then return 1 diff --git a/elvis.config b/elvis.config index ee7eaeaee..87d739865 100644 --- a/elvis.config +++ b/elvis.config @@ -5,7 +5,7 @@ [ {config, [ - #{dirs => ["src", "apps/**/src", "lib-ee/**/src"], + #{dirs => ["src", "apps/**/src"], filter => "*.erl", ruleset => erl_files, rules => [ diff --git a/mix.exs b/mix.exs index 07f6b0209..336bde4bf 100644 --- a/mix.exs +++ b/mix.exs @@ -169,24 +169,10 @@ defmodule EMQXUmbrella.MixProject do end defp enterprise_apps(_profile_info = %{edition_type: :enterprise}) do - umbrella_apps = - Enum.map(enterprise_umbrella_apps(), fn app_name -> - path = "apps/#{app_name}" - {app_name, path: path, manager: :rebar3, override: true} - end) - - "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} + Enum.map(enterprise_umbrella_apps(), fn app_name -> + path = "apps/#{app_name}" + {app_name, path: path, manager: :rebar3, override: true} end) - |> Enum.concat(umbrella_apps) end defp enterprise_apps(_profile_info) do @@ -220,6 +206,7 @@ defmodule EMQXUmbrella.MixProject do :emqx_bridge_rabbitmq, :emqx_bridge_clickhouse, :emqx_ft, + :emqx_license, :emqx_s3, :emqx_schema_registry, :emqx_enterprise, diff --git a/rebar.config.erl b/rebar.config.erl index 5dad62af6..8bf502566 100644 --- a/rebar.config.erl +++ b/rebar.config.erl @@ -164,11 +164,7 @@ project_app_dirs(Edition) -> || Path <- filelib:wildcard("apps/*"), is_community_umbrella_app(Path) orelse IsEnterprise ], - UmbrellaApps ++ - case IsEnterprise of - true -> ["lib-ee/*"]; - false -> [] - end. + UmbrellaApps. plugins() -> [ @@ -539,8 +535,7 @@ provide_bcrypt_release(ReleaseType) -> erl_opts_i() -> [{i, "apps"}] ++ - [{i, Dir} || Dir <- filelib:wildcard(filename:join(["apps", "*", "include"]))] ++ - [{i, Dir} || Dir <- filelib:wildcard(filename:join(["lib-ee", "*", "include"]))]. + [{i, Dir} || Dir <- filelib:wildcard(filename:join(["apps", "*", "include"]))]. dialyzer(Config) -> {dialyzer, OldDialyzerConfig} = lists:keyfind(dialyzer, 1, Config), @@ -597,7 +592,7 @@ coveralls() -> [] end. -app_names() -> list_dir("apps") ++ list_dir("lib-ee"). +app_names() -> list_dir("apps"). list_dir(Dir) -> case filelib:is_dir(Dir) of diff --git a/scripts/check-deps-integrity.escript b/scripts/check-deps-integrity.escript index 738aeec31..03cd509de 100755 --- a/scripts/check-deps-integrity.escript +++ b/scripts/check-deps-integrity.escript @@ -5,9 +5,7 @@ -mode(compile). main([]) -> - Files = ["rebar.config"] ++ - apps_rebar_config("apps") ++ - apps_rebar_config("lib-ee"), + Files = ["rebar.config"] ++ apps_rebar_config("apps"), Deps = collect_deps(Files, #{}), case count_bad_deps(Deps) of 0 -> diff --git a/scripts/ct/run.sh b/scripts/ct/run.sh index 5ad289303..f3c01358b 100755 --- a/scripts/ct/run.sh +++ b/scripts/ct/run.sh @@ -98,33 +98,18 @@ if [ ! -d "${WHICH_APP}" ]; then exit 1 fi -if [[ "${WHICH_APP}" == lib-ee* && (-z "${PROFILE+x}" || "${PROFILE}" != emqx-enterprise) ]]; then - echo 'You are trying to run an enterprise test case without the emqx-enterprise profile.' - echo 'This will most likely not work.' - echo '' - echo 'Run "export PROFILE=emqx-enterprise" and "make" to fix this' - exit 1 -fi - ERLANG_CONTAINER='erlang' DOCKER_CT_ENVS_FILE="${WHICH_APP}/docker-ct" -case "${WHICH_APP}" in - lib-ee*) - ## ensure enterprise profile when testing lib-ee applications - export PROFILE='emqx-enterprise' - ;; - apps/*) - if [[ -f "${WHICH_APP}/BSL.txt" ]]; then - export PROFILE='emqx-enterprise' - else - export PROFILE='emqx' - fi - ;; - *) - export PROFILE="${PROFILE:-emqx}" - ;; -esac +if [ -f "${WHICH_APP}/BSL.txt" ]; then + if [ -n "${PROFILE:-}" ] && [ "${PROFILE}" != 'emqx-enterprise' ]; then + echo "bad_profile: PROFILE=${PROFILE} will not work for app ${WHICH_APP}" + exit 1 + fi + export PROFILE='emqx-enterprise' +else + export PROFILE='emqx' +fi if [ -f "$DOCKER_CT_ENVS_FILE" ]; then # shellcheck disable=SC2002 diff --git a/scripts/find-apps.sh b/scripts/find-apps.sh index 9120181c9..5ebb363a9 100755 --- a/scripts/find-apps.sh +++ b/scripts/find-apps.sh @@ -41,9 +41,7 @@ find_app() { "$FIND" "${appdir}" -mindepth 1 -maxdepth 1 -type d } -CE="$(find_app 'apps')" -EE="$(find_app 'lib-ee')" -APPS_ALL="$(echo -e "${CE}\n${EE}")" +APPS_ALL="$(find_app 'apps')" if [ "$MODE" = 'list' ]; then echo "${APPS_ALL}" @@ -87,9 +85,6 @@ describe_app() { profile='emqx' fi ;; - lib-ee/*) - profile='emqx-enterprise' - ;; *) echo "unknown app: $app" exit 1 diff --git a/scripts/update-appup.sh b/scripts/update-appup.sh index 2c99c641d..e7dbff89a 100755 --- a/scripts/update-appup.sh +++ b/scripts/update-appup.sh @@ -72,12 +72,6 @@ while [ "$#" -gt 0 ]; do esac done -if [ "$TAG_PREFIX" = 'v' ]; then - SRC_DIRS="{apps}" -else - SRC_DIRS="{apps,lib-ee}" -fi - ## make sure we build here in bash and always pass --skip-build to escript if [ "${SKIP_BUILD:-}" != 'yes' ]; then make "${PROFILE}" @@ -114,7 +108,7 @@ PREV_REL_DIR="${PREV_DIR_BASE}/${PREV_TAG}/_build/${PROFILE}/lib" # this in turn makes quoting "${ESCRIPT_ARGS[@]}" problematic, hence disable SC2068 check here # shellcheck disable=SC2068 ./scripts/update_appup.escript \ - --src-dirs "${SRC_DIRS}/**" \ + --src-dirs "apps/**" \ --release-dir "_build/${PROFILE}/lib" \ --prev-release-dir "${PREV_REL_DIR}" \ --skip-build \