Make everything start as a 'permanent' app type.

This commit is contained in:
Craig Everett 2019-12-28 22:36:55 +09:00
parent 0cca3d300d
commit 6443c1f675
48 changed files with 31 additions and 35 deletions

View File

@ -1 +1 @@
0.5.4
0.5.9

View File

@ -1,6 +1,6 @@
{application,zx,
[{description,"An Erlang development tool and Zomp user client"},
{vsn,"0.5.4"},
{vsn,"0.5.9"},
{applications,[stdlib,kernel]},
{modules,[zx,zx_auth,zx_conn,zx_conn_sup,zx_daemon,zx_key,
zx_lib,zx_local,zx_net,zx_peer,zx_peer_man,

View File

@ -24,7 +24,7 @@
%%% @end
-module(zx).
-vsn("0.5.4").
-vsn("0.5.9").
-behavior(application).
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
@ -397,7 +397,7 @@ start() ->
Types = [lib, app, gui, cli],
ok = log(info, "ZSP meta keys: ~w", [MetaKeys]),
ok = log(info, "Available package types: ~w", [Types]),
application:ensure_started(zx).
application:ensure_started(zx, permanent).
-spec stop() -> ok | {error, Reason :: term()}.
@ -813,7 +813,7 @@ execute(cli, PackageID, Meta, Dir, RunArgs) ->
Name = element(2, PackageID),
ok = zx_daemon:pass_meta(Meta, Dir, RunArgs),
AppTag = list_to_atom(Name),
{ok, _} = application:ensure_all_started(AppTag),
{ok, _} = application:ensure_all_started(AppTag, permanent),
case maps:get(mod, Meta, none) of
none ->
{error, "No executable module"};
@ -827,12 +827,13 @@ execute(Type, PackageID, Meta, Dir, RunArgs) ->
Name = element(2, PackageID),
ok = zx_daemon:pass_meta(Meta, Dir, RunArgs),
AppTag = list_to_atom(Name),
ok = ensure_all_started(AppTag),
ok = ensure_all_started(AppTag, permanent),
tell("Launcher complete.").
-spec ensure_all_started(AppMod) -> ok
when AppMod :: module().
-spec ensure_all_started(AppMod, Type) -> ok
when AppMod :: module(),
Type :: application:restart_type().
%% @private
%% Wrap a call to application:ensure_all_started/1 to selectively provide output
%% in the case any dependencies are actually started by the call. Might remove this
@ -840,8 +841,8 @@ execute(Type, PackageID, Meta, Dir, RunArgs) ->
%% whether it becomes common for dependencies to all signal their own start states
%% somehow.
ensure_all_started(AppMod) ->
case application:ensure_all_started(AppMod) of
ensure_all_started(AppMod, Type) ->
case application:ensure_all_started(AppMod, Type) of
{ok, []} -> ok;
{ok, Apps} -> tell("Started ~160tp", [Apps])
end.

View File

@ -9,7 +9,7 @@
%%% @end
-module(zx_auth).
-vsn("0.5.4").
-vsn("0.5.9").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -7,7 +7,7 @@
%%% @end
-module(zx_conn).
-vsn("0.5.4").
-vsn("0.5.9").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -5,7 +5,7 @@
%%% @end
-module(zx_conn_sup).
-vsn("0.5.4").
-vsn("0.5.9").
-behavior(supervisor).
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").

View File

@ -138,7 +138,7 @@
%%% @end
-module(zx_daemon).
-vsn("0.5.4").
-vsn("0.5.9").
-behavior(gen_server).
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").

View File

@ -8,7 +8,7 @@
%%% @end
-module(zx_key).
-vsn("0.5.4").
-vsn("0.5.9").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -10,7 +10,7 @@
%%% @end
-module(zx_lib).
-vsn("0.5.4").
-vsn("0.5.9").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -6,7 +6,7 @@
%%% @end
-module(zx_local).
-vsn("0.5.4").
-vsn("0.5.9").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -5,7 +5,7 @@
%%% @end
-module(zx_net).
-vsn("0.5.4").
-vsn("0.5.9").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -8,7 +8,7 @@
%%% @end
-module(zx_peer).
-vsn("0.5.4").
-vsn("0.5.9").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -9,7 +9,7 @@
%%% @end
-module(zx_peer_man).
-vsn("0.5.4").
-vsn("0.5.9").
-behavior(gen_server).
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").

View File

@ -6,7 +6,7 @@
%%% @end
-module(zx_peer_sup).
-vsn("0.5.4").
-vsn("0.5.9").
-behaviour(supervisor).
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").

View File

@ -10,7 +10,7 @@
%%% @end
-module(zx_peers).
-vsn("0.5.4").
-vsn("0.5.9").
-behavior(supervisor).
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").

View File

@ -5,7 +5,7 @@
%%% @end
-module(zx_proxy).
-vsn("0.5.4").
-vsn("0.5.9").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -5,7 +5,7 @@
%%% @end
-module(zx_sup).
-vsn("0.5.4").
-vsn("0.5.9").
-behavior(supervisor).
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").

View File

@ -6,7 +6,7 @@
%%% @end
-module(zx_tty).
-vsn("0.5.4").
-vsn("0.5.9").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -5,7 +5,7 @@
%%% @end
-module(zx_userconf).
-vsn("0.5.4").
-vsn("0.5.9").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -7,7 +7,7 @@
%%% @end
-module(zx_zsp).
-vsn("0.5.4").
-vsn("0.5.9").
-author("Craig Everett <zxq9@zxq9.com>").
-copyright("Craig Everett <zxq9@zxq9.com>").
-license("GPL-3.0").

View File

@ -28,13 +28,8 @@
-type state() :: term().
%%% Element Labels
-define(sysMENU, 10).
-define(sysLANG, 11).
-define(sysQUERY, 12).
%%% Interface functions
show(Terms) ->
wx_object:cast(?MODULE, {show, Terms}).

View File

@ -39,7 +39,7 @@ init([]) ->
{*PREFIX*con, start_link, []},
permanent,
5000,
supervisor,
worker,
[*PREFIX*con]},
Children = [Clients],
{ok, {RestartStrategy, Children}}.

View File

@ -8,7 +8,7 @@
{license,"MIT"}.
{modules,[]}.
{name,"zx"}.
{package_id,{"otpr","zx",{0,5,4}}}.
{package_id,{"otpr","zx",{0,5,9}}}.
{prefix,"zx_"}.
{repo_url,"https://gitlab.com/zxq9/zx"}.
{tags,["tools","package manager","erlang"]}.