Browse Source

apply variables from sys.config when building with bert generator

Namdak Tonpa 6 years ago
parent
commit
5e6089d870
3 changed files with 7 additions and 1 deletions
  1. 1 1
      include/mad.hrl
  2. BIN
      mad
  3. 6 0
      src/compile/mad_compile.erl

+ 1 - 1
include/mad.hrl

@@ -1 +1 @@
--define(VERSION,"b2bd86").
+-define(VERSION,"2ae2ef").

BIN
mad


+ 6 - 0
src/compile/mad_compile.erl

@@ -6,7 +6,13 @@ compile(Params) ->
     SysConfig = try {ok,[S]} = file:consult("sys.config"), S catch _:_ -> [] end,
     BERT = proplists:get_value(bert,SysConfig,[]),
     JS = proplists:get_value(js,BERT,[]),
+    ERL = proplists:get_value(erl,BERT,[]),
+    SWIFT = proplists:get_value(swift,BERT,[]),
+    GOOGLE = proplists:get_value(google,BERT,[]),
     application:set_env(bert,js,JS),
+    application:set_env(bert,erl,ERL),
+    application:set_env(bert,swift,SWIFT),
+    application:set_env(bert,google,GOOGLE),
     case mad_utils:configs() of
          {error,E} -> {error,E};
          {ok,{ Cwd, ConfigFile, Conf }} ->