From f71826357b6c6bbf5121f86d76d199eb9e9c60c4 Mon Sep 17 00:00:00 2001 From: Peter Harpending Date: Mon, 20 Apr 2026 12:46:53 -0700 Subject: [PATCH] initial commit --- .gitignore | 20 ++++++++++++++++++++ README.md | 9 +++++++++ rebar.config | 7 +++++++ src/gmplugin_hello.app.src | 14 ++++++++++++++ src/gmplugin_hello_app.erl | 18 ++++++++++++++++++ src/gmplugin_hello_sup.erl | 37 +++++++++++++++++++++++++++++++++++++ 6 files changed, 105 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 rebar.config create mode 100644 src/gmplugin_hello.app.src create mode 100644 src/gmplugin_hello_app.erl create mode 100644 src/gmplugin_hello_sup.erl diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..df53f7d --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +.rebar3 +_build +_checkouts +_vendor +.eunit +*.o +*.beam +*.plt +*.swp +*.swo +.erlang.cookie +ebin +log +erl_crash.dump +.rebar +logs +.idea +*.iml +rebar3.crashdump +*~ diff --git a/README.md b/README.md new file mode 100644 index 0000000..353f925 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +gmplugin_hello +===== + +An OTP application + +Build +----- + + $ rebar3 compile diff --git a/rebar.config b/rebar.config new file mode 100644 index 0000000..059fc27 --- /dev/null +++ b/rebar.config @@ -0,0 +1,7 @@ +{erl_opts, [debug_info]}. +{deps, []}. + +{shell, [ + %% {config, "config/sys.config"}, + {apps, [gmplugin_hello]} +]}. diff --git a/src/gmplugin_hello.app.src b/src/gmplugin_hello.app.src new file mode 100644 index 0000000..42522e6 --- /dev/null +++ b/src/gmplugin_hello.app.src @@ -0,0 +1,14 @@ +{application, gmplugin_hello, [ + {description, "An OTP application"}, + {vsn, "0.1.0"}, + {registered, []}, + {mod, {gmplugin_hello_app, []}}, + {applications, [ + kernel, + stdlib + ]}, + {env, []}, + {modules, []}, + {licenses, ["Apache-2.0"]}, + {links, []} + ]}. diff --git a/src/gmplugin_hello_app.erl b/src/gmplugin_hello_app.erl new file mode 100644 index 0000000..4143d73 --- /dev/null +++ b/src/gmplugin_hello_app.erl @@ -0,0 +1,18 @@ +%%%------------------------------------------------------------------- +%% @doc gmplugin_hello public API +%% @end +%%%------------------------------------------------------------------- + +-module(gmplugin_hello_app). + +-behaviour(application). + +-export([start/2, stop/1]). + +start(_StartType, _StartArgs) -> + gmplugin_hello_sup:start_link(). + +stop(_State) -> + ok. + +%% internal functions diff --git a/src/gmplugin_hello_sup.erl b/src/gmplugin_hello_sup.erl new file mode 100644 index 0000000..9cfa6a3 --- /dev/null +++ b/src/gmplugin_hello_sup.erl @@ -0,0 +1,37 @@ +%%%------------------------------------------------------------------- +%% @doc gmplugin_hello top level supervisor. +%% @end +%%%------------------------------------------------------------------- + +-module(gmplugin_hello_sup). + +-behaviour(supervisor). + +-export([start_link/0]). + +-export([init/1]). + +-define(SERVER, ?MODULE). + +start_link() -> + supervisor:start_link({local, ?SERVER}, ?MODULE, []). + +%% sup_flags() = #{strategy => strategy(), % optional +%% intensity => non_neg_integer(), % optional +%% period => pos_integer()} % optional +%% child_spec() = #{id => child_id(), % mandatory +%% start => mfargs(), % mandatory +%% restart => restart(), % optional +%% shutdown => shutdown(), % optional +%% type => worker(), % optional +%% modules => modules()} % optional +init([]) -> + SupFlags = #{ + strategy => one_for_all, + intensity => 0, + period => 1 + }, + ChildSpecs = [], + {ok, {SupFlags, ChildSpecs}}. + +%% internal functions