rebar_base_compiler (rebar v0.0.0+build.5492.ref67808dff)

View Source

Summary

Functions

format error and warning strings for a given source file according to user preferences.

format error and warning strings for a given source file according to user preferences.

from a given path, and based on the user-provided options, format the file path according to the preferences.

Format good compiler results with warnings to work with module internals. Assumes that warnings are not treated as errors.

Format good compiler results with warnings to work with module internals. Assumes that warnings are not treated as errors.

Runs a compile job, applying compile_fn() to all files, starting with First files, and then RestFiles.

Runs a compile job, applying compile_fn3() to all files, starting with First files, and then the other content of SourceDir. Files looked for are those ending in SourceExt. Results of the compilation are put in TargetDir with the base file names postfixed with SourceExt.

Runs a compile job, applying compile_fn3() to all files, starting with First files, and then the other content of SourceDir. Files looked for are those ending in SourceExt. Results of the compilation are put in TargetDir with the base file names postfixed with SourceExt. Additional compile options can be passed in the last argument as a proplist.

Types

col/0

-type col() :: integer().

compile_fn3/0

-type compile_fn3() ::
          fun((file:filename(), file:filename(), [{_, _}] | rebar_dict()) -> compile_fn_ret()).

compile_fn/0

-type compile_fn() :: fun((file:filename(), [{_, _}] | rebar_dict()) -> compile_fn_ret()).

compile_fn_ret/0

-type compile_fn_ret() :: ok | {ok, [string()]} | skipped | term().

desc/0

-type desc() :: term().

err_or_warn/0

-type err_or_warn() :: {module(), desc()} | {loc(), module(), desc()}.

error_tuple/0

-type error_tuple() :: {error, [string()], [string()]}.

line/0

-type line() :: integer().

loc/0

-type loc() :: {line(), col()} | line().

rebar_dict/0

-type rebar_dict() :: dict:dict().

Functions

error_tuple(Source, Es, Ws, Opts)

-spec error_tuple(file:filename(), [Err], [Warn], rebar_dict() | [{_, _}]) -> error_tuple()
                     when Err :: string(), Warn :: string().

format error and warning strings for a given source file according to user preferences.

error_tuple(Source, Es, Ws, Config, Opts)

-spec error_tuple(file:filename(), [Err], [Warn], rebar_dict(), [{_, _}]) -> error_tuple()
                     when Err :: string(), Warn :: string().

format error and warning strings for a given source file according to user preferences.

format_error_source(Path, Opts)

-spec format_error_source(file:filename(), rebar_dict() | [{_, _}]) -> file:filename().

from a given path, and based on the user-provided options, format the file path according to the preferences.

ok_tuple(Source, Ws)

-spec ok_tuple(file:filename(), [string()]) -> {ok, [string()]}.

Format good compiler results with warnings to work with module internals. Assumes that warnings are not treated as errors.

ok_tuple(Source, Ws, Config, Opts)

-spec ok_tuple(file:filename(), [string()], rebar_dict(), [{_, _}]) -> {ok, [string()]}.

Format good compiler results with warnings to work with module internals. Assumes that warnings are not treated as errors.

run(Config, FirstFiles, RestFiles, CompileFn)

-spec run(rebar_dict() | [{_, _}], [First], [Next], compile_fn()) -> compile_fn_ret()
             when First :: file:filename(), Next :: file:filename().

Runs a compile job, applying compile_fn() to all files, starting with First files, and then RestFiles.

run(Config, FirstFiles, SourceDir, SourceExt, TargetDir, TargetExt, Compile3Fn)

-spec run(rebar_dict() | [{_, _}], [First], SourceDir, SourceExt, TargetDir, TargetExt, compile_fn3()) ->
             compile_fn_ret()
             when
                 First :: file:filename(),
                 SourceDir :: file:filename(),
                 TargetDir :: file:filename(),
                 SourceExt :: string(),
                 TargetExt :: string().

Runs a compile job, applying compile_fn3() to all files, starting with First files, and then the other content of SourceDir. Files looked for are those ending in SourceExt. Results of the compilation are put in TargetDir with the base file names postfixed with SourceExt.

run(Config, FirstFiles, SourceDir, SourceExt, TargetDir, TargetExt, Compile3Fn, Opts)

-spec run(rebar_dict() | [{_, _}],
          [First],
          SourceDir, SourceExt, TargetDir, TargetExt,
          compile_fn3(),
          [term()]) ->
             compile_fn_ret()
             when
                 First :: file:filename(),
                 SourceDir :: file:filename(),
                 TargetDir :: file:filename(),
                 SourceExt :: string(),
                 TargetExt :: string().

Runs a compile job, applying compile_fn3() to all files, starting with First files, and then the other content of SourceDir. Files looked for are those ending in SourceExt. Results of the compilation are put in TargetDir with the base file names postfixed with SourceExt. Additional compile options can be passed in the last argument as a proplist.