Explorar o código

refactor(build): Move parse_transform module to root app

So we do not have to workaround the compile order issue
Zaiming Shi %!s(int64=5) %!d(string=hai) anos
pai
achega
dd06d70bce
Modificáronse 3 ficheiros con 2 adicións e 17 borrados
  1. 1 1
      rebar.config
  2. 1 16
      rebar.config.erl
  3. 0 0
      src/emqx_rule_actions_trans.erl

+ 1 - 1
rebar.config

@@ -34,7 +34,7 @@
 
 {post_hooks,[]}.
 
-{erl_first_files, ["src/emqx_logger.erl"]}.
+{erl_first_files, ["src/emqx_logger.erl", "src/emqx_rule_actions_trans.erl"]}.
 
 {deps,
     [ {gproc, {git, "https://github.com/uwiger/gproc", {tag, "0.8.0"}}}

+ 1 - 16
rebar.config.erl

@@ -2,8 +2,7 @@
 
 -export([do/2]).
 
-do(Dir, CONFIG) ->
-    ok = compile_and_load_pase_transforms(Dir),
+do(_Dir, CONFIG) ->
     C1 = deps(CONFIG),
     Config = dialyzer(C1),
     dump(Config ++ [{overrides, overrides()}] ++ coveralls() ++ config()).
@@ -299,20 +298,6 @@ provide_bcrypt_dep() ->
 provide_bcrypt_release(ReleaseType) ->
     provide_bcrypt_dep() andalso ReleaseType =:= cloud.
 
-%% this is a silly but working patch.
-%% 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"
-        ],
-    CompileOpts = [verbose,report_errors,report_warnings,return_errors,debug_info],
-    lists:foreach(fun(PtFile) -> {ok, _Mod} = compile:file(path(Dir, PtFile), CompileOpts) end, PtFiles).
-
-path(Dir, Path) -> str(filename:join([Dir, Path])).
-
-str(L) when is_list(L) -> L;
-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"]))] ++

apps/emqx_rule_engine/src/emqx_rule_actions_trans.erl → src/emqx_rule_actions_trans.erl