Make tempaltes generate modules with a -vsn directive set.

This commit is contained in:
Craig Everett 2020-01-09 21:48:34 +09:00
parent 667d5b3e63
commit 7e0e4a798d
48 changed files with 48 additions and 28 deletions

View File

@ -1 +1 @@
0.7.1 0.7.2

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.7.1"}, {vsn,"0.7.2"},
{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.7.1"). -vsn("0.7.2").
-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>").

View File

@ -9,7 +9,7 @@
%%% @end %%% @end
-module(zx_auth). -module(zx_auth).
-vsn("0.7.1"). -vsn("0.7.2").
-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.7.1"). -vsn("0.7.2").
-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.7.1"). -vsn("0.7.2").
-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.7.1"). -vsn("0.7.2").
-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.7.1"). -vsn("0.7.2").
-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.7.1"). -vsn("0.7.2").
-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.7.1"). -vsn("0.7.2").
-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").
@ -1487,11 +1487,12 @@ create_project(#project{type = escript,
"Escript \"~ts\" written to ~ts.~n" "Escript \"~ts\" written to ~ts.~n"
"You may need to change the file mode to add \"execute\" permissions.~n", "You may need to change the file mode to add \"execute\" permissions.~n",
io:format(Message, [Name, File]); io:format(Message, [Name, File]);
create_project(P = #project{id = {_, Name, _}}) -> create_project(P = #project{id = {_, Name, Version}}) ->
case file:make_dir(Name) of case file:make_dir(Name) of
ok -> ok ->
ok = file:set_cwd(Name), ok = file:set_cwd(Name),
ok = munge_sources(P), {ok, VersionString} = zx_lib:version_to_string(Version),
ok = munge_sources(P, VersionString),
zompify(P); zompify(P);
{error, Reason} -> {error, Reason} ->
Message = "Creating directory ~ts failed with ~tp. Aborting.", Message = "Creating directory ~ts failed with ~tp. Aborting.",
@ -1507,13 +1508,15 @@ munge_sources(#project{type = lib,
author = Credit, author = Credit,
a_email = AEmail, a_email = AEmail,
copyright = Holder, copyright = Holder,
c_email = CEmail}) -> c_email = CEmail},
VersionString) ->
ok = file:make_dir("src"), ok = file:make_dir("src"),
ok = file:make_dir("ebin"), ok = file:make_dir("ebin"),
{ok, ProjectDir} = file:get_cwd(), {ok, ProjectDir} = file:get_cwd(),
Substitutions = Substitutions =
[{"\*PROJECT NAME\*〙", Name}, [{"\*PROJECT NAME\*〙", Name},
{"\*MODULE\*〙", Module}, {"\*MODULE\*〙", Module},
{"\*VERSION\*〙", VersionString},
{"\*AUTHOR\*〙", author(Credit, AEmail)}, {"\*AUTHOR\*〙", author(Credit, AEmail)},
{"\*COPYRIGHT\*〙", copyright(Holder, CEmail)}, {"\*COPYRIGHT\*〙", copyright(Holder, CEmail)},
{"\*LICENSE\*〙", license(Title)}], {"\*LICENSE\*〙", license(Title)}],
@ -1532,13 +1535,15 @@ munge_sources(#project{type = cli,
author = Credit, author = Credit,
a_email = AEmail, a_email = AEmail,
copyright = Holder, copyright = Holder,
c_email = CEmail}) -> c_email = CEmail},
VersionString) ->
ok = file:make_dir("src"), ok = file:make_dir("src"),
ok = file:make_dir("ebin"), ok = file:make_dir("ebin"),
{ok, ProjectDir} = file:get_cwd(), {ok, ProjectDir} = file:get_cwd(),
Substitutions = Substitutions =
[{"\*PROJECT NAME\*〙", Name}, [{"\*PROJECT NAME\*〙", Name},
{"\*MODULE\*〙", Module}, {"\*MODULE\*〙", Module},
{"\*VERSION\*〙", VersionString},
{"\*AUTHOR\*〙", author(Credit, AEmail)}, {"\*AUTHOR\*〙", author(Credit, AEmail)},
{"\*COPYRIGHT\*〙", copyright(Holder, CEmail)}, {"\*COPYRIGHT\*〙", copyright(Holder, CEmail)},
{"\*LICENSE\*〙", license(Title)}], {"\*LICENSE\*〙", license(Title)}],
@ -1558,12 +1563,14 @@ munge_sources(#project{type = Type,
author = Credit, author = Credit,
a_email = AEmail, a_email = AEmail,
copyright = Holder, copyright = Holder,
c_email = CEmail}) -> c_email = CEmail},
VersionString) ->
ok = file:make_dir("src"), ok = file:make_dir("src"),
ok = file:make_dir("ebin"), ok = file:make_dir("ebin"),
{ok, ProjectDir} = file:get_cwd(), {ok, ProjectDir} = file:get_cwd(),
Substitutions = Substitutions =
[{"\*PROJECT NAME\*〙", Name}, [{"\*PROJECT NAME\*〙", Name},
{"\*VERSION\*〙", VersionString},
{"\*PREFIX\*〙", Prefix}, {"\*PREFIX\*〙", Prefix},
{"\*APP MOD\*〙", AppMod}, {"\*APP MOD\*〙", AppMod},
{"\*AUTHOR\*〙", author(Credit, AEmail)}, {"\*AUTHOR\*〙", author(Credit, AEmail)},

View File

@ -5,7 +5,7 @@
%%% @end %%% @end
-module(zx_net). -module(zx_net).
-vsn("0.7.1"). -vsn("0.7.2").
-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.7.1"). -vsn("0.7.2").
-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.7.1"). -vsn("0.7.2").
-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.7.1"). -vsn("0.7.2").
-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.7.1"). -vsn("0.7.2").
-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.7.1"). -vsn("0.7.2").
-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.7.1"). -vsn("0.7.2").
-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.7.1"). -vsn("0.7.2").
-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.7.1"). -vsn("0.7.2").
-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.7.1"). -vsn("0.7.2").
-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,6 +9,7 @@
%%% @end %%% @end
-module(*MODULE*). -module(*MODULE*).
-vsn("〘*VERSION*〙").
*AUTHOR* *AUTHOR*
*COPYRIGHT* *COPYRIGHT*
*LICENSE* *LICENSE*

View File

@ -3,6 +3,7 @@
%%% @end %%% @end
-module(*APP MOD*). -module(*APP MOD*).
-vsn("〘*VERSION*〙").
-behavior(application). -behavior(application).
*AUTHOR* *AUTHOR*
*COPYRIGHT* *COPYRIGHT*

View File

@ -14,6 +14,7 @@
%%% @end %%% @end
-module(*PREFIX*client). -module(*PREFIX*client).
-vsn("〘*VERSION*〙").
*AUTHOR* *AUTHOR*
*COPYRIGHT* *COPYRIGHT*
*LICENSE* *LICENSE*

View File

@ -10,6 +10,7 @@
%%% @end %%% @end
-module(*PREFIX*client_man). -module(*PREFIX*client_man).
-vsn("〘*VERSION*〙").
-behavior(gen_server). -behavior(gen_server).
*AUTHOR* *AUTHOR*
*COPYRIGHT* *COPYRIGHT*

View File

@ -2,8 +2,8 @@
%%% *PROJECT NAME* Client Supervisor %%% *PROJECT NAME* Client Supervisor
%%% %%%
%%% This process supervises the client socket handlers themselves. It is a peer of the %%% This process supervises the client socket handlers themselves. It is a peer of the
%%% *PREFIX*client_man (the manager interface to this network service component), and a %%% *PREFIX*client_man (the manager interface to this network service component),
%%% child of the supervisor named *PREFIX*clients. %%% and a child of the supervisor named *PREFIX*clients.
%%% %%%
%%% Because we don't know (or care) how many client connections the server may end up %%% Because we don't know (or care) how many client connections the server may end up
%%% handling this is a simple_one_for_one supervisor which can spawn and manage as %%% handling this is a simple_one_for_one supervisor which can spawn and manage as
@ -14,6 +14,7 @@
%%% @end %%% @end
-module(*PREFIX*client_sup). -module(*PREFIX*client_sup).
-vsn("〘*VERSION*〙").
-behaviour(supervisor). -behaviour(supervisor).
*AUTHOR* *AUTHOR*
*COPYRIGHT* *COPYRIGHT*

View File

@ -9,6 +9,7 @@
%%% @end %%% @end
-module(*PREFIX*clients). -module(*PREFIX*clients).
-vsn("〘*VERSION*〙").
-behavior(supervisor). -behavior(supervisor).
*AUTHOR* *AUTHOR*
*COPYRIGHT* *COPYRIGHT*

View File

@ -12,6 +12,7 @@
%%% @end %%% @end
-module(*PREFIX*sup). -module(*PREFIX*sup).
-vsn("〘*VERSION*〙").
-behaviour(supervisor). -behaviour(supervisor).
*AUTHOR* *AUTHOR*
*COPYRIGHT* *COPYRIGHT*

View File

@ -3,6 +3,7 @@
%%% @end %%% @end
-module(*APP MOD*). -module(*APP MOD*).
-vsn("〘*VERSION*〙").
-behavior(application). -behavior(application).
*AUTHOR* *AUTHOR*
*COPYRIGHT* *COPYRIGHT*

View File

@ -5,6 +5,7 @@
%%% @end %%% @end
-module(*PREFIX*con). -module(*PREFIX*con).
-vsn("〘*VERSION*〙").
*AUTHOR* *AUTHOR*
*COPYRIGHT* *COPYRIGHT*
*LICENSE* *LICENSE*

View File

@ -7,6 +7,7 @@
%%% @end %%% @end
-module(*PREFIX*gui). -module(*PREFIX*gui).
-vsn("〘*VERSION*〙").
*AUTHOR* *AUTHOR*
*COPYRIGHT* *COPYRIGHT*
*LICENSE* *LICENSE*

View File

@ -12,6 +12,7 @@
%%% @end %%% @end
-module(*PREFIX*sup). -module(*PREFIX*sup).
-vsn("〘*VERSION*〙").
-behaviour(supervisor). -behaviour(supervisor).
*AUTHOR* *AUTHOR*
*COPYRIGHT* *COPYRIGHT*

View File

@ -9,6 +9,7 @@
%%% @end %%% @end
-module(*MODULE*). -module(*MODULE*).
-vsn("〘*VERSION*〙").
*AUTHOR* *AUTHOR*
*COPYRIGHT* *COPYRIGHT*
*LICENSE* *LICENSE*

View File

@ -4,11 +4,12 @@
{copyright,"Craig Everett"}. {copyright,"Craig Everett"}.
{deps,[]}. {deps,[]}.
{desc,"An Erlang development tool and Zomp user client"}. {desc,"An Erlang development tool and Zomp user client"}.
{file_exts,[]}.
{key_name,none}. {key_name,none}.
{license,"MIT"}. {license,"MIT"}.
{modules,[]}. {modules,[]}.
{name,"zx"}. {name,"zx"}.
{package_id,{"otpr","zx",{0,7,1}}}. {package_id,{"otpr","zx",{0,7,2}}}.
{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"]}.