Browse Source

Revert to previous typespec while adapting calls to it

pull/2412/head
Paulo F. Oliveira 4 years ago
parent
commit
dc7882a869
3 changed files with 7 additions and 7 deletions
  1. +3
    -3
      src/rebar_app_info.erl
  2. +3
    -3
      src/rebar_app_utils.erl
  3. +1
    -1
      src/rebar_prv_plugins_upgrade.erl

+ 3
- 3
src/rebar_app_info.erl View File

@ -90,7 +90,7 @@
app_file :: file:filename_all() | undefined,
original_vsn :: app_vsn() | undefined,
vsn :: app_vsn() | undefined,
parent=root :: binary() | root | string(),
parent=root :: binary() | root,
app_details=[] :: list(),
applications=[] :: list(),
included_applications=[] :: [atom()],
@ -415,12 +415,12 @@ app_details(AppInfo=#app_info_t{}, AppDetails) ->
AppInfo#app_info_t{app_details=AppDetails}.
%% @doc returns the app's parent in the dep tree.
-spec parent(t()) -> root | binary() | string().
-spec parent(t()) -> root | binary().
parent(#app_info_t{parent=Parent}) ->
Parent.
%% @doc sets the app's parent.
-spec parent(t(), binary() | root | string()) -> t().
-spec parent(t(), binary() | root) -> t().
parent(AppInfo=#app_info_t{}, Parent) ->
AppInfo#app_info_t{parent=Parent}.

+ 3
- 3
src/rebar_app_utils.erl View File

@ -171,7 +171,7 @@ parse_deps(Parent, DepsDir, Deps, State, Locks, Level) ->
%% (if it is a newer thing) or from the locks specified in the lockfile.
-spec parse_dep(Dep, Parent, Dir, State, Locks, Level) -> rebar_app_info:t() when
Dep :: tuple() | atom() | binary(), % TODO: meta to source() | lock()
Parent :: root | binary() | string(),
Parent :: root | binary(),
Dir :: file:filename(),
State :: rebar_state:t(),
Locks :: [tuple()], % TODO: meta to [lock()]
@ -199,7 +199,7 @@ parse_dep(Dep, Parent, DepsDir, State, Locks, Level) ->
%% @doc converts a dependency definition and a location for it on disk
%% into an app info tuple representing it.
-spec parse_dep(Parent, Dep, Dir, IsLock, State) -> rebar_app_info:t() when
Parent :: root | binary() | string(),
Parent :: root | binary(),
Dep :: tuple() | atom() | binary(), % TODO: meta to source() | lock()
Dir :: file:filename(),
IsLock :: boolean(),
@ -244,7 +244,7 @@ parse_dep(_, Dep, _, _, _) ->
%% @doc convert a dependency that has just been fetched into
%% an app info record related to it
-spec dep_to_app(Parent, Dir, Name, Vsn, Source, IsLock, State) -> rebar_app_info:t() when
Parent :: root | binary() | string(),
Parent :: root | binary(),
Dir :: file:filename(),
Name :: binary(),
Vsn :: iodata() | undefined,

+ 1
- 1
src/rebar_prv_plugins_upgrade.erl View File

@ -97,7 +97,7 @@ build_plugin(ToBuild, State) ->
maybe_update_pkg(Tup, State) when is_tuple(Tup) ->
maybe_update_pkg(element(1, Tup), State);
maybe_update_pkg(Name, State) ->
try rebar_app_utils:parse_dep(root, ?DEFAULT_PLUGINS_DIR, Name, State, [], 0) of
try rebar_app_utils:parse_dep(root, unicode:characters_to_binary(?DEFAULT_PLUGINS_DIR), Name, State, [], 0) of
AppInfo ->
Source = rebar_app_info:source(AppInfo),
case element(1, Source) of

Loading…
Cancel
Save