summaryrefslogtreecommitdiff
path: root/src/rebar_otp_app.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_otp_app.erl')
-rw-r--r--src/rebar_otp_app.erl12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/rebar_otp_app.erl b/src/rebar_otp_app.erl
index a93defc..0bf27c9 100644
--- a/src/rebar_otp_app.erl
+++ b/src/rebar_otp_app.erl
@@ -104,7 +104,7 @@ preprocess(State, AppInfo, AppSrcFile) ->
A1 = apply_app_vars(AppVars, AppData),
%% AppSrcFile may contain instructions for generating a vsn number
- Vsn = app_vsn(AppSrcFile),
+ Vsn = app_vsn(AppSrcFile, State),
A2 = lists:keystore(vsn, 1, A1, {vsn, Vsn}),
%% systools:make_relup/4 fails with {missing_param, registered}
@@ -120,10 +120,6 @@ preprocess(State, AppInfo, AppSrcFile) ->
AppFile = rebar_app_utils:app_src_to_app(OutDir, AppSrcFile),
ok = rebar_file_utils:write_file_if_contents_differ(AppFile, Spec),
- %% Make certain that the ebin/ directory is available
- %% on the code path
- true = code:add_path(filename:absname(filename:dirname(AppFile))),
-
AppFile;
{error, Reason} ->
?PRV_ERROR({file_read, AppSrcFile, Reason})
@@ -132,7 +128,6 @@ preprocess(State, AppInfo, AppSrcFile) ->
load_app_vars(State) ->
case rebar_state:get(State, app_vars_file, undefined) of
undefined ->
- ?DEBUG("No app_vars_file defined.", []),
[];
Filename ->
?INFO("Loading app vars from ~p", [Filename]),
@@ -202,11 +197,12 @@ consult_app_file(Filename) ->
end
end.
-app_vsn(AppFile) ->
+app_vsn(AppFile, State) ->
case consult_app_file(AppFile) of
{ok, [{application, _AppName, AppData}]} ->
AppDir = filename:dirname(filename:dirname(AppFile)),
- rebar_utils:vcs_vsn(get_value(vsn, AppData, AppFile), AppDir);
+ Resources = rebar_state:resources(State),
+ rebar_utils:vcs_vsn(get_value(vsn, AppData, AppFile), AppDir, Resources);
{error, Reason} ->
?ABORT("Failed to consult app file ~s: ~p\n", [AppFile, Reason])
end.