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, {application,zx,
[{description,"An Erlang development tool and Zomp user client"}, [{description,"An Erlang development tool and Zomp user client"},
{vsn,"0.5.4"}, {vsn,"0.5.9"},
{applications,[stdlib,kernel]}, {applications,[stdlib,kernel]},
{modules,[zx,zx_auth,zx_conn,zx_conn_sup,zx_daemon,zx_key, {modules,[zx,zx_auth,zx_conn,zx_conn_sup,zx_daemon,zx_key,
zx_lib,zx_local,zx_net,zx_peer,zx_peer_man, zx_lib,zx_local,zx_net,zx_peer,zx_peer_man,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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