Rakefile
changeset 3 7f6da371e2ce
parent 2 0c24586f579a
equal deleted inserted replaced
2:0c24586f579a 3:7f6da371e2ce
    43 DATADIR       = BASEDIR + 'data'
    43 DATADIR       = BASEDIR + 'data'
    44 
    44 
    45 PROJECT_NAME  = 'jparallel'
    45 PROJECT_NAME  = 'jparallel'
    46 PKG_NAME      = PROJECT_NAME.downcase
    46 PKG_NAME      = PROJECT_NAME.downcase
    47 PKG_SUMMARY   = 'A "parallel jail shell" written in Ruby'
    47 PKG_SUMMARY   = 'A "parallel jail shell" written in Ruby'
       
    48 
    48 VERSION_FILE  = LIBDIR + 'jparallel.rb'
    49 VERSION_FILE  = LIBDIR + 'jparallel.rb'
    49 PKG_VERSION   = VERSION_FILE.read[ /VERSION\s*=\s*'(\d+\.\d+\.\d+)'/, 1 ]
    50 if VERSION_FILE.exist? && buildrev = ENV['CC_BUILD_LABEL']
       
    51 	PKG_VERSION = VERSION_FILE.read[ /VERSION\s*=\s*['"](\d+\.\d+\.\d+)['"]/, 1 ] + '.' + buildrev
       
    52 elsif VERSION_FILE.exist?
       
    53 	PKG_VERSION = VERSION_FILE.read[ /VERSION\s*=\s*['"](\d+\.\d+\.\d+)['"]/, 1 ]
       
    54 else
       
    55 	PKG_VERSION = '0.0.0'
       
    56 end
       
    57 
    50 PKG_FILE_NAME = "#{PKG_NAME.downcase}-#{PKG_VERSION}"
    58 PKG_FILE_NAME = "#{PKG_NAME.downcase}-#{PKG_VERSION}"
    51 GEM_FILE_NAME = "#{PKG_FILE_NAME}.gem"
    59 GEM_FILE_NAME = "#{PKG_FILE_NAME}.gem"
       
    60 
       
    61 EXTCONF       = EXTDIR + 'extconf.rb'
    52 
    62 
    53 ARTIFACTS_DIR = Pathname.new( ENV['CC_BUILD_ARTIFACTS'] || 'artifacts' )
    63 ARTIFACTS_DIR = Pathname.new( ENV['CC_BUILD_ARTIFACTS'] || 'artifacts' )
    54 
    64 
    55 TEXT_FILES    = %w( Rakefile ChangeLog README LICENSE ).collect {|filename| BASEDIR + filename }
    65 TEXT_FILES    = %w( Rakefile ChangeLog README LICENSE ).collect {|filename| BASEDIR + filename }
    56 BIN_FILES     = Pathname.glob( BINDIR + '*' ).delete_if {|item| item =~ /\.svn/ }
    66 BIN_FILES     = Pathname.glob( BINDIR + '*' ).delete_if {|item| item =~ /\.svn/ }
   122 RDOC_OPTIONS = [
   132 RDOC_OPTIONS = [
   123 	'-w', '4',
   133 	'-w', '4',
   124 	'-SHN',
   134 	'-SHN',
   125 	'-i', '.',
   135 	'-i', '.',
   126 	'-m', 'README',
   136 	'-m', 'README',
   127 	'-W', 'http://deveiate.org/projects/Jparallel//browser/trunk/'
   137 	'-W', 'http://deveiate.org/projects/jParallel//browser/trunk/'
   128   ]
   138   ]
   129 
   139 
   130 # Release constants
   140 # Release constants
   131 SMTP_HOST = 'mail.faeriemud.org'
   141 SMTP_HOST = 'mail.faeriemud.org'
   132 SMTP_PORT = 465 # SMTP + SSL
   142 SMTP_PORT = 465 # SMTP + SSL
   178 	simultaneously. It includes a Ruby binding to the FreeBSD jail(2) functions.
   188 	simultaneously. It includes a Ruby binding to the FreeBSD jail(2) functions.
   179 	EOD
   189 	EOD
   180 
   190 
   181 	gem.authors           = 'Michael Granger and Mahlon Smith'
   191 	gem.authors           = 'Michael Granger and Mahlon Smith'
   182 	gem.email             = 'ged@FaerieMUD.org, mahlon@martini.nu'
   192 	gem.email             = 'ged@FaerieMUD.org, mahlon@martini.nu'
   183 	gem.homepage          = 'http://deveiate.org/projects/Jparallel/'
   193 	gem.homepage          = 'http://deveiate.org/projects/jParallel/'
   184 	gem.rubyforge_project = RUBYFORGE_PROJECT
   194 	gem.rubyforge_project = RUBYFORGE_PROJECT
   185 
   195 
   186 	gem.has_rdoc          = true
   196 	gem.has_rdoc          = true
   187 	gem.rdoc_options      = RDOC_OPTIONS
   197 	gem.rdoc_options      = RDOC_OPTIONS
   188 
   198 
   189 	gem.bindir            = BINDIR.relative_path_from(BASEDIR).to_s
   199 	gem.bindir            = BINDIR.relative_path_from(BASEDIR).to_s
   190 	
   200 
       
   201 	if EXTCONF.exist?
       
   202 		gem.extensions << EXTCONF.relative_path_from( BASEDIR ).to_s
       
   203 	end
   191 
   204 
   192 	gem.files             = RELEASE_FILES.
   205 	gem.files             = RELEASE_FILES.
   193 		collect {|f| f.relative_path_from(BASEDIR).to_s }
   206 		collect {|f| f.relative_path_from(BASEDIR).to_s }
   194 	gem.test_files        = SPEC_FILES.
   207 	gem.test_files        = SPEC_FILES.
   195 		collect {|f| f.relative_path_from(BASEDIR).to_s }
   208 		collect {|f| f.relative_path_from(BASEDIR).to_s }
   270 
   283 
   271 ### Task: cruise (Cruisecontrol task)
   284 ### Task: cruise (Cruisecontrol task)
   272 desc "Cruisecontrol build"
   285 desc "Cruisecontrol build"
   273 task :cruise => [:clean, 'spec:quiet', :package] do |task|
   286 task :cruise => [:clean, 'spec:quiet', :package] do |task|
   274 	raise "Artifacts dir not set." if ARTIFACTS_DIR.to_s.empty?
   287 	raise "Artifacts dir not set." if ARTIFACTS_DIR.to_s.empty?
   275 	artifact_dir = ARTIFACTS_DIR.cleanpath
   288 	artifact_dir = ARTIFACTS_DIR.cleanpath + ENV['CC_BUILD_LABEL']
   276 	artifact_dir.mkpath
   289 	artifact_dir.mkpath
   277 	
   290 	
   278 	coverage = BASEDIR + 'coverage'
   291 	coverage = BASEDIR + 'coverage'
   279 	if coverage.exist? && coverage.directory?
   292 	if coverage.exist? && coverage.directory?
   280 		$stderr.puts "Copying coverage stats..."
   293 		$stderr.puts "Copying coverage stats..."