summaryrefslogtreecommitdiff
path: root/src/rebar_otp_app.erl
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-07-27 09:39:20 +0100
committerFred Hebert <mononcqc@ferd.ca>2015-07-27 09:39:20 +0100
commit7c46eea294ecce8338bee7e76a13a0390b7c5901 (patch)
treee34c6793fc2324d7011b91ace63c4138e63a9eca /src/rebar_otp_app.erl
parent8e5662147f59e52f9384b4daa7dd7c0345d126ef (diff)
parent806f7f9219b43b20f4ed23761019282235b32681 (diff)
Merge pull request #654 from tsloughter/discover_script
include app.src.script in app discover
Diffstat (limited to 'src/rebar_otp_app.erl')
-rw-r--r--src/rebar_otp_app.erl17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/rebar_otp_app.erl b/src/rebar_otp_app.erl
index 9f61e71..507da70 100644
--- a/src/rebar_otp_app.erl
+++ b/src/rebar_otp_app.erl
@@ -40,11 +40,17 @@ compile(State, App) ->
%% 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.
- App1 = case rebar_app_info:app_file_src(App) of
+ App1 = case rebar_app_info:app_file_src_script(App) of
undefined ->
- App;
- AppFileSrc ->
- File = preprocess(State, App, AppFileSrc),
+ case rebar_app_info:app_file_src(App) of
+ undefined ->
+ App;
+ AppFileSrc ->
+ File = preprocess(State, App, AppFileSrc),
+ rebar_app_info:app_file(App, File)
+ end;
+ AppFileSrcScript ->
+ File = preprocess(State, App, AppFileSrcScript),
rebar_app_info:app_file(App, File)
end,
@@ -199,7 +205,8 @@ consult_app_file(Filename) ->
false ->
{error, enoent};
true ->
- case lists:suffix(".app.src", Filename) of
+ case lists:suffix(".app.src", Filename)
+ orelse lists:suffix(".app.src.script", Filename) of
false ->
file:consult(Filename);
true ->