Merge pull request #4173 from zmstone/refactor-relocate-management-and-dashboard

refactor(proj): Move opensource apps to lib-opensource
This commit is contained in:
Zaiming Shi 2021-02-12 10:20:47 +01:00 committed by GitHub
commit 12568c8c74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
97 changed files with 16 additions and 12 deletions

2
.gitignore vendored
View File

@ -41,5 +41,5 @@ tmp/
_packages
elvis
emqx_dialyzer_*_plt
apps/emqx_dashboard/priv/www
*/emqx_dashboard/priv/www
dist.zip

View File

@ -2,6 +2,7 @@ REBAR_VERSION = 3.14.3-emqx-4
DASHBOARD_VERSION = v4.3.0
REBAR = $(CURDIR)/rebar3
BUILD = $(CURDIR)/build
export EMQX_ENTERPRISE=false
export PKG_VSN ?= $(shell $(CURDIR)/pkg-vsn.sh)
PROFILE ?= emqx

View File

@ -5,7 +5,7 @@
[
{config,
[
#{dirs => ["apps/**/src", "src"],
#{dirs => ["src", "apps/**/src", "lib-opensource/**/src"],
filter => "*.erl",
ruleset => erl_files,
rules => [
@ -16,7 +16,7 @@
]}}
]
},
#{dirs => ["apps/**/test", "test"],
#{dirs => ["test", "apps/**/test", "lib-opensource/**/src"],
filter => "*.erl",
rules => [
{elvis_text_style, line_length, #{ limit => 100

View File

@ -1,6 +1,5 @@
#!/bin/sh
#!/bin/bash
#set -euo pipefail
set -eu
VERSION="$1"
@ -10,7 +9,11 @@ cd -P -- "$(dirname -- "$0")"
DOWNLOAD_URL='https://github.com/emqx/emqx-dashboard-frontend/releases/download'
DASHBOARD_PATH='apps/emqx_dashboard/priv'
if [ "$EMQX_ENTERPRISE" = 'true' ] || [ "$EMQX_ENTERPRISE" == '1' ]; then
DASHBOARD_PATH='lib-enterprise/emqx_dashboard/priv'
else
DASHBOARD_PATH='lib-opensource/emqx_dashboard/priv'
fi
case $(uname) in
*Darwin*) SED="sed -E";;

View File

@ -279,7 +279,7 @@ provide_bcrypt_release(ReleaseType) ->
%% rebar3 does not handle umberella project's cross-app parse_transform well
compile_and_load_pase_transforms(Dir) ->
PtFiles =
[ "apps/emqx_rule_engine/src/emqx_rule_actions_trans.erl"
[ "lib-opensource/emqx_rule_engine/src/emqx_rule_actions_trans.erl"
],
CompileOpts = [verbose,report_errors,report_warnings,return_errors,debug_info],
lists:foreach(fun(PtFile) -> {ok, _Mod} = compile:file(path(Dir, PtFile), CompileOpts) end, PtFiles).
@ -291,8 +291,8 @@ str(B) when is_binary(B) -> unicode:characters_to_list(B, utf8).
erl_opts_i() ->
[{i, "apps"}] ++
[{i, Dir} || Dir <- filelib:wildcard(filename:join(["apps", "**", "include"]))] ++
[{i, Dir} || Dir <- filelib:wildcard(filename:join([extra_lib_dir(), "**", "include"]))].
[{i, Dir} || Dir <- filelib:wildcard(filename:join(["apps", "*", "include"]))] ++
[{i, Dir} || Dir <- filelib:wildcard(filename:join([extra_lib_dir(), "*", "include"]))].
dialyzer(Config) ->
{dialyzer, OldDialyzerConfig} = lists:keyfind(dialyzer, 1, Config),

View File

@ -15,17 +15,17 @@ apps=(
"emqx_auth_redis"
"emqx_bridge_mqtt"
"emqx_coap"
"emqx_dashboard"
# "emqx_dashboard" # moved to lib-opensource
"emqx_exhook"
"emqx_exproto"
"emqx_lua_hook"
"emqx_lwm2m"
"emqx_management"
# "emqx_management" # moved to lib-opensource
"emqx_prometheus"
"emqx_psk_file"
"emqx_recon"
"emqx_retainer"
"emqx_rule_engine"
# "emqx_rule_engine" # moved to lib-opensource
"emqx_sasl"
"emqx_sn"
"emqx_stomp"