Merge pull request #172 from tuncer/dep-examples

Add missing dep examples and fix existing ones
This commit is contained in:
Jared Morrow 2013-12-03 13:04:16 -08:00
commit cedb889137
2 changed files with 40 additions and 17 deletions

View file

@ -152,11 +152,17 @@
%% name as an atom, eg. mochiweb, a name and a version (from the .app file), or %% name as an atom, eg. mochiweb, a name and a version (from the .app file), or
%% an application name, a version and the SCM details on how to fetch it (SCM %% an application name, a version and the SCM details on how to fetch it (SCM
%% type, location and revision). %% type, location and revision).
%% Rebar currently supports git, hg, bzr, svn, and rsync. %% Rebar currently supports git, hg, bzr, svn, rsync, and fossil.
{deps, [application_name, {deps, [app_name,
{application_name, "1.0.*"}, {rebar, "1.0.*"},
{application_name, "1.0.*", {rebar, ".*",
{git, "git://github.com/rebar/rebar.git"}},
{rebar, ".*",
{git, "git://github.com/rebar/rebar.git", "Rev"}},
{rebar, "1.0.*",
{git, "git://github.com/rebar/rebar.git", {branch, "master"}}}, {git, "git://github.com/rebar/rebar.git", {branch, "master"}}},
{rebar, "1.0.0",
{git, "git://github.com/rebar/rebar.git", {tag, "1.0.0"}}},
%% Dependencies can be marked as 'raw'. Rebar does not require %% Dependencies can be marked as 'raw'. Rebar does not require
%% such dependencies to have a standard Erlang/OTP layout %% such dependencies to have a standard Erlang/OTP layout
%% which assumes the presence of either %% which assumes the presence of either
@ -170,9 +176,16 @@
%% Only a subset of rebar commands will be executed on the %% Only a subset of rebar commands will be executed on the
%% 'raw' subdirectories: get-deps, update-deps, check-deps, %% 'raw' subdirectories: get-deps, update-deps, check-deps,
%% list-deps and delete-deps. %% list-deps and delete-deps.
{application_name, "", {rebar, "",
{git, "git://github.com/rebar/rebar.git", {branch, "master"}}, {git, "git://github.com/rebar/rebar.git", {branch, "master"}},
[raw]}]}. [raw]},
{app_name, ".*", {hg, "https://www.example.org/url"}},
{app_name, ".*", {rsync, "Url"}},
{app_name, ".*", {svn, "https://www.example.org/url"}},
{app_name, ".*", {svn, "svn://svn.example.org/url"}},
{app_name, ".*", {bzr, "https://www.example.org/url", "Rev"}},
{app_name, ".*", {fossil, "https://www.example.org/url"}},
{app_name, ".*", {fossil, "https://www.example.org/url", "Vsn"}}]}.
%% == Subdirectories == %% == Subdirectories ==

View file

@ -257,13 +257,27 @@ info_help(Description) ->
[ [
Description, Description,
{deps_dir, "deps"}, {deps_dir, "deps"},
{deps, [application_name, {deps,
{application_name, "1.0.*"}, [app_name,
{application_name, "1.0.*", {rebar, "1.0.*"},
{git, "git://github.com/rebar/rebar.git", {branch, "master"}}}, {rebar, ".*",
{application_name, "", {git, "git://github.com/rebar/rebar.git"}},
{git, "git://github.com/rebar/rebar.git", {branch, "master"}}, {rebar, ".*",
[raw]}]} {git, "git://github.com/rebar/rebar.git", "Rev"}},
{rebar, "1.0.*",
{git, "git://github.com/rebar/rebar.git", {branch, "master"}}},
{rebar, "1.0.0",
{git, "git://github.com/rebar/rebar.git", {tag, "1.0.0"}}},
{rebar, "",
{git, "git://github.com/rebar/rebar.git", {branch, "master"}},
[raw]},
{app_name, ".*", {hg, "https://www.example.org/url"}},
{app_name, ".*", {rsync, "Url"}},
{app_name, ".*", {svn, "https://www.example.org/url"}},
{app_name, ".*", {svn, "svn://svn.example.org/url"}},
{app_name, ".*", {bzr, "https://www.example.org/url", "Rev"}},
{app_name, ".*", {fossil, "https://www.example.org/url"}},
{app_name, ".*", {fossil, "https://www.example.org/url", "Vsn"}}]}
]). ]).
%% Added because of trans deps, %% Added because of trans deps,
@ -532,8 +546,6 @@ download_source(AppDir, {rsync, Url}) ->
rebar_utils:sh(?FMT("rsync -az --delete ~s/ ~s", [Url, AppDir]), []); rebar_utils:sh(?FMT("rsync -az --delete ~s/ ~s", [Url, AppDir]), []);
download_source(AppDir, {fossil, Url}) -> download_source(AppDir, {fossil, Url}) ->
download_source(AppDir, {fossil, Url, ""}); download_source(AppDir, {fossil, Url, ""});
download_source(AppDir, {fossil, Url, latest}) ->
download_source(AppDir, {fossil, Url, ""});
download_source(AppDir, {fossil, Url, Version}) -> download_source(AppDir, {fossil, Url, Version}) ->
Repository = filename:join(AppDir, filename:basename(AppDir) ++ ".fossil"), Repository = filename:join(AppDir, filename:basename(AppDir) ++ ".fossil"),
ok = filelib:ensure_dir(Repository), ok = filelib:ensure_dir(Repository),
@ -589,8 +601,6 @@ update_source1(AppDir, {rsync, Url}) ->
rebar_utils:sh(?FMT("rsync -az --delete ~s/ ~s",[Url,AppDir]),[]); rebar_utils:sh(?FMT("rsync -az --delete ~s/ ~s",[Url,AppDir]),[]);
update_source1(AppDir, {fossil, Url}) -> update_source1(AppDir, {fossil, Url}) ->
update_source1(AppDir, {fossil, Url, ""}); update_source1(AppDir, {fossil, Url, ""});
update_source1(AppDir, {fossil, Url, latest}) ->
update_source1(AppDir, {fossil, Url, ""});
update_source1(AppDir, {fossil, _Url, Version}) -> update_source1(AppDir, {fossil, _Url, Version}) ->
ok = file:set_cwd(AppDir), ok = file:set_cwd(AppDir),
rebar_utils:sh("fossil pull", [{cd, AppDir}]), rebar_utils:sh("fossil pull", [{cd, AppDir}]),