Pārlūkot izejas kodu

Merge pull request #32 from rebar/plugin-api

API for Plugins (solves #22)
pull/33/head
Tristan Sloughter pirms 10 gadiem
vecāks
revīzija
da91aa3073
1 mainītis faili ar 31 papildinājumiem un 0 dzēšanām
  1. +31
    -0
      src/rebar_api.erl

+ 31
- 0
src/rebar_api.erl Parādīt failu

@ -0,0 +1,31 @@
%%% Packages rebar.hrl features and macros into a more generic API
%%% that can be used by plugin builders.
-module(rebar_api).
-include("rebar.hrl").
-export([abort/0, abort/2,
console/2,
debug/2, info/2, warn/2, error/2]).
-export_type([rebar_dict/0, rebar_digraph/0]).
%%%%%%%%%%%%%%%%%%%%%%%
%%% Error reporting %%%
%%%%%%%%%%%%%%%%%%%%%%%
%% @doc Interrupts program flow
abort() -> ?FAIL.
%% @doc like {@link error/2}, except it also raises an
%% exception to interrupt program flow.
abort(Str, Args) -> ?ABORT(Str, Args).
%% @doc Prints to the console, including a newline
console(Str, Args) -> ?CONSOLE(Str, Args).
%% @doc logs with severity `debug'
debug(Str, Args) -> ?DEBUG(Str, Args).
%% @doc logs with severity `info'
info(Str, Args) -> ?INFO(Str, Args).
%% @doc logs with severity `warn'
warn(Str, Args) -> ?WARN(Str, Args).
%% @doc logs with severity `error'
error(Str, Args) -> ?ERROR(Str, Args).

Notiek ielāde…
Atcelt
Saglabāt