require 'rubygems' require 'rake' require 'rake/testtask' require 'rake/rdoctask' require 'rake/packagetask' require 'rake/gempackagetask' require 'rake/contrib/rubyforgepublisher' PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : '' PKG_NAME = 'damagecontrol' PKG_VERSION = '0.5.0' + PKG_BUILD PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}" desc "Default Task" task :default => [ :all ] # Run the unit tests # To run a specific test: rake test TEST=path/to/test fl = FileList.new('test/**/*_test.rb') # Work around annoying LoadError - run this test alone fl.exclude('test/**/email_test.rb') fl.exclude('test/functional/*') # TODO: figure out how to add all the stuff in app. Rake::TestTask.new { |t| t.libs << "test" # We need some of the test utils from rscm. add them in 2 ways so they can be found when built by dc too. t.libs << File.expand_path(File.dirname(__FILE__) + "/../rscm/test") << File.expand_path(File.dirname(__FILE__) + "/../rscm/lib") t.libs << File.expand_path(File.dirname(__FILE__) + "/../../RSCM/checkout/test") << File.expand_path(File.dirname(__FILE__) + "/../../RSCM/checkout/lib") t.test_files = fl t.verbose = true } rd = Rake::RDocTask.new { |rdoc| rdoc.rdoc_dir = 'doc' rdoc.title = 'DamageControl - Cross platform Continuous Integration server' rdoc.options << '--line-numbers' << '--inline-source' rdoc.rdoc_files.include('README') rdoc.rdoc_files.include('lib/**/*.rb') rdoc.rdoc_files.include('docs/**/*.rd') } task :all => [:gem] PKG_FILES = FileList[ '[A-Z]*', 'doc/**/*', 'bin/**/*', 'app/**/*', 'config/**/*', 'docs/**/*', 'lib/**/*', 'public/**/*', 'script/**/*', 'test/**/*' ] if ! defined?(Gem) puts "Package Target requires RubyGEMs" else spec = Gem::Specification.new do |s| #### Basic information. s.name = 'damagecontrol' s.version = PKG_VERSION s.summary = "DamageControl" s.description = <<-EOF DamageControl. EOF #### Dependencies and requirements. s.add_dependency('rscm', '>= 0.2.1.1404') s.add_dependency('rails', '>= 0.10.1') s.add_dependency('log4r', '1.0.5') s.add_dependency('needle', '1.2.0') s.add_dependency('jabber4r', '0.7.0') s.add_dependency('ruby-growl', '1.0.0') # s.add_dependency('rgl') #s.requirements << "" #### Which files are to be included in this gem? Everything! (Except CVS directories.) s.files = PKG_FILES.to_a #### C code extensions. #s.extensions << "ext/rmagic/extconf.rb" #### Load-time details: library and application (you will need one or both). s.require_path = 'lib' # Use these for libraries. s.autorequire = 'damagecontrol/app' s.bindir = "bin" # Use these for applications. s.executables = ["damagecontrol", "damagecontrol-webrick"] s.default_executable = "damagecontrol" #### Documentation and testing. s.has_rdoc = true s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a rd.options.each do |op| s.rdoc_options << op end #### Author and project details. s.author = "Aslak Hellesoy" s.email = "dev@damagecontrol.codehaus.org" s.homepage = "http://damagecontrol.codehaus.org/" # s.rubyforge_project = "rscm" end Rake::GemPackageTask.new(spec) do |pkg| pkg.need_zip = true pkg.need_tar = true end end