Created
June 26, 2012 17:33
-
-
Save legoscia/2997291 to your computer and use it in GitHub Desktop.
Use per-user (as opposed to per-project) rebar plugins in ~/.rebar/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% -*- erlang -*- | |
%% As an example, let's make the dialyzer plugin available regardless of | |
%% whether the project in question uses it: | |
{plugins, [rebar_dialyzer_plugin]}. | |
%% config.script uses this new variable to find it: | |
{plugin_home, ["/Users/magnus/.rebar"]}. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% -*- erlang -*- | |
%% | |
%% For any plugin in the plugins directive in ~/.rebar/config that is | |
%% not already in the code path, add ~/.rebar/PLUGIN/ebin to the code | |
%% path and assert that we can find it. | |
PluginHome = proplists:get_value(plugin_home, CONFIG), | |
Plugins = proplists:get_value(plugins, CONFIG, []), | |
lists:foreach( | |
fun(Plugin) -> | |
code:which(Plugin) =:= non_existing andalso | |
code:add_path(filename:join([PluginHome, atom_to_list(Plugin), "ebin"])) andalso | |
(is_list(code:which(Plugin)) orelse error({plugin_not_found, Plugin})) | |
end, Plugins), | |
CONFIG. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment