summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rebar_plugins.erl3
-rw-r--r--src/rebar_prv_clean.erl2
-rw-r--r--src/rebar_utils.erl6
-rw-r--r--test/rebar_compile_SUITE.erl38
4 files changed, 42 insertions, 7 deletions
diff --git a/src/rebar_plugins.erl b/src/rebar_plugins.erl
index 3e855de..bda3fb7 100644
--- a/src/rebar_plugins.erl
+++ b/src/rebar_plugins.erl
@@ -94,7 +94,8 @@ build_plugin(AppInfo, Apps, State) ->
Providers = rebar_state:providers(State),
Providers1 = rebar_state:providers(rebar_app_info:state(AppInfo)),
S = rebar_state:all_deps(rebar_app_info:state_or_new(State, AppInfo), Apps),
- rebar_prv_compile:compile(S, Providers++Providers1, AppInfo).
+ S1 = rebar_state:set(S, deps_dir, ?DEFAULT_PLUGINS_DIR),
+ rebar_prv_compile:compile(S1, Providers++Providers1, AppInfo).
plugin_providers({Plugin, _, _, _}) when is_atom(Plugin) ->
validate_plugin(Plugin);
diff --git a/src/rebar_prv_clean.erl b/src/rebar_prv_clean.erl
index e3cb84e..f10d12b 100644
--- a/src/rebar_prv_clean.erl
+++ b/src/rebar_prv_clean.erl
@@ -39,7 +39,7 @@ do(State) ->
case All of
true ->
DepsDir = rebar_dir:deps_dir(State),
- DepApps = rebar_app_discover:find_apps([DepsDir], all);
+ DepApps = rebar_app_discover:find_apps([filename:join(DepsDir, "*")], all);
false ->
DepApps = []
end,
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index c729b58..7ae3d9c 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -757,12 +757,12 @@ set_httpc_options(Scheme, Proxy) ->
escape_chars(Str) when is_atom(Str) ->
escape_chars(atom_to_list(Str));
escape_chars(Str) ->
- re:replace(Str, "([ ()?`!$])", "\\\\&", [global, {return, list}]).
+ re:replace(Str, "([ ()?`!$&;])", "\\\\&", [global, {return, list}]).
%% "escape inside these"
escape_double_quotes(Str) ->
- re:replace(Str, "([\"\\\\`!$*])", "\\\\&", [global, {return, list}]).
+ re:replace(Str, "([\"\\\\`!$&*;])", "\\\\&", [global, {return, list}]).
%% "escape inside these" but allow *
escape_double_quotes_weak(Str) ->
- re:replace(Str, "([\"\\\\`!$])", "\\\\&", [global, {return, list}]).
+ re:replace(Str, "([\"\\\\`!$&;])", "\\\\&", [global, {return, list}]).
diff --git a/test/rebar_compile_SUITE.erl b/test/rebar_compile_SUITE.erl
index 6884a22..0aaa899 100644
--- a/test/rebar_compile_SUITE.erl
+++ b/test/rebar_compile_SUITE.erl
@@ -22,7 +22,8 @@
parse_transform_test/1,
erl_first_files_test/1,
mib_test/1,
- only_default_transitive_deps/1]).
+ only_default_transitive_deps/1,
+ clean_all/1]).
-include_lib("common_test/include/ct.hrl").
-include_lib("eunit/include/eunit.hrl").
@@ -50,7 +51,8 @@ all() ->
recompile_when_opts_change, dont_recompile_when_opts_dont_change,
dont_recompile_yrl_or_xrl, delete_beam_if_source_deleted,
deps_in_path, checkout_priority, highest_version_of_pkg_dep,
- parse_transform_test, erl_first_files_test, mib_test, only_default_transitive_deps].
+ parse_transform_test, erl_first_files_test, mib_test, only_default_transitive_deps,
+ clean_all].
build_basic_app(Config) ->
AppDir = ?config(apps, Config),
@@ -556,3 +558,35 @@ only_default_transitive_deps(Config) ->
Config, RConf, ["as", "test", "compile"],
{ok, [{app, Name}, {dep, "a", <<"1.0.0">>}, {dep_not_exist, PkgName}]}
).
+
+clean_all(Config) ->
+ AppDir = ?config(apps, Config),
+
+ Name = rebar_test_utils:create_random_name("app1_"),
+ Vsn = rebar_test_utils:create_random_vsn(),
+ rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]),
+
+ DepName = rebar_test_utils:create_random_name("dep1_"),
+ PkgName = rebar_test_utils:create_random_name("pkg1_"),
+ mock_git_resource:mock([]),
+ mock_pkg_resource:mock([
+ {pkgdeps, [{{iolist_to_binary(PkgName), iolist_to_binary(Vsn)}, []}]}
+ ]),
+
+ RConfFile = rebar_test_utils:create_config(AppDir, [{deps, [
+ {list_to_atom(DepName), {git, "http://site.com/user/"++DepName++".git", {tag, Vsn}}},
+ {list_to_atom(PkgName), Vsn}
+ ]}]),
+ {ok, RConf} = file:consult(RConfFile),
+
+ %% Build things
+ rebar_test_utils:run_and_check(
+ Config, RConf, ["compile"],
+ {ok, [{app, Name}, {app, DepName}, {app, PkgName}]}
+ ),
+
+ %% Clean all
+ rebar_test_utils:run_and_check(
+ Config, RConf, ["clean", "--all"],
+ {ok, [{app, Name, invalid}, {app, DepName, invalid}, {app, PkgName, invalid}]}
+ ).