mirror of
https://github.com/correl/rebar.git
synced 2024-11-23 19:19:54 +00:00
Merge pull request #445 from norton/norton-erlc-order
rebar doesn't respect the order of erl_first_files given in the rebar.conf file
This commit is contained in:
commit
c051530b3c
5 changed files with 26 additions and 10 deletions
|
@ -31,7 +31,8 @@
|
||||||
-include_lib("eunit/include/eunit.hrl").
|
-include_lib("eunit/include/eunit.hrl").
|
||||||
|
|
||||||
-define(MODULES,
|
-define(MODULES,
|
||||||
[first_xrl,
|
[after_first_erl,
|
||||||
|
first_xrl,
|
||||||
first_yrl,
|
first_yrl,
|
||||||
first_erl,
|
first_erl,
|
||||||
foo,
|
foo,
|
||||||
|
@ -42,7 +43,8 @@
|
||||||
'SIMPLE-ASN']).
|
'SIMPLE-ASN']).
|
||||||
|
|
||||||
-define(BEAM_FILES,
|
-define(BEAM_FILES,
|
||||||
["first_xrl.beam",
|
["after_first_erl.beam",
|
||||||
|
"first_xrl.beam",
|
||||||
"first_yrl.beam",
|
"first_yrl.beam",
|
||||||
"first_erl.beam",
|
"first_erl.beam",
|
||||||
"foo.beam",
|
"foo.beam",
|
||||||
|
|
11
inttest/erlc/extra-src/after_first_erl.erl
Normal file
11
inttest/erlc/extra-src/after_first_erl.erl
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
|
||||||
|
%% ex: ts=4 sw=4 ft=erlang et
|
||||||
|
-module(after_first_erl).
|
||||||
|
-compile({parse_transform, first_erl}).
|
||||||
|
|
||||||
|
-include_lib("eunit/include/eunit.hrl").
|
||||||
|
|
||||||
|
-export([test/0]).
|
||||||
|
|
||||||
|
test() ->
|
||||||
|
?debugHere.
|
|
@ -1,13 +1,13 @@
|
||||||
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
|
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
|
||||||
%% ex: ts=4 sw=4 ft=erlang et
|
%% ex: ts=4 sw=4 ft=erlang et
|
||||||
{erl_first_files,
|
{erl_first_files,
|
||||||
["src/first_xrl.erl", "src/first_yrl.erl", "src/first_erl.erl"]}.
|
["src/first_xrl.erl", "src/first_yrl.erl", "src/first_erl.erl", "extra-src/after_first_erl.erl"]}.
|
||||||
|
|
||||||
{deps, [foobar]}.
|
{deps, [foobar]}.
|
||||||
|
|
||||||
{erl_opts,
|
{erl_opts,
|
||||||
[
|
[
|
||||||
{i, "extra-include"},
|
{i, "extra-include"},
|
||||||
{src_dirs, ["src", "extra-src"]},
|
{src_dirs, ["extra-src", "src"]},
|
||||||
{platform_define, "R13|R14", 'NO_CALLBACK_ATTRIBUTE'}
|
{platform_define, "R13|R14", 'NO_CALLBACK_ATTRIBUTE'}
|
||||||
]}.
|
]}.
|
||||||
|
|
|
@ -4,7 +4,10 @@
|
||||||
|
|
||||||
-include_lib("eunit/include/eunit.hrl").
|
-include_lib("eunit/include/eunit.hrl").
|
||||||
|
|
||||||
-export([test/0]).
|
-export([test/0, parse_transform/2]).
|
||||||
|
|
||||||
test() ->
|
test() ->
|
||||||
?debugHere.
|
?debugHere.
|
||||||
|
|
||||||
|
parse_transform(Forms, _Options) ->
|
||||||
|
Forms.
|
||||||
|
|
|
@ -303,11 +303,11 @@ doterl_compile(Config, OutDir, MoreSources, ErlOpts) ->
|
||||||
%% (rebar_config:get_local instead of rebar_config:get_list), consider
|
%% (rebar_config:get_local instead of rebar_config:get_list), consider
|
||||||
%% logging a warning message for any file listed in erl_first_files which
|
%% logging a warning message for any file listed in erl_first_files which
|
||||||
%% wasn't found via gather_src.
|
%% wasn't found via gather_src.
|
||||||
{ErlFirstFiles, RestErls} =
|
RestErls = [File || File <- AllErlFiles,
|
||||||
lists:partition(
|
not lists:member(File, ErlFirstFilesConf)],
|
||||||
fun(Source) ->
|
%% NOTE: order of files in ErlFirstFiles is important!
|
||||||
lists:member(Source, ErlFirstFilesConf)
|
ErlFirstFiles = [File || File <- ErlFirstFilesConf,
|
||||||
end, AllErlFiles),
|
lists:member(File, AllErlFiles)],
|
||||||
%% Make sure that ebin/ exists and is on the path
|
%% Make sure that ebin/ exists and is on the path
|
||||||
ok = filelib:ensure_dir(filename:join("ebin", "dummy.beam")),
|
ok = filelib:ensure_dir(filename:join("ebin", "dummy.beam")),
|
||||||
CurrPath = code:get_path(),
|
CurrPath = code:get_path(),
|
||||||
|
|
Loading…
Reference in a new issue