mirror of
https://github.com/correl/rebar.git
synced 2024-11-30 19:19:54 +00:00
0b833391ed
Introduce a new 'raw' option for dependency specs in rebar.config file. For example: {deps, {dependency_name, "1.0.*", {git, "<...>", {branch, "master"}}, [raw] } ]}. When this option is specified, rebar does not require the dependency to have a standard Erlang/OTP layout which assumes presence of either "src/dependency_name.app.src" or "ebin/dependency_name.app" files. 'raw' dependencies can still contain 'rebar.config' and even can have the proper OTP directory layout, but they won't be compiled. Only a subset of rebar commands will be executed on the 'raw' subdirectories: get-deps, update-deps, check-deps, list-deps and delete-deps.
39 lines
1.3 KiB
Erlang
39 lines
1.3 KiB
Erlang
-module(t_custom_config_rt).
|
|
|
|
-compile(export_all).
|
|
|
|
-include_lib("eunit/include/eunit.hrl").
|
|
|
|
files() ->
|
|
[{copy, "../../rebar", "rebar"},
|
|
{copy, "custom.config", "custom.config"},
|
|
{create, "ebin/custom_config.app", app(custom_config, [custom_config])}].
|
|
|
|
run(Dir) ->
|
|
retest_log:log(debug, "Running in Dir: ~s~n", [Dir]),
|
|
Ref = retest:sh("./rebar -C custom.config check-deps -vvv",
|
|
[{async, true}]),
|
|
{ok, Captured} =
|
|
retest:sh_expect(Ref,
|
|
"DEBUG: Consult config file .*/custom.config.*",
|
|
[{capture, all, list}]),
|
|
{ok, Missing} =
|
|
retest:sh_expect(Ref,
|
|
"DEBUG: Missing deps : \\[\\{dep,bad_name,"
|
|
"boo,\"\\.\",undefined,false\\}\\]",
|
|
[{capture, all, list}]),
|
|
retest_log:log(debug, "[CAPTURED]: ~s~n", [Captured]),
|
|
retest_log:log(debug, "[Missing]: ~s~n", [Missing]),
|
|
ok.
|
|
|
|
%%
|
|
%% Generate the contents of a simple .app file
|
|
%%
|
|
app(Name, Modules) ->
|
|
App = {application, Name,
|
|
[{description, atom_to_list(Name)},
|
|
{vsn, "1"},
|
|
{modules, Modules},
|
|
{registered, []},
|
|
{applications, [kernel, stdlib]}]},
|
|
io_lib:format("~p.\n", [App]).
|