forked from uwiger/edown
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add rebar customization scripts; github URL rewrites
- Loading branch information
Showing
6 changed files
with
196 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
%% -*- erlang -*- | ||
%% | ||
%% This helper script checks if doc is being built, otherwise removes edoc dep. | ||
%% To build docs, call `rebar get-deps doc` | ||
%% Assumes that the rebar config is bound to CONFIG | ||
|
||
[_|Args] = init:get_plain_arguments(). % rebar 'commands' and options | ||
case lists:member("doc", Args) of | ||
false -> | ||
{ok,C1} = file:script(filename:join(filename:dirname(SCRIPT), | ||
"remove_deps.script"), | ||
[{'CONFIG', CONFIG}, {'DEPS', [edown]}]), | ||
C1; | ||
true -> | ||
%% We actually only need to start inets if we have a doc path with http URIS | ||
application:start(crypto), | ||
application:start(public_key), | ||
application:start(ssl), | ||
application:start(inets), | ||
case code:lib_dir(edown) of | ||
{error, bad_name} -> | ||
io:fwrite("cannot find edown~n", []), | ||
D = {edown, ".*", | ||
{git, "git://github.com/esl/edown.git", "HEAD"}}, | ||
Deps = case lists:keyfind(deps, 1, CONFIG) of | ||
false -> [D]; | ||
{_, Ds} -> | ||
case lists:keymember(edown, 1, Ds) of | ||
true -> Ds; | ||
false -> [D|Ds] | ||
end | ||
end, | ||
lists:keystore(deps, 1, CONFIG, {deps, Deps}); | ||
_ -> | ||
io:fwrite("edown in path~n", []), | ||
CONFIG | ||
end | ||
end. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
%% -*- erlang -*- | ||
%% | ||
%% Assumes the following bound variables: | ||
%% CONFIG - a rebar.config options list | ||
%% DEPS :: [atom()] - a list of deps to remove | ||
case lists:keyfind(deps, 1, CONFIG) of | ||
{_, Deps0} -> | ||
Deps1 = lists:filter( | ||
fun(D) when is_atom(D) -> | ||
not lists:member(D, DEPS); | ||
(D) when is_tuple(D) -> | ||
not lists:member(element(1,D), DEPS) | ||
end, Deps0), | ||
lists:keyreplace(deps, 1, CONFIG, {deps, Deps1}); | ||
false -> | ||
CONFIG | ||
end. | ||
|
This file contains 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