View gist:2f4b44f6e314f037e9e2
1 2 3 4 5
[date, "T", time, "",
{module, [
" mod=",
module], ""},
" ", message, EOL]
View gist:1e16d70268182db1415a

Rebar3 Profiles

Motivation

Often you want to build the same project in different ways depending on context, whether it be development or preparing for production deployment. Or you want some dependencies only for use in certain contexts such as running tests and don't want them conflicting with regular dependencies or bother to be fetched and built when not needed.

Those are some of the reasons we've introduced profiles.

Directory Structure

View gist:14a3c46351dadb65119d
1 2 3 4 5 6 7 8 9
λ ../rebar/rebar3 pkgs
zeta:
Versions: 0.1.1
 
tinymt:
Versions: 0.0.9
 
swab:
Versions: 1.0.0
View gist:20081e667eae0554228a
λ ../rebar/rebar3 help release
Usage: rebar release [-n <relname>] [-v <relvsn>] [-g <goal>]
                     [-u <upfrom>] [-o <output_dir>] [-h] [-l <lib_dir>]
                     [-p <path>] [--default-libs <default_libs>]
                     [-V [<log_level>]] [-d <dev_mode>]
                     [-i <include_erts>] [-a <override>] [-c [<config>]]
                     [--overlay_vars <overlay_vars>]
                     [--sys_config <sys_config>]
                     [--system_libs <system_libs>] [--version]
View gist:592b3e38dcddff5bc770
λ ./rebar3 help compile                     
Usage: rebar compile [-j <jobs>]

  -j, --jobs  Number of concurrent workers the compiler may use. Default: 3
View hello.c
1 2 3 4 5 6 7 8 9 10
#include "erl_nif.h"
 
static ERL_NIF_TERM world(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
return enif_make_string(env, "Hello world!", ERL_NIF_LATIN1);
}
 
static ErlNifFunc nif_funcs[] = {
{"world", 0, world}
};
View erl_nif.rs
1 2 3 4 5 6 7 8 9 10
/* automatically generated by rust-bindgen */
extern crate libc;
use libc::size_t;
use libc::ssize_t;
 
#[repr(C)]
pub struct ErlDrvSysInfo {
pub driver_major_version: ::libc::c_int,
pub driver_minor_version: ::libc::c_int,
pub erts_version: *mut ::libc::c_char,
View erl_nif.rs
1 2 3 4 5 6 7 8 9 10
/* automatically generated by rust-bindgen */
 
pub type ErlNifUInt64 = ::libc::c_ulong;
pub type ErlNifSInt64 = ::libc::c_long;
pub type ERL_NIF_TERM = ::libc::c_ulong;
pub type ERL_NIF_UINT = ERL_NIF_TERM;
pub enum Struct_enif_environment_t { }
pub type ErlNifEnv = Struct_enif_environment_t;
#[repr(C)]
pub struct ErlNifFunc {
View gist:4f9ef949281acfe9d4c7
1 2 3 4 5 6
dialyzer --fullpath --plt /home/tristan/Devel/rebar/.depsolver_plt -Wno_opaque -Wrace_conditions -r ./ebin
Checking whether the PLT /home/tristan/Devel/rebar/.depsolver_plt is up-to-date... yes
Proceeding with analysis...
dialyzer: Analysis failed with error:
Could not scan the following file(s):
Could not get core Erlang code for: /home/tristan/Devel/rebar/ebin/rebar_prv_version.beam Could not get core Erlang code for: /home/tristan/Devel/rebar/ebin/rebar_prv_update.beam Could not get core Erlang code for: /home/tristan/Devel/rebar/ebin/rebar_prv_shell.beam Could not get core Erlang code for: /home/tristan/Devel/rebar/ebin/rebar_prv_tar.beam Could not get core Erlang code for: /home/tristan/Devel/rebar/ebin/rebar_prv_release.beam Could not get core Erlang code for: /home/tristan/Devel/rebar/ebin/rebar_prv_packages.beam Could not get core Erlang code for: /home/tristan/Devel/rebar/ebin/rebar_prv_new.beam Could not get core Erlang code for: /home/tristan/Devel/rebar/ebin/rebar_prv_lock.beam Could
View gist:dbdd7e8d5a38a93247f8
1 2 3 4 5 6 7 8 9 10
1> beam_lib:chunks("/home/tristan/Devel/rebar/ebin/rebar_prv_version.beam", [compile_info]).
{ok,{rebar_prv_version,
[{compile_info,
[{options,
[{outdir,"ebin"},
debug_info,
{d,namespaced_types},
debug_info,warnings_as_errors,
{i,"include"}]},
{version,"5.0.2"},
Something went wrong with that request. Please try again.