From c4887e202193aa21171288598d9b9ff7f40ed3a0 Mon Sep 17 00:00:00 2001 From: Eric Merritt Date: Fri, 19 Oct 2012 18:22:03 -0500 Subject: [PATCH] enable the rebar semver plugin on erlware_commons Signed-off-by: Jordan Wilberding --- rebar.config | 7 ++++++- src/erlware_commons.app.src | 2 +- src/erlware_commons.app.src.script | 22 ---------------------- 3 files changed, 7 insertions(+), 24 deletions(-) delete mode 100644 src/erlware_commons.app.src.script diff --git a/rebar.config b/rebar.config index cd5d68a..08863d2 100644 --- a/rebar.config +++ b/rebar.config @@ -3,7 +3,9 @@ %% Dependencies ================================================================ {deps, [{neotoma, "", {git, "https://github.com/seancribbs/neotoma.git", {branch, master}}}, - {proper, "", {git, "https://github.com/manopapad/proper.git", {branch, master}}}]}. + {proper, "", {git, "https://github.com/manopapad/proper.git", {branch, master}}}, + {rebar_vsn_plugin, ".*", {git, "https://github.com/erlware/rebar_vsn_plugin.git", + {branch, "master"}}}]}. {erl_first_files, ["ec_dictionary"]}. @@ -18,3 +20,6 @@ {cover_enabled, true}. {cover_print_enabled, true}. + +%% Rebar Plugins ============================================================== +{plugins, [rebar_vsn_plugin]}. diff --git a/src/erlware_commons.app.src b/src/erlware_commons.app.src index 7e6111b..042c56a 100644 --- a/src/erlware_commons.app.src +++ b/src/erlware_commons.app.src @@ -1,7 +1,7 @@ %% -*- mode: Erlang; fill-column: 75; comment-column: 50; -*- {application, erlware_commons, [{description, "Additional standard library for Erlang"}, - {vsn, git}, + {vsn, "semver"}, {modules, []}, {registered, []}, {applications, [kernel, stdlib]}]}. diff --git a/src/erlware_commons.app.src.script b/src/erlware_commons.app.src.script deleted file mode 100644 index 381e7dc..0000000 --- a/src/erlware_commons.app.src.script +++ /dev/null @@ -1,22 +0,0 @@ -%% -*- mode: Erlang; erlang-indent-level: 4; indent-tabs-mode: nil; fill-column: 80 -*- - -[{application, AppName, Details0}] = CONFIG, - -%% Get the tag timestamp and minimal ref from the system. The -%% timestamp is really important from an ordering perspective. -{ok, RawRef} = rebar_utils:sh("git log -n 1 --pretty=format:'%ct.%h\n' .", []), -{ok, RawTag} = rebar_utils:sh("git describe --always --abbrev=0 --tags " - "`git log -n 1 --pretty=format:%h .`", []), - -%% Cleanup the tag and the Ref information. Basically leading 'v's and -%% whitespace needs to go away. -Tag = re:replace(RawTag, "(^v)|\\s", "", [global]), -Ref = re:replace(RawRef, "\\s", "", [global]), - -%% Create the valid [semver](http://semver.org) version from the tag -Vsn = erlang:binary_to_list(erlang:iolist_to_binary([Tag, "+build.", Ref])), - -%% Replace the old version with the new one -Details1 = lists:keyreplace(vsn, 1, Details0, {vsn, Vsn}), - -[{application, AppName, Details1}].