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.erl13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/rebar_app_info.erl b/src/rebar_app_info.erl
index 8f0cc69..fb2c5f9 100644
--- a/src/rebar_app_info.erl
+++ b/src/rebar_app_info.erl
@@ -5,6 +5,7 @@
new/2,
new/3,
new/4,
+ discover/1,
name/1,
name/2,
config/1,
@@ -82,6 +83,14 @@ new(AppName, Vsn, Dir, Deps) ->
dir=Dir,
deps=Deps}}.
+%% @doc discover a complete version of the app info with all fields set.
+-spec discover(file:name()) ->
+ {ok, t()}.
+discover(Dir) ->
+ {true, AppInfo} = rebar_app_discover:find_app(Dir, all),
+ {ok, AppInfo}.
+
+
-spec name(t()) -> atom().
name(#app_info_t{name=Name}) ->
Name.
@@ -175,8 +184,8 @@ source(#app_info_t{source=Source}) ->
Source.
-spec valid(t()) -> boolean().
-valid(#app_info_t{dir=Dir, valid=undefined}) ->
- true;
+valid(AppInfo=#app_info_t{valid=undefined}) ->
+ rebar_app_discover:validate_application_info(AppInfo);
valid(#app_info_t{valid=Valid}) ->
Valid.