diff options
Diffstat (limited to 'tasks/release.rb')
-rw-r--r-- | tasks/release.rb | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/tasks/release.rb b/tasks/release.rb index 650b381e0f..729e0761ad 100644 --- a/tasks/release.rb +++ b/tasks/release.rb @@ -1,4 +1,4 @@ -FRAMEWORKS = %w( activesupport activemodel activerecord actionpack actionmailer railties ) +FRAMEWORKS = %w( activesupport activemodel activerecord actionview actionpack actionmailer railties activejob ) root = File.expand_path('../../', __FILE__) version = File.read("#{root}/RAILS_VERSION").strip @@ -15,10 +15,14 @@ directory "pkg" rm_f gem end - task :update_version_rb do + task :update_versions do glob = root.dup - glob << "/#{framework}/lib/*" unless framework == "rails" - glob << "/version.rb" + if framework == "rails" + glob << "/version.rb" + else + glob << "/#{framework}/lib/*" + glob << "/gem_version.rb" + end file = Dir[glob].first ruby = File.read(file) @@ -26,22 +30,22 @@ directory "pkg" major, minor, tiny, pre = version.split('.') pre = pre ? pre.inspect : "nil" - ruby.gsub!(/^(\s*)MAJOR = .*?$/, "\\1MAJOR = #{major}") + ruby.gsub!(/^(\s*)MAJOR(\s*)= .*?$/, "\\1MAJOR = #{major}") raise "Could not insert MAJOR in #{file}" unless $1 - ruby.gsub!(/^(\s*)MINOR = .*?$/, "\\1MINOR = #{minor}") + ruby.gsub!(/^(\s*)MINOR(\s*)= .*?$/, "\\1MINOR = #{minor}") raise "Could not insert MINOR in #{file}" unless $1 - ruby.gsub!(/^(\s*)TINY = .*?$/, "\\1TINY = #{tiny}") + ruby.gsub!(/^(\s*)TINY(\s*)= .*?$/, "\\1TINY = #{tiny}") raise "Could not insert TINY in #{file}" unless $1 - ruby.gsub!(/^(\s*)PRE = .*?$/, "\\1PRE = #{pre}") + ruby.gsub!(/^(\s*)PRE(\s*)= .*?$/, "\\1PRE = #{pre}") raise "Could not insert PRE in #{file}" unless $1 File.open(file, 'w') { |f| f.write ruby } end - task gem => %w(update_version_rb pkg) do + task gem => %w(update_versions pkg) do cmd = "" cmd << "cd #{framework} && " unless framework == "rails" cmd << "gem build #{gemspec} && mv #{framework}-#{version}.gem #{root}/pkg/" @@ -63,7 +67,7 @@ end namespace :changelog do task :release_date do - FRAMEWORKS.each do |fw| + (FRAMEWORKS + ['guides']).each do |fw| require 'date' replace = '\1(' + Date.today.strftime('%B %d, %Y') + ')' fname = File.join fw, 'CHANGELOG.md' @@ -74,7 +78,7 @@ namespace :changelog do end task :release_summary do - FRAMEWORKS.each do |fw| + (FRAMEWORKS + ['guides']).each do |fw| puts "## #{fw}" fname = File.join fw, 'CHANGELOG.md' contents = File.readlines fname @@ -88,16 +92,17 @@ namespace :changelog do end namespace :all do - task :build => FRAMEWORKS.map { |f| "#{f}:build" } + ['rails:build'] - task :install => FRAMEWORKS.map { |f| "#{f}:install" } + ['rails:install'] - task :push => FRAMEWORKS.map { |f| "#{f}:push" } + ['rails:push'] + task :build => FRAMEWORKS.map { |f| "#{f}:build" } + ['rails:build'] + task :update_versions => FRAMEWORKS.map { |f| "#{f}:update_versions" } + ['rails:update_versions'] + task :install => FRAMEWORKS.map { |f| "#{f}:install" } + ['rails:install'] + task :push => FRAMEWORKS.map { |f| "#{f}:push" } + ['rails:push'] task :ensure_clean_state do unless `git status -s | grep -v RAILS_VERSION`.strip.empty? abort "[ABORTING] `git status` reports a dirty tree. Make sure all changes are committed" end - unless ENV['SKIP_TAG'] || `git tag | grep #{tag}`.strip.empty? + unless ENV['SKIP_TAG'] || `git tag | grep '^#{tag}$'`.strip.empty? abort "[ABORTING] `git tag` shows that #{tag} already exists. Has this version already\n"\ " been released? Git tagging can be skipped by setting SKIP_TAG=1" end @@ -115,7 +120,7 @@ namespace :all do end task :tag do - sh "git tag #{tag}" + sh "git tag -m '#{tag} release' #{tag}" sh "git push --tags" end |