2006-01-28 14:03:53 -05:00
|
|
|
require 'rake'
|
|
|
|
require 'rake/testtask'
|
|
|
|
require 'rake/clean'
|
|
|
|
require 'rake/gempackagetask'
|
|
|
|
require 'rake/rdoctask'
|
|
|
|
require 'tools/rakehelp'
|
|
|
|
require 'fileutils'
|
|
|
|
include FileUtils
|
|
|
|
|
|
|
|
setup_tests
|
2006-02-15 18:17:23 -05:00
|
|
|
setup_clean ["ext/http11/*.{bundle,so,obj,pdb,lib,def,exp}", "ext/http11/Makefile", "pkg", "lib/*.bundle", "*.gem", "doc/site/output", ".config"]
|
|
|
|
|
2006-03-04 14:10:26 -05:00
|
|
|
setup_rdoc ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc', 'ext/http11/http11.c']
|
2006-01-28 14:03:53 -05:00
|
|
|
|
|
|
|
desc "Does a full compile, test run"
|
|
|
|
task :default => [:compile, :test]
|
|
|
|
|
|
|
|
desc "Compiles all extensions"
|
2006-05-11 15:10:34 -04:00
|
|
|
task :compile => [:http11] do
|
|
|
|
if Dir.glob(File.join("lib","http11.*")).length == 0
|
|
|
|
STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
|
|
|
STDERR.puts "Gem actually failed to build. Your system is"
|
|
|
|
STDERR.puts "NOT configured properly to build RubyGems."
|
|
|
|
STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
|
|
|
exit(1)
|
|
|
|
end
|
|
|
|
end
|
2006-03-11 11:35:53 -05:00
|
|
|
task :package => [:clean,:compile,:test]
|
2006-01-28 14:03:53 -05:00
|
|
|
|
|
|
|
task :ragel do
|
2006-02-12 15:02:56 -05:00
|
|
|
sh %{/usr/local/bin/ragel ext/http11/http11_parser.rl | /usr/local/bin/rlcodegen -G2 -o ext/http11/http11_parser.c}
|
|
|
|
end
|
|
|
|
|
2006-05-20 16:08:50 -04:00
|
|
|
task :site_webgen do
|
2006-02-12 15:02:56 -05:00
|
|
|
sh %{pushd doc/site; webgen; scp -r output/* #{ENV['SSH_USER']}@rubyforge.org:/var/www/gforge-projects/mongrel/; popd }
|
2006-05-20 16:08:50 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
task :site_rdoc do
|
2006-02-12 15:02:56 -05:00
|
|
|
sh %{ scp -r doc/rdoc/* #{ENV['SSH_USER']}@rubyforge.org:/var/www/gforge-projects/mongrel/rdoc/ }
|
2006-05-20 16:08:50 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
task :site_coverage => [:test_units_with_coverage] do
|
|
|
|
sh %{ scp -r test/coverage/unit/* #{ENV['SSH_USER']}@rubyforge.org:/var/www/gforge-projects/mongrel/coverage/ }
|
|
|
|
end
|
|
|
|
|
|
|
|
task :site_projects_rdoc do
|
2006-03-06 00:31:39 -05:00
|
|
|
sh %{ cd projects/gem_plugin; rake site }
|
2006-01-28 14:03:53 -05:00
|
|
|
end
|
|
|
|
|
2006-05-20 16:08:50 -04:00
|
|
|
task :site => [:site_webgen, :site_rdoc, :site_coverage, :site_projects_rdoc]
|
|
|
|
|
2006-01-28 14:03:53 -05:00
|
|
|
setup_extension("http11", "http11")
|
|
|
|
|
2006-02-16 02:04:18 -05:00
|
|
|
name="mongrel"
|
2006-05-11 15:10:34 -04:00
|
|
|
version="0.3.13"
|
2006-03-10 01:46:45 -05:00
|
|
|
|
|
|
|
setup_gem(name, version) do |spec|
|
|
|
|
spec.summary = "A small fast HTTP library and server that runs Rails, Camping, and Nitro apps."
|
|
|
|
spec.description = spec.summary
|
|
|
|
spec.test_file = "test/test_ws.rb"
|
|
|
|
spec.author="Zed A. Shaw"
|
|
|
|
spec.executables=['mongrel_rails']
|
|
|
|
spec.files += %w(ext/http11/MANIFEST README Rakefile setup.rb)
|
2006-02-16 02:04:18 -05:00
|
|
|
|
2006-02-11 22:37:38 -05:00
|
|
|
spec.add_dependency('daemons', '>= 0.4.2')
|
2006-03-14 00:48:37 -05:00
|
|
|
spec.add_dependency('gem_plugin', '>= 0.2.1')
|
2006-03-10 01:46:45 -05:00
|
|
|
spec.required_ruby_version = '>= 1.8.4'
|
2006-02-11 22:37:38 -05:00
|
|
|
end
|
2006-02-15 18:17:23 -05:00
|
|
|
|
|
|
|
desc "Build a binary gem for Win32"
|
2006-02-22 12:10:19 -05:00
|
|
|
task :win32_gem => [:clean, :compile, :test, :rerdoc, :package_win32]
|
2006-02-15 18:17:23 -05:00
|
|
|
|
|
|
|
task :package_win32 do
|
2006-03-10 01:46:45 -05:00
|
|
|
setup_win32_gem(name, version) do |spec|
|
|
|
|
spec.summary = "A small fast HTTP library and server that runs Rails, Camping, and Nitro apps."
|
|
|
|
spec.description = spec.summary
|
|
|
|
spec.test_files = Dir.glob('test/test_*.rb')
|
|
|
|
spec.author="Zed A. Shaw"
|
|
|
|
spec.executables=['mongrel_rails', 'mongrel_rails_service']
|
|
|
|
spec.homepage="http://mongrel.rubyforge.org"
|
|
|
|
spec.rubyforge_project="mongrel"
|
|
|
|
spec.files += %w(ext/http11/MANIFEST README Rakefile setup.rb)
|
|
|
|
spec.files << 'ext/http11/http11.so'
|
|
|
|
|
|
|
|
spec.required_ruby_version = '>= 1.8.4'
|
|
|
|
|
2006-02-22 12:10:19 -05:00
|
|
|
spec.add_dependency('win32-service', '>= 0.5.0')
|
2006-03-19 00:18:11 -05:00
|
|
|
spec.add_dependency('gem_plugin', ">= 0.2.1")
|
2006-03-10 01:46:45 -05:00
|
|
|
|
2006-02-15 18:17:23 -05:00
|
|
|
spec.extensions = []
|
|
|
|
spec.platform = Gem::Platform::WIN32
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2006-03-06 00:31:39 -05:00
|
|
|
|
2006-03-11 11:35:53 -05:00
|
|
|
task :install do
|
|
|
|
sub_project("gem_plugin", :install)
|
|
|
|
sh %{rake package}
|
2006-03-06 00:31:39 -05:00
|
|
|
sh %{sudo gem install pkg/mongrel-#{version}}
|
2006-03-11 11:35:53 -05:00
|
|
|
sub_project("mongrel_status", :install)
|
|
|
|
sub_project("mongrel_config", :install)
|
2006-03-19 00:18:11 -05:00
|
|
|
sub_project("mongrel_console", :install)
|
2006-03-11 11:35:53 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
task :uninstall => [:clean] do
|
|
|
|
sub_project("mongrel_status", :uninstall)
|
|
|
|
sub_project("mongrel_config", :uninstall)
|
2006-03-19 00:18:11 -05:00
|
|
|
sub_project("mongrel_console", :uninstall)
|
2006-03-11 11:35:53 -05:00
|
|
|
sh %{sudo gem uninstall mongrel}
|
|
|
|
sub_project("gem_plugin", :uninstall)
|
|
|
|
end
|
2006-03-12 14:40:35 -05:00
|
|
|
|
|
|
|
|
2006-03-15 01:41:28 -05:00
|
|
|
task :gem_source do
|
2006-03-12 14:40:35 -05:00
|
|
|
mkdir_p "pkg/gems"
|
|
|
|
|
|
|
|
FileList["**/*.gem"].each { |gem| mv gem, "pkg/gems" }
|
|
|
|
FileList["pkg/*.tgz"].each {|tgz| rm tgz }
|
|
|
|
rm_rf "pkg/#{name}-#{version}"
|
|
|
|
|
|
|
|
sh %{ generate_yaml_index.rb -d pkg }
|
|
|
|
sh %{ scp -r pkg/* #{ENV['SSH_USER']}@rubyforge.org:/var/www/gforge-projects/mongrel/releases/ }
|
|
|
|
end
|