Skip to content

Commit

Permalink
Merge branch 'master' of github.com:hansihe/Rustler
Browse files Browse the repository at this point in the history
  • Loading branch information
hansihe committed May 15, 2017
2 parents a745af7 + 198941e commit 0b27e38
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
18 changes: 11 additions & 7 deletions rustler_mix/lib/mix/tasks/compile.rustler.ex
Expand Up @@ -5,16 +5,20 @@ defmodule Mix.Tasks.Compile.Rustler do

def run(_args) do
config = Mix.Project.config()
crates = Keyword.get(config, :rustler_crates) || raise_missing_crates()
case Mix.Project.umbrella?(config) do
true -> nil
false ->
crates = Keyword.get(config, :rustler_crates) || raise_missing_crates()

File.mkdir_p!(priv_dir())
File.mkdir_p!(priv_dir())

Enum.map(crates, &compile_crate/1)
Enum.map(crates, &compile_crate/1)

# Workaround for a mix problem. We should REALLY get this fixed properly.
_ = symlink_or_copy(config,
Path.expand("priv"),
Path.join(Mix.Project.app_path(config), "priv"))
# Workaround for a mix problem. We should REALLY get this fixed properly.
_ = symlink_or_copy(config,
Path.expand("priv"),
Path.join(Mix.Project.app_path(config), "priv"))
end
end


Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Expand Up @@ -43,6 +43,7 @@ mod term;

pub use term::{ NifTerm };
pub use types::{ NifEncoder, NifDecoder };
pub use wrapper::nif_interface::ErlNifTaskFlags;
pub mod resource;

pub mod dynamic;
Expand Down
12 changes: 6 additions & 6 deletions src/wrapper/nif_interface.rs
Expand Up @@ -33,12 +33,12 @@ pub enum NIF_ERROR {

pub type DEF_NIF_FUNC = erlang_nif_sys::ErlNifFunc;
pub type DEF_NIF_ENTRY = erlang_nif_sys::ErlNifEntry;
pub use self::erlang_nif_sys::NIF_MAJOR_VERSION;
pub use self::erlang_nif_sys::NIF_MINOR_VERSION;
pub use self::erlang_nif_sys::ErlNifResourceFlags as NIF_RESOURCE_FLAGS;
pub use ::erlang_nif_sys::NIF_MAJOR_VERSION;
pub use ::erlang_nif_sys::NIF_MINOR_VERSION;
pub use ::erlang_nif_sys::ErlNifResourceFlags as NIF_RESOURCE_FLAGS;

pub use self::erlang_nif_sys::ErlNifBinaryToTerm as NIF_BINARY_TO_TERM_OPTS;
pub use self::erlang_nif_sys::ERL_NIF_BIN2TERM_SAFE;
pub use ::erlang_nif_sys::ErlNifBinaryToTerm as NIF_BINARY_TO_TERM_OPTS;
pub use ::erlang_nif_sys::ERL_NIF_BIN2TERM_SAFE;

#[repr(C)]
pub enum ErlNifTaskFlags {
Expand Down Expand Up @@ -210,7 +210,7 @@ pub unsafe fn enif_keep_resource(obj: NIF_RESOURCE_HANDLE) {
erlang_nif_sys::enif_keep_resource(obj)
}

pub use self::erlang_nif_sys::{
pub use ::erlang_nif_sys::{
ErlNifMapIterator,
ErlNifMapIteratorEntry,
ErlNifPid,
Expand Down

0 comments on commit 0b27e38

Please sign in to comment.