Repository: buildr Updated Branches: refs/heads/master ea050f958 -> af8e6f03e
In the 'buildr/git_auto_version' addon strip out any versions that start with a 'v' character as most projects on git repositories prefix version tags with a "v" to avoid collisions with any branchs named after the version which are typically without the "v" character. Project: http://git-wip-us.apache.org/repos/asf/buildr/repo Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/af8e6f03 Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/af8e6f03 Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/af8e6f03 Branch: refs/heads/master Commit: af8e6f03e1a2e73e5208af3c7b2d2c944ebc26f5 Parents: ea050f9 Author: Peter Donald <[email protected]> Authored: Thu Feb 23 15:58:03 2017 +1100 Committer: Peter Donald <[email protected]> Committed: Thu Feb 23 15:58:03 2017 +1100 ---------------------------------------------------------------------- CHANGELOG | 3 +++ addon/buildr/git_auto_version.rb | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/buildr/blob/af8e6f03/CHANGELOG ---------------------------------------------------------------------- diff --git a/CHANGELOG b/CHANGELOG index f2e6017..2c42478 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,7 @@ 1.5.1 (Pending) +* Change: In the 'buildr/git_auto_version' addon strip out any versions that start with a 'v' character as + most projects on git repositories prefix version tags with a "v" to avoid collisions with any branchs + named after the version which are typically without the "v" character. * Fixed: GWT Addon: The GWT project publishes invalid jars that can not be included on source path when the javadoc tool is executing. Work around this issue in GWT by removing them from the documentation class path. http://git-wip-us.apache.org/repos/asf/buildr/blob/af8e6f03/addon/buildr/git_auto_version.rb ---------------------------------------------------------------------- diff --git a/addon/buildr/git_auto_version.rb b/addon/buildr/git_auto_version.rb index 6ffe32d..a412189 100644 --- a/addon/buildr/git_auto_version.rb +++ b/addon/buildr/git_auto_version.rb @@ -22,7 +22,9 @@ module Buildr unless project.version version_suffix = ENV['BUILD_NUMBER'] ? "-#{ENV['BUILD_NUMBER']}" : '' version_prefix = ENV['VERSION_PREFIX'] ? "#{ENV['VERSION_PREFIX']}-" : '' - project.version = version_prefix + `git describe --tags --always`.strip + version_suffix + git_version = `git describe --tags --always`.strip + git_version = git_version.gsub(/^v([0-9])/, '\1') + project.version = version_prefix + git_version + version_suffix end end end
