Skip to content

Commit

Permalink
Add tempalte files for application
Browse files Browse the repository at this point in the history
  • Loading branch information
Shunichi Shinohara committed Dec 21, 2011
1 parent 6019e49 commit b5df8ed
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
.eunit
ebin
23 changes: 23 additions & 0 deletions Makefile
@@ -0,0 +1,23 @@
.PHONY: all compile deps clean test

EBIN_DIR = ebin

all: deps compile test

compile:
./rebar compile skip_deps=true
./rebar xref skip_deps=true

deps:
./rebar update-deps
./rebar get-deps
./rebar compile
./rebar xref skip_deps=true

clean:
./rebar clean skip_deps=true
-rm -f erl_crash.dump
-rm -f TEST-*.xml

test:
./rebar eunit skip_deps=true
Binary file added rebar
Binary file not shown.
12 changes: 12 additions & 0 deletions src/rt_cover.app.src
@@ -0,0 +1,12 @@
{application, rt_cover,
[
{description, "Take coverage of applications at runtime"},
{vsn, "0.1.0"},
{registered, []},
{applications, [
kernel,
stdlib
]},
{mod, { rt_cover_app, []}},
{env, []}
]}.
16 changes: 16 additions & 0 deletions src/rt_cover_app.erl
@@ -0,0 +1,16 @@
-module(rt_cover_app).

-behaviour(application).

%% Application callbacks
-export([start/2, stop/1]).

%% ===================================================================
%% Application callbacks
%% ===================================================================

start(_StartType, _StartArgs) ->
rt_cover_sup:start_link().

stop(_State) ->
ok.
28 changes: 28 additions & 0 deletions src/rt_cover_sup.erl
@@ -0,0 +1,28 @@

-module(rt_cover_sup).

-behaviour(supervisor).

%% API
-export([start_link/0]).

%% Supervisor callbacks
-export([init/1]).

%% Helper macro for declaring children of supervisor
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).

%% ===================================================================
%% API functions
%% ===================================================================

start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).

%% ===================================================================
%% Supervisor callbacks
%% ===================================================================

init([]) ->
{ok, { {one_for_one, 5, 10}, []} }.

0 comments on commit b5df8ed

Please sign in to comment.