0.12.3: Correct launch optimization, fix local file deletion bug on failed run start.

This commit is contained in:
Craig Everett 2021-03-04 14:24:55 +09:00
parent 01884f3bd4
commit 26a2a0fe5d
57 changed files with 64 additions and 48 deletions

10
: Normal file
View File

@ -0,0 +1,10 @@
Ensure paths are set for local libs
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# ブランチ master
# Your branch is up to date with 'origin/master'.
#
# コミット予定の変更点:
# modified: zomp/lib/otpr/zx/0.12.2/src/zx.erl
#

View File

@ -3,7 +3,7 @@
# A convenience script that will download the ZX installer, unpack it, and clean up. # A convenience script that will download the ZX installer, unpack it, and clean up.
# For maximum portability this script uses the gzipped package version. # For maximum portability this script uses the gzipped package version.
version=0.11.6 version=0.12.3
zx="zx-$version" zx="zx-$version"
tarball="$zx.tar.gz" tarball="$zx.tar.gz"

View File

@ -11,7 +11,7 @@ export ZX_DIR="$ZOMP_DIR/lib/otpr/zx/$ZX_VERSION"
start_dir="$PWD" start_dir="$PWD"
cd "$ZX_DIR" cd "$ZX_DIR"
if [ ! -f ebin/zx.erl ] if [ ! -f ebin/zx.beam ]
then then
chmod +x make_zx chmod +x make_zx
./make_zx ./make_zx

View File

@ -11,7 +11,7 @@ export ZX_DIR="$ZOMP_DIR/lib/otpr/zx/$ZX_VERSION"
start_dir="$PWD" start_dir="$PWD"
cd "$ZX_DIR" cd "$ZX_DIR"
if [ ! -f ebin/zx.erl ] if [ ! -f ebin/zx.beam ]
then then
chmod +x make_zx chmod +x make_zx
./make_zx ./make_zx

View File

@ -1 +1 @@
0.12.1 0.12.3

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.12.2"}, {vsn,"0.12.3"},
{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

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -24,7 +24,7 @@
%%% @end %%% @end
-module(zx). -module(zx).
-vsn("0.12.2"). -vsn("0.12.3").
-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>").
@ -404,27 +404,28 @@ compatibility_check(Platforms) ->
%% @equiv application:ensure_started(zx). %% @equiv application:ensure_started(zx).
start() -> start() ->
LogPath = case init:get_plain_arguments() of
case init:get_plain_arguments() of ["run", PackageString | _] ->
["run", PackageString | _] -> case zx_lib:package_id(PackageString) of
case zx_lib:package_id(PackageString) of {ok, PackID} -> start(zx_lib:new_logpath(PackID));
{ok, PackageID} -> zx_lib:new_logpath(PackageID); Error -> done(Error)
Error -> done(Error) end;
end; ["rundir", Path | _] ->
["rundir", Path | _] -> case zx_lib:read_project_meta(Path) of
case zx_lib:read_project_meta(Path) of {ok, #{package_id := PackID}} -> start(zx_lib:new_logpath(PackID));
{ok, #{package_id := PackageID}} -> zx_lib:new_logpath(PackageID); Error -> done(Error)
Error -> done(Error) end;
end; ["runlocal" | _] ->
["runlocal" | _] -> case zx_lib:read_project_meta() of
case zx_lib:read_project_meta() of {ok, #{package_id := PackID}} -> start(zx_lib:new_logpath(PackID));
{ok, #{package_id := PackageID}} -> zx_lib:new_logpath(PackageID); Error -> done(Error)
Error -> done(Error) end;
end; _ ->
_ -> {ok, Version} = zx_lib:string_to_version(os:getenv("ZX_VERSION")),
{ok, Version} = zx_lib:string_to_version(os:getenv("ZX_VERSION")), start(zx_lib:new_logpath({"otpr", "zx", Version}))
zx_lib:new_logpath({"otpr", "zx", Version}) end.
end,
start(LogPath) ->
ok = logger:remove_handler(default), ok = logger:remove_handler(default),
LogDir = filename:dirname(LogPath), LogDir = filename:dirname(LogPath),
ok = trim_logs(LogDir), ok = trim_logs(LogDir),
@ -992,10 +993,15 @@ run_dir(TargetDir, RunArgs) ->
RunArgs :: [string()]. RunArgs :: [string()].
run_project(ProjectDir, ExecDir, RunArgs) -> run_project(ProjectDir, ExecDir, RunArgs) ->
{ok, Meta} = zx_lib:read_project_meta(), case zx_lib:read_project_meta() of
{ok, Dir} = file:get_cwd(), {ok, Meta} -> run_project(ProjectDir, ExecDir, RunArgs, Meta);
Error -> Error
end.
run_project(ProjectDir, ExecDir, RunArgs, Meta) ->
case pre_prep(Meta, RunArgs) of case pre_prep(Meta, RunArgs) of
{Type, Deps, NewArgs} -> {Type, Deps, NewArgs} ->
{ok, Dir} = file:get_cwd(),
PackageID = {_, Name, _} = maps:get(package_id, Meta), PackageID = {_, Name, _} = maps:get(package_id, Meta),
true = os:putenv(Name ++ "_include", filename:join(Dir, "include")), true = os:putenv(Name ++ "_include", filename:join(Dir, "include")),
case prepare(Deps) of case prepare(Deps) of

View File

@ -9,7 +9,7 @@
%%% @end %%% @end
-module(zx_auth). -module(zx_auth).
-vsn("0.12.2"). -vsn("0.12.3").
-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.12.2"). -vsn("0.12.3").
-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.12.2"). -vsn("0.12.3").
-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.12.2"). -vsn("0.12.3").
-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.12.2"). -vsn("0.12.3").
-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.12.2"). -vsn("0.12.3").
-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").
@ -228,7 +228,7 @@ read_project_meta(Dir) ->
Meta = maps:merge(zx_zsp:new_meta(), maps:from_list(Data)), Meta = maps:merge(zx_zsp:new_meta(), maps:from_list(Data)),
{ok, Meta}; {ok, Meta};
{error, enoent} -> {error, enoent} ->
{error, "No project zomp.meta file. Wrong directory? Not initialized?", 2}; {error, "No project zomp.meta file. Wrong directory? Not initialized?", 0};
Error -> Error ->
ok = log(error, "Read from zomp.meta failed with: ~tw", [Error]), ok = log(error, "Read from zomp.meta failed with: ~tw", [Error]),
Error Error

View File

@ -6,7 +6,7 @@
%%% @end %%% @end
-module(zx_local). -module(zx_local).
-vsn("0.12.2"). -vsn("0.12.3").
-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.12.2"). -vsn("0.12.3").
-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.12.2"). -vsn("0.12.3").
-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.12.2"). -vsn("0.12.3").
-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.12.2"). -vsn("0.12.3").
-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.12.2"). -vsn("0.12.3").
-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.12.2"). -vsn("0.12.3").
-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.12.2"). -vsn("0.12.3").
-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.12.2"). -vsn("0.12.3").
-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.12.2"). -vsn("0.12.3").
-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.12.2"). -vsn("0.12.3").
-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 @@
{license,"MIT"}. {license,"MIT"}.
{modules,[]}. {modules,[]}.
{name,"zx"}. {name,"zx"}.
{package_id,{"otpr","zx",{0,12,2}}}. {package_id,{"otpr","zx",{0,12,3}}}.
{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"]}.