diff options
Diffstat (limited to 'src/rebar_otp_app.erl')
-rw-r--r-- | src/rebar_otp_app.erl | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/rebar_otp_app.erl b/src/rebar_otp_app.erl index 0b2e8be..4304600 100644 --- a/src/rebar_otp_app.erl +++ b/src/rebar_otp_app.erl @@ -39,27 +39,27 @@ compile(Config, File) -> %% If we get an .app.src file, it needs to be pre-processed and %% written out as a ebin/*.app file. That resulting file will then %% be validated as usual. - AppFile = case rebar_app_utils:is_app_src(File) of - true -> - preprocess(Config, File); - false -> - File - end, + {Config1, AppFile} = case rebar_app_utils:is_app_src(File) of + true -> + preprocess(Config, File); + false -> + {Config, File} + end, %% Load the app file and validate it. - case rebar_app_utils:load_app_file(AppFile) of - {ok, AppName, AppData} -> + case rebar_app_utils:load_app_file(Config1, AppFile) of + {ok, Config2, AppName, AppData} -> validate_name(AppName, AppFile), %% In general, the list of modules is an important thing to validate %% for compliance with OTP guidelines and upgrade procedures. %% However, some people prefer not to validate this list. - case rebar_config:get_local(Config, validate_app_modules, true) of + case rebar_config:get_local(Config1, validate_app_modules, true) of true -> - validate_modules(AppName, - proplists:get_value(modules, AppData)); + Modules = proplists:get_value(modules, AppData), + {validate_modules(AppName, Modules), Config2}; false -> - ok + {ok, Config2} end; {error, Reason} -> ?ABORT("Failed to load app file ~s: ~p\n", [AppFile, Reason]) @@ -88,17 +88,17 @@ clean(_Config, File) -> %% =================================================================== preprocess(Config, AppSrcFile) -> - case rebar_app_utils:load_app_file(AppSrcFile) of - {ok, AppName, AppData} -> + case rebar_app_utils:load_app_file(Config, AppSrcFile) of + {ok, Config1, AppName, AppData} -> %% Look for a configuration file with vars we want to %% substitute. Note that we include the list of modules available in %% ebin/ and update the app data accordingly. - AppVars = load_app_vars(Config) ++ [{modules, ebin_modules()}], + AppVars = load_app_vars(Config1) ++ [{modules, ebin_modules()}], A1 = apply_app_vars(AppVars, AppData), %% AppSrcFile may contain instructions for generating a vsn number - Vsn = rebar_app_utils:app_vsn(AppSrcFile), + {Config2, Vsn} = rebar_app_utils:app_vsn(Config1, AppSrcFile), A2 = lists:keystore(vsn, 1, A1, {vsn, Vsn}), %% Build the final spec as a string @@ -112,7 +112,7 @@ preprocess(Config, AppSrcFile) -> %% on the code path true = code:add_path(filename:absname(filename:dirname(AppFile))), - AppFile; + {Config2, AppFile}; {error, Reason} -> ?ABORT("Failed to read ~s for preprocessing: ~p\n", |