buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toulm...@apache.org
Subject svn commit: r962424 - in /buildr/trunk: CHANGELOG lib/buildr/core/build.rb spec/core/build_spec.rb
Date Fri, 09 Jul 2010 06:10:13 GMT
Author: toulmean
Date: Fri Jul  9 06:10:12 2010
New Revision: 962424

URL: http://svn.apache.org/viewvc?rev=962424&view=rev
Log:
fix for BUILDR-436 release task should only replace '-SNAPSHOT'

Modified:
    buildr/trunk/CHANGELOG
    buildr/trunk/lib/buildr/core/build.rb
    buildr/trunk/spec/core/build_spec.rb

Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=962424&r1=962423&r2=962424&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Fri Jul  9 06:10:12 2010
@@ -5,6 +5,7 @@
 * Fixed: BUILDR-225 ArchiveTask#merge, not according to doc
 * Fixed: BUILDR-256 Automatically installing gems aborts rspec test runner (Rhett Sutphin)
 * Fixed: BUILDR-342 The jruby gem installer invokes the removed Gem.manage_gems function
(Rhett Sutphin)
+* Fixed: BUILDR-436 release task should only replace "-SNAPSHOT" (spec from Jean-Philippe
Caruana)
 * Fixed: BUILDR-464 Improve the versioning of Buildr (Rhett Sutphin)
 * Fixed: BUILDR-466 Rendering issue with IE on the website (Shane Witbeck)
 

Modified: buildr/trunk/lib/buildr/core/build.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/build.rb?rev=962424&r1=962423&r2=962424&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/build.rb (original)
+++ buildr/trunk/lib/buildr/core/build.rb Fri Jul  9 06:10:12 2010
@@ -304,6 +304,8 @@ module Buildr
     end
 
   protected
+  
+    attr_accessor :no_snapshot
 
     # :call-seq:
     #   with_release_candidate_version() { |filename| ... }
@@ -322,7 +324,10 @@ module Buildr
     # for the release buildfile.
     def with_release_candidate_version
       release_candidate_buildfile = Buildr.application.buildfile.to_s + '.next'
-      release_candidate_buildfile_contents = change_version { |version| version[-1] = version[-1].split('-')[0]
}
+    
+      release_candidate_buildfile_contents = change_version { |version| 
+        @no_snapshot = !version[-1].match(/-SNAPSHOT$/) 
+        version[-1] = version[-1].sub(/-SNAPSHOT$/, '') }
       File.open(release_candidate_buildfile, 'w') { |file| file.write release_candidate_buildfile_contents
}
       begin
         yield release_candidate_buildfile
@@ -359,7 +364,11 @@ module Buildr
 
     # Move the version to next and save the updated buildfile
     def update_buildfile
-      buildfile = change_version { |version| version[-1] = sprintf("%0#{version[-1].size}d",
version[-1].to_i + 1) + '-SNAPSHOT' }
+      buildfile = change_version { |version| 
+        unless no_snapshot
+          version[-1] = sprintf("%0#{version[-1].size}d", version[-1].to_i + 1) + '-SNAPSHOT'
+        end
+      }
       File.open(Buildr.application.buildfile.to_s, 'w') { |file| file.write buildfile }
     end
 

Modified: buildr/trunk/spec/core/build_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/core/build_spec.rb?rev=962424&r1=962423&r2=962424&view=diff
==============================================================================
--- buildr/trunk/spec/core/build_spec.rb (original)
+++ buildr/trunk/spec/core/build_spec.rb Fri Jul  9 06:10:12 2010
@@ -408,6 +408,13 @@ describe 'a release process', :shared=>t
       file('buildfile').should contain('VERSION_NUMBER = "1.0.002-SNAPSHOT"')
     end
 
+    it 'should not consider "-rc" as "-SNAPSHOT"' do
+      write 'buildfile', "VERSION_NUMBER = '1.0.0-rc1'"
+      @release.stub!(:tag_release)
+      @release.make
+      file('buildfile').should contain('VERSION_NUMBER = "1.0.0-rc1"')
+    end
+
     it 'should commit the updated buildfile' do
       @release.stub!(:tag_release)
       @release.make



Mime
View raw message