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"
|
2006-05-20 16:12:52 -04:00
|
|
|
STDERR.puts "NOT configured properly to build Mongrel."
|
2006-05-11 15:10:34 -04:00
|
|
|
STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
|
|
|
exit(1)
|
|
|
|
end
|
|
|
|
end
|
2006-05-21 10:46:42 -04:00
|
|
|
|
2006-06-01 23:02:06 -04:00
|
|
|
task :package => [:clean,:compile,:test,:rerdoc]
|
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-06-15 14:14:07 -04: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
|
|
|
|
|
2006-05-23 02:40:24 -04:00
|
|
|
task :site_coverage => [:rcov] do
|
|
|
|
sh %{ scp -r test/coverage/* #{ENV['SSH_USER']}@rubyforge.org:/var/www/gforge-projects/mongrel/coverage/ }
|
2006-05-20 16:08:50 -04:00
|
|
|
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-09-22 04:16:54 -04:00
|
|
|
version="0.3.13.5"
|
2006-03-10 01:46:45 -05:00
|
|
|
|
|
|
|
setup_gem(name, version) do |spec|
|
2006-09-26 17:25:44 -04:00
|
|
|
spec.summary = "A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps."
|
2006-03-10 01:46:45 -05:00
|
|
|
spec.description = spec.summary
|
2006-06-01 23:02:06 -04:00
|
|
|
spec.test_files = Dir.glob('test/test_*.rb')
|
2006-03-10 01:46:45 -05:00
|
|
|
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-03-10 01:46:45 -05:00
|
|
|
spec.required_ruby_version = '>= 1.8.4'
|
2006-02-15 18:17:23 -05:00
|
|
|
|
2006-06-01 23:02:06 -04:00
|
|
|
if RUBY_PLATFORM =~ /mswin/
|
2006-06-16 17:01:12 -04:00
|
|
|
Dir.chdir "projects/mongrel_service" do
|
2006-08-30 20:26:39 -04:00
|
|
|
`rake.cmd install`
|
2006-06-16 17:01:12 -04:00
|
|
|
end
|
2006-08-14 16:37:07 -04:00
|
|
|
spec.files += ['ext/http11/http11.so']
|
|
|
|
spec.files += ['lib/http11.so']
|
2006-06-01 23:23:41 -04:00
|
|
|
spec.extensions.clear
|
2006-02-15 18:17:23 -05:00
|
|
|
spec.platform = Gem::Platform::WIN32
|
2006-06-01 23:02:06 -04:00
|
|
|
else
|
|
|
|
spec.add_dependency('daemons', '>= 0.4.2')
|
2006-02-15 18:17:23 -05:00
|
|
|
end
|
2006-06-01 23:02:06 -04:00
|
|
|
|
|
|
|
spec.add_dependency('gem_plugin', '>= 0.2.1')
|
2006-02-15 18:17:23 -05:00
|
|
|
end
|
|
|
|
|
2006-03-11 11:35:53 -05:00
|
|
|
task :install do
|
|
|
|
sub_project("gem_plugin", :install)
|
|
|
|
sh %{rake package}
|
2006-06-10 03:02:19 -04:00
|
|
|
sh %{gem install pkg/mongrel-#{version}}
|
2006-03-11 11:35:53 -05:00
|
|
|
sub_project("mongrel_status", :install)
|
2006-06-25 10:49:46 -04:00
|
|
|
sub_project("mongrel_upload_progress", :install)
|
2006-03-19 00:18:11 -05:00
|
|
|
sub_project("mongrel_console", :install)
|
2006-08-16 17:51:38 -04:00
|
|
|
sub_project("mongrel_cluster", :install)
|
2006-06-16 17:01:12 -04:00
|
|
|
if RUBY_PLATFORM =~ /mswin/
|
|
|
|
sub_project("mongrel_service", :install)
|
|
|
|
end
|
2006-03-11 11:35:53 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
task :uninstall => [:clean] do
|
|
|
|
sub_project("mongrel_status", :uninstall)
|
2006-06-25 10:49:46 -04:00
|
|
|
sub_project("mongrel_upload_progress", :uninstall)
|
2006-03-19 00:18:11 -05:00
|
|
|
sub_project("mongrel_console", :uninstall)
|
2006-06-10 03:02:19 -04:00
|
|
|
sh %{gem uninstall mongrel}
|
2006-03-11 11:35:53 -05:00
|
|
|
sub_project("gem_plugin", :uninstall)
|
2006-06-16 17:01:12 -04:00
|
|
|
if RUBY_PLATFORM =~ /mswin/
|
|
|
|
sub_project("mongrel_service", :install)
|
|
|
|
end
|
2006-03-11 11:35:53 -05:00
|
|
|
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"
|
2006-06-10 03:02:19 -04:00
|
|
|
|
2006-03-12 14:40:35 -05:00
|
|
|
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
|