You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by to...@apache.org on 2010/07/16 09:19:49 UTC
svn commit: r964700 - in /buildr/trunk: lib/buildr/core/build.rb
spec/core/build_spec.rb
Author: toulmean
Date: Fri Jul 16 07:19:49 2010
New Revision: 964700
URL: http://svn.apache.org/viewvc?rev=964700&view=rev
Log:
better fix for BUILDR-436
Modified:
buildr/trunk/lib/buildr/core/build.rb
buildr/trunk/spec/core/build_spec.rb
Modified: buildr/trunk/lib/buildr/core/build.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/build.rb?rev=964700&r1=964699&r2=964700&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/build.rb (original)
+++ buildr/trunk/lib/buildr/core/build.rb Fri Jul 16 07:19:49 2010
@@ -278,7 +278,7 @@ module Buildr
ruby *args
end
tag_release resolve_tag
- update_version_to_next
+ update_version_to_next if @this_version != @new_version
end
# :call-seq:
@@ -346,12 +346,12 @@ module Buildr
# This method yields to the block with the current (this) version number as an array and expects
# the block to update it.
def change_version
- this_version = extract_version
- new_version = this_version.split('.')
+ @this_version = extract_version
+ new_version = @this_version.split('.')
yield(new_version)
- new_version = new_version.join('.')
+ @new_version = new_version.join('.')
buildfile = File.read(Buildr.application.buildfile.to_s)
- buildfile.gsub(THIS_VERSION_PATTERN) { |ver| ver.sub(/(["']).*\1/, %Q{"#{new_version}"}) }
+ buildfile.gsub(THIS_VERSION_PATTERN) { |ver| ver.sub(/(["']).*\1/, %Q{"#{@new_version}"}) }
end
# Return the name of the tag to tag the release with.
Modified: buildr/trunk/spec/core/build_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/core/build_spec.rb?rev=964700&r1=964699&r2=964700&view=diff
==============================================================================
--- buildr/trunk/spec/core/build_spec.rb (original)
+++ buildr/trunk/spec/core/build_spec.rb Fri Jul 16 07:19:49 2010
@@ -407,6 +407,12 @@ describe 'a release process', :shared=>t
@release.make
file('buildfile').should contain('VERSION_NUMBER = "1.0.002-SNAPSHOT"')
end
+
+ it 'should commit the updated buildfile' do
+ @release.stub!(:tag_release)
+ @release.make
+ file('buildfile').should contain('VERSION_NUMBER = "1.0.1-SNAPSHOT"')
+ end
it 'should not consider "-rc" as "-SNAPSHOT"' do
write 'buildfile', "VERSION_NUMBER = '1.0.0-rc1'"
@@ -414,11 +420,12 @@ describe 'a release process', :shared=>t
@release.make
file('buildfile').should contain('VERSION_NUMBER = "1.0.0-rc1"')
end
-
- it 'should commit the updated buildfile' do
+
+ it 'should only commit the updated buildfile if the version changed' do
+ write 'buildfile', "VERSION_NUMBER = '1.0.0-rc1'"
+ @release.should_not_receive(:update_version_to_next)
@release.stub!(:tag_release)
@release.make
- file('buildfile').should contain('VERSION_NUMBER = "1.0.1-SNAPSHOT"')
end
end