Skip to content
Browse files

App version as default tag

  • Loading branch information...
1 parent 5e17738 commit 40d2876006e74d415a5c79d25fd4dbfecd22548d @gregorej committed Feb 20, 2012
Showing with 11 additions and 10 deletions.
  1. +11 −10 src/rebar_scm_plugin.erl
View
21 src/rebar_scm_plugin.erl
@@ -30,26 +30,27 @@ as_string({Protocol, PathParts}) ->
is_base_dir() ->
rebar_utils:get_cwd() == rebar_config:get_global(base_dir, undefined).
-scm(Config, _AppFile) ->
+scm(Config, AppFile) ->
+ ?DEBUG("scm(~p, ~s)~n", [Config, AppFile]),
case is_base_dir() of
true ->
- Tag = rebar_config:get_global(tag, undefined),
Scm = rebar_config:get_local(Config, scm, undefined),
case Scm of
undefined ->
?ERROR("No SCM information provided in rebar.config file~n", []),
?FAIL;
_ -> ok
end,
- ?DEBUG("Tag = ~p~n", [Tag]),
- case Tag of
+ Tag = case rebar_config:get_global(tag, undefined) of
undefined ->
- ?ERROR("No tag specified", []),
- ?FAIL;
- _ ->
- ?INFO("Tagging with tag ~s~n", [Tag]),
- tag(Scm,Tag)
- end;
+ Vsn = rebar_app_utils:app_vsn(AppFile),
+ ?INFO("No tag specified. Tagging with application version [~s]", [Vsn]),
+ Vsn;
+ Other ->
+ ?INFO("Tagging with tag ~s~n", [Other]),
+ Other
+ end,
+ tag(Scm,Tag);
false ->
?DEBUG("Ignoring dependency ",[])
end,

0 comments on commit 40d2876

Please sign in to comment.
Something went wrong with that request. Please try again.