diff options
author | Eric <[email protected]> | 2012-12-07 09:09:17 -0500 |
---|---|---|
committer | Eric <[email protected]> | 2012-12-07 09:09:17 -0500 |
commit | aac84f08f2b557ae2a7bf45001c47aec503203ab (patch) | |
tree | b5e1d71e7935e0f1f3a9118638e05c574f8a63aa /src/rcl_app_info.erl | |
parent | 89e5d70f95f4d23811500d6bf2643714f6c95fa2 (diff) | |
parent | 819690cd8bda0f7f91740b8fa5df71256656de52 (diff) | |
download | relx-aac84f08f2b557ae2a7bf45001c47aec503203ab.tar.gz relx-aac84f08f2b557ae2a7bf45001c47aec503203ab.tar.bz2 relx-aac84f08f2b557ae2a7bf45001c47aec503203ab.zip |
Merge remote-tracking branch 'canonical/next'
* canonical/next:
fix nasty bug that didn't let relcool output errors
make the default output _rel instead of relcool_output
allow a user to specify additional opts to erlexec
add examples of simple and complete relcool configs
make sure ebin is removed on clean
add inadvertantly deleted relcool.app.src
support travis CI in relcool
cleanup the rebar config
remove docs (they have been moved to the wiki)
all relcool to symlink in 'overridden' apps
rcl_prv_discover now supports setting up 'link' type app_info messages
support specifing overrides in the configuration
support a new 'link' field in rcl_app_info
minor cleanup and refactoring for rcl_prv_assembler, rcl_prv_discover
Diffstat (limited to 'src/rcl_app_info.erl')
-rw-r--r-- | src/rcl_app_info.erl | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/rcl_app_info.erl b/src/rcl_app_info.erl index d0192e6..bc64e30 100644 --- a/src/rcl_app_info.erl +++ b/src/rcl_app_info.erl @@ -49,6 +49,8 @@ active_deps/2, library_deps/1, library_deps/2, + link/1, + link/2, format_error/1, format/2, format/1]). @@ -60,6 +62,7 @@ -record(app_info_t, {name :: atom(), vsn :: ec_semver:semver(), dir :: file:name(), + link=false :: boolean(), active_deps :: [atom()], library_deps :: [atom()]}). @@ -80,7 +83,13 @@ new() -> %% @doc build a complete version of the app info with all fields set. -spec new(atom(), string(), file:name(), [atom()], [atom()]) -> {ok, t()} | relcool:error(). -new(AppName, Vsn, Dir, ActiveDeps, LibraryDeps) +new(AppName, Vsn, Dir, ActiveDeps, LibraryDeps) -> + new(AppName, Vsn, Dir, ActiveDeps, LibraryDeps, false). + +%% @doc build a complete version of the app info with all fields set. +-spec new(atom(), string(), file:name(), [atom()], [atom()], boolean()) -> + {ok, t()} | relcool:error(). +new(AppName, Vsn, Dir, ActiveDeps, LibraryDeps, Link) when erlang:is_atom(AppName), erlang:is_list(Dir), erlang:is_list(ActiveDeps), @@ -91,7 +100,8 @@ new(AppName, Vsn, Dir, ActiveDeps, LibraryDeps) ParsedVsn -> {ok, #app_info_t{name=AppName, vsn=ParsedVsn, dir=Dir, active_deps=ActiveDeps, - library_deps=LibraryDeps}} + library_deps=LibraryDeps, + link=Link}} end. -spec name(t()) -> atom(). @@ -145,6 +155,14 @@ library_deps(AppInfo=#app_info_t{}, LibraryDeps) when erlang:is_list(LibraryDeps) -> AppInfo#app_info_t{library_deps=LibraryDeps}. +-spec link(t()) -> boolean(). +link(#app_info_t{link=Link}) -> + Link. + +-spec link(t(), boolean()) -> t(). +link(AppInfo, NewLink) -> + AppInfo#app_info_t{link=NewLink}. + -spec format_error(Reason::term()) -> iolist(). format_error({vsn_parse, AppName}) -> io_lib:format("Error parsing version for ~p", @@ -156,9 +174,11 @@ format(AppInfo) -> -spec format(non_neg_integer(), t()) -> iolist(). format(Indent, #app_info_t{name=Name, vsn=Vsn, dir=Dir, - active_deps=Deps, library_deps=LibDeps}) -> + active_deps=Deps, library_deps=LibDeps, + link=Link}) -> [rcl_util:indent(Indent), erlang:atom_to_list(Name), "-", ec_semver:format(Vsn), ": ", Dir, "\n", + rcl_util:indent(Indent + 1), "Symlink: ", erlang:atom_to_list(Link), "\n", rcl_util:indent(Indent + 1), "Active Dependencies:\n", [[rcl_util:indent(Indent + 2), erlang:atom_to_list(Dep), ",\n"] || Dep <- Deps], rcl_util:indent(Indent + 1), "Library Dependencies:\n", |