summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2014-10-19 08:33:36 -0500
committerTristan Sloughter <t@crashfast.com>2014-10-19 08:33:36 -0500
commit7de514e000d289664bed124c78edbbad785f8856 (patch)
tree464f080c2c2b0c87c5465f0f8c26cec82d0972c4 /src
parent7c2d506cb5cc99948c3d1c9b618ffd936082a931 (diff)
fix find and includefile paths for yrl/xrl files
Diffstat (limited to 'src')
-rw-r--r--src/rebar_erlc_compiler.erl13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index d1eac8c..33983e4 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -96,17 +96,17 @@ compile(Config, Dir) ->
rebar_base_compiler:run(Config,
check_files(rebar_state:get(
Config, xrl_first_files, [])),
- "src", ".xrl", "src", ".erl",
+ filename:join(Dir, "src"), ".xrl", filename:join(Dir, "src"), ".erl",
fun compile_xrl/3),
rebar_base_compiler:run(Config,
check_files(rebar_state:get(
Config, yrl_first_files, [])),
- "src", ".yrl", "src", ".erl",
+ filename:join(Dir, "src"), ".yrl", filename:join(Dir, "src"), ".erl",
fun compile_yrl/3),
rebar_base_compiler:run(Config,
check_files(rebar_state:get(
Config, mib_first_files, [])),
- "mibs", ".mib", "priv/mibs", ".bin",
+ filename:join(Dir, "mibs"), ".mib", filename:join([Dir, "priv", "mibs"]), ".bin",
fun compile_mib/3),
doterl_compile(Config, Dir).
@@ -634,16 +634,19 @@ compile_yrl(Source, Target, Config) ->
-spec compile_xrl_yrl(rebar_state:t(), file:filename(),
file:filename(), list(), module()) -> 'ok'.
compile_xrl_yrl(Config, Source, Target, Opts, Mod) ->
+ Dir = rebar_state:dir(Config),
+ Opts1 = [{includefile, filename:join(Dir, I)} || {includefile, I} <- Opts,
+ filename:pathtype(I) =:= relative],
case needs_compile(Source, Target, []) of
true ->
- case Mod:file(Source, Opts ++ [{return, true}]) of
+ case Mod:file(Source, Opts1 ++ [{return, true}]) of
{ok, _} ->
ok;
{ok, _Mod, Ws} ->
rebar_base_compiler:ok_tuple(Config, Source, Ws);
{error, Es, Ws} ->
rebar_base_compiler:error_tuple(Config, Source,
- Es, Ws, Opts)
+ Es, Ws, Opts1)
end;
false ->
skipped