diff options
Diffstat (limited to 'src/rebar_app_info.erl')
-rw-r--r-- | src/rebar_app_info.erl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/rebar_app_info.erl b/src/rebar_app_info.erl index 3c38083..a08ca92 100644 --- a/src/rebar_app_info.erl +++ b/src/rebar_app_info.erl @@ -1,6 +1,8 @@ -module(rebar_app_info). -export([new/0, + new/1, + new/2, new/3, name/1, name/2, @@ -15,6 +17,8 @@ original_vsn/1, original_vsn/2, ebin_dir/1, + deps/1, + deps/2, dir/1, dir/2, source/1, @@ -28,6 +32,7 @@ config :: rebar_config:config() | undefined, original_vsn :: string(), app_details :: list(), + deps=[] :: list(), dir :: file:name(), source :: string() | undefined}). @@ -45,6 +50,17 @@ new() -> {ok, #app_info_t{}}. +-spec new(atom() | binary() | string()) -> + {ok, t()}. +new(AppName) -> + {ok, #app_info_t{name=ec_cnv:to_binary(AppName)}}. + +-spec new(atom() | binary() | string(), string()) -> + {ok, t()}. +new(AppName, Vsn) -> + {ok, #app_info_t{name=ec_cnv:to_binary(AppName), + original_vsn=Vsn}}. + %% @doc build a complete version of the app info with all fields set. -spec new(atom() | binary() | string(), string(), file:name()) -> {ok, t()}. @@ -101,6 +117,14 @@ original_vsn(#app_info_t{original_vsn=Vsn}) -> original_vsn(AppInfo=#app_info_t{}, Vsn) -> AppInfo#app_info_t{original_vsn=Vsn}. +-spec deps(t()) -> list(). +deps(#app_info_t{deps=Deps}) -> + Deps. + +-spec deps(t(), list()) -> t(). +deps(AppInfo=#app_info_t{}, Deps) -> + AppInfo#app_info_t{deps=Deps}. + -spec dir(t()) -> file:name(). dir(#app_info_t{dir=Dir}) -> Dir. |