2011-12-30 04:04:39 +01:00
|
|
|
require 'rake'
|
2011-12-30 04:52:00 +01:00
|
|
|
|
2013-12-28 01:26:31 +01:00
|
|
|
require File.expand_path('../middleman-core/lib/middleman-core/version.rb', __FILE__)
|
2011-12-30 04:04:39 +01:00
|
|
|
|
2011-12-30 00:09:51 +01:00
|
|
|
ROOT = File.expand_path(File.dirname(__FILE__))
|
2016-01-14 20:21:42 +01:00
|
|
|
GEM_NAME = 'middleman'.freeze
|
2009-10-23 02:25:15 +02:00
|
|
|
|
2014-05-27 03:44:11 +02:00
|
|
|
middleman_gems = %w(middleman-core middleman-cli middleman)
|
2011-12-30 04:52:00 +01:00
|
|
|
GEM_PATHS = middleman_gems.freeze
|
|
|
|
|
|
|
|
def sh_rake(command)
|
2014-04-29 19:50:21 +02:00
|
|
|
sh "#{Gem.ruby} -S rake #{command}", verbose: true
|
2011-12-30 04:52:00 +01:00
|
|
|
end
|
|
|
|
|
2013-12-28 01:26:31 +01:00
|
|
|
desc 'Displays the current version'
|
2011-12-30 04:52:00 +01:00
|
|
|
task :version do
|
2014-04-29 01:02:18 +02:00
|
|
|
puts "Current version: #{Middleman::VERSION}"
|
2011-12-30 04:52:00 +01:00
|
|
|
end
|
|
|
|
|
2013-12-28 01:26:31 +01:00
|
|
|
desc 'Pushes repository to GitHub'
|
2011-12-30 04:52:00 +01:00
|
|
|
task :push do
|
2014-04-29 01:02:18 +02:00
|
|
|
puts 'Pushing to github...'
|
2011-12-30 04:52:00 +01:00
|
|
|
sh "git tag v#{Middleman::VERSION}"
|
2015-02-13 23:42:17 +01:00
|
|
|
sh 'git push'
|
2011-12-30 04:52:00 +01:00
|
|
|
sh "git push origin v#{Middleman::VERSION}"
|
|
|
|
end
|
|
|
|
|
2013-12-28 01:26:31 +01:00
|
|
|
desc 'Release all middleman gems'
|
2014-04-29 19:50:21 +02:00
|
|
|
task publish: :push do
|
2014-04-29 01:02:18 +02:00
|
|
|
puts 'Pushing to rubygems...'
|
2011-12-30 04:52:00 +01:00
|
|
|
GEM_PATHS.each do |dir|
|
2013-12-28 01:26:31 +01:00
|
|
|
Dir.chdir(dir) { sh_rake('release') }
|
2011-12-30 04:52:00 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-12-28 01:26:31 +01:00
|
|
|
desc 'Generate documentation for all middleman gems'
|
2012-05-02 20:13:06 +02:00
|
|
|
task :doc do
|
|
|
|
GEM_PATHS.each do |g|
|
2016-01-14 20:21:42 +01:00
|
|
|
Dir.chdir(File.join(ROOT, g).to_s) { sh "#{Gem.ruby} -S rake yard" }
|
2012-05-02 20:13:06 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-12-28 01:26:31 +01:00
|
|
|
desc 'Run tests for all middleman gems'
|
2011-12-30 00:09:51 +01:00
|
|
|
task :test do
|
2014-09-09 09:14:45 +02:00
|
|
|
Rake::Task['rubocop'].invoke
|
|
|
|
|
2011-12-30 04:52:00 +01:00
|
|
|
GEM_PATHS.each do |g|
|
2016-01-14 20:21:42 +01:00
|
|
|
Dir.chdir(File.join(ROOT, g).to_s) { sh "#{Gem.ruby} -S rake test" }
|
2011-12-30 00:09:51 +01:00
|
|
|
end
|
2011-12-30 04:04:39 +01:00
|
|
|
end
|
|
|
|
|
2013-12-28 01:26:31 +01:00
|
|
|
desc 'Run specs for all middleman gems'
|
2013-02-10 00:45:45 +01:00
|
|
|
task :spec do
|
|
|
|
GEM_PATHS.each do |g|
|
2016-01-14 20:21:42 +01:00
|
|
|
Dir.chdir(File.join(ROOT, g).to_s) { sh "#{Gem.ruby} -S rake spec" }
|
2013-02-10 00:45:45 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-06-11 19:23:33 +02:00
|
|
|
require 'rubocop/rake_task'
|
|
|
|
desc 'Run RuboCop to check code consistency'
|
|
|
|
RuboCop::RakeTask.new(:rubocop) do |task|
|
|
|
|
task.fail_on_error = false
|
2013-05-24 00:59:26 +02:00
|
|
|
end
|
2012-08-14 00:39:06 +02:00
|
|
|
|
2013-12-28 01:26:31 +01:00
|
|
|
desc 'Run tests for all middleman gems'
|
2014-04-29 19:50:21 +02:00
|
|
|
task default: :test
|