summaryrefslogtreecommitdiff
path: root/src/rebar_app_info.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_app_info.erl')
-rw-r--r--src/rebar_app_info.erl19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/rebar_app_info.erl b/src/rebar_app_info.erl
index 6e35b8f..6962c5a 100644
--- a/src/rebar_app_info.erl
+++ b/src/rebar_app_info.erl
@@ -11,6 +11,8 @@
config/2,
app_file_src/1,
app_file_src/2,
+ app_file_src_script/1,
+ app_file_src_script/2,
app_file/1,
app_file/2,
app_details/1,
@@ -48,6 +50,7 @@
-record(app_info_t, {name :: binary(),
app_file_src :: file:filename_all() | undefined,
+ app_file_src_script:: file:filename_all() | undefined,
app_file :: file:filename_all() | undefined,
config :: rebar_state:t() | undefined,
original_vsn :: binary() | string() | undefined,
@@ -146,6 +149,22 @@ app_file_src(#app_info_t{app_file_src=AppFileSrc}) ->
app_file_src(AppInfo=#app_info_t{}, AppFileSrc) ->
AppInfo#app_info_t{app_file_src=ec_cnv:to_list(AppFileSrc)}.
+-spec app_file_src_script(t()) -> file:filename_all() | undefined.
+app_file_src_script(#app_info_t{app_file_src_script=undefined, dir=Dir, name=Name}) ->
+ AppFileSrcScript = filename:join([ec_cnv:to_list(Dir), "src", ec_cnv:to_list(Name)++".app.src.script"]),
+ case filelib:is_file(AppFileSrcScript) of
+ true ->
+ AppFileSrcScript;
+ false ->
+ undefined
+ end;
+app_file_src_script(#app_info_t{app_file_src_script=AppFileSrcScript}) ->
+ ec_cnv:to_list(AppFileSrcScript).
+
+-spec app_file_src_script(t(), file:filename_all()) -> t().
+app_file_src_script(AppInfo=#app_info_t{}, AppFileSrcScript) ->
+ AppInfo#app_info_t{app_file_src_script=ec_cnv:to_list(AppFileSrcScript)}.
+
-spec app_file(t()) -> file:filename_all() | undefined.
app_file(#app_info_t{app_file=undefined, out_dir=Dir, name=Name}) ->
AppFile = filename:join([ec_cnv:to_list(Dir), "ebin", ec_cnv:to_list(Name)++".app"]),