tasks/distribution.rake in gecoder-1.1.0 vs tasks/distribution.rake in gecoder-1.1.1
- old
+ new
@@ -12,29 +12,29 @@
GECODE_NAME = 'gecode-2.2.0'
GECODE_ARCHIVE_NAME = "#{GECODE_NAME}.tar.gz"
desc 'Generate RDoc'
-rd = Rake::RDocTask.new do |rdoc|
+rd = RDoc::Task.new do |rdoc|
rdoc.rdoc_dir = 'doc/output/rdoc'
rdoc.title = 'Gecode/R'
rdoc.template = 'doc/rdoc/jamis.rb'
rdoc.options << '--line-numbers' << '--inline-source' <<
- '--accessor' << 'delegate' << '--main' << 'README'
- rdoc.rdoc_files.include('README', 'CHANGES', 'THANKS', 'LGPL-LICENSE', 'lib/**/*.rb')
+ '--accessor' << 'delegate' << '--main' << 'README.md'
+ rdoc.rdoc_files.include('README.md', 'CHANGES', 'THANKS', 'LGPL-LICENSE', 'lib/**/*.rb')
end
-# Removing this, which apparently doesn't work due to an update to RDoc.
-=begin
TMP_DIR = 'doc/tmp/rdoc_dev'
desc 'Generate RDoc, ignoring nodoc'
-Rake::RDocTask.new(:rdoc_dev => :prepare_rdoc_dev) do |rdoc|
+RDoc::Task.new(:rdoc_dev) do |rdoc|
+ rdoc.before_running_rdoc do
+ Rake::Task['prepare_rdoc_dev'].invoke
+ rdoc.rdoc_files.include("#{TMP_DIR}/**/*.rb")
+ end
rdoc.rdoc_dir = 'doc/output/rdoc_dev'
rdoc.options << '--title' << 'Gecode/R Developers RDoc' << '--line-numbers' <<
'--inline-source' << '--accessor' << 'delegate'
-
- rdoc.rdoc_files.include("#{TMP_DIR}/**/*.rb")
end
desc 'Copies the files that RDoc should parse, removing #:nodoc:'
task :prepare_rdoc_dev do
# Copy the rdoc and remove all #:nodoc: .
@@ -46,11 +46,10 @@
source.each{ |line| destination << line.gsub('#:nodoc:', '' ) }
end
destination.close
end
end
-=end
desc 'Extracts the source of Gecode before it is packaged into a gem'
task :extract_gecode do
next if File.exist? "#{EXT_DIR}/#{GECODE_NAME}"
cd(EXT_DIR) do
@@ -85,34 +84,19 @@
'ext/extconf.rb'
].to_a
s.require_path = 'lib'
s.extensions << 'ext/extconf.rb'
s.requirements << 'Gecode 2.2.0'
+ s.required_ruby_version = "< 1.9"
s.has_rdoc = true
s.rdoc_options = rd.options
s.extra_rdoc_files = rd.rdoc_files
s.test_files = FileList['specs/**/*.rb']
s.authors = ["Gecode/R Development Team"]
- s.email = "gecoder-users@rubyforge.org"
- s.homepage = "http://gecoder.rubyforge.org"
- s.rubyforge_project = "gecoder"
-
-=begin
- # Development dependencies.
- # Not listed: rubygems >= 1.2
- [['rake'],
- ['webgen', '= 0.4.7'],
- ['coderay'],
- ['rspec', '>= 1.0'],
- ['rcov'],
- ['meta_project'],
- ['rubyforge']].each do |dependency|
- s.add_development_dependency(*dependency)
- end
-=end
+ s.homepage = "http://gecoder.org"
end
# Create a clone of the gem spec with the precompiled binaries for Windows.
spec_windows_binary_with_gecode = spec.dup
spec_windows_binary_with_gecode.name = PKG_NAME_WITH_GECODE
@@ -131,26 +115,24 @@
spec_with_gecode.extensions.dup.unshift 'ext/gecode-2.2.0/configure'
spec_with_gecode.requirements = []
spec_with_gecode.files = spec.files.dup + FileList['ext/gecode-*/**/*'].to_a
desc 'Generate Gecode/R Gem'
-Rake::GemPackageTask.new(spec) do |pkg|
+Gem::PackageTask.new(spec) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
desc 'Generate Gecode/R + Gecode Gem'
-Rake::GemPackageTask.new(spec_with_gecode) do |pkg|
+Gem::PackageTask.new(spec_with_gecode) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
-=begin
desc 'Generate Gecode/R + Gecode Gem (windows binary)'
-Rake::GemPackageTask.new(spec_windows_binary_with_gecode) do |pkg|
+Gem::PackageTask.new(spec_windows_binary_with_gecode) do |pkg|
end
-=end
desc 'Precompiles the Gecode/R bindings for Windows platforms'
file 'lib/gecode.dll' do
cd 'ext' do
sh 'ruby -Iwin32 extconf-win32.rb'
@@ -168,53 +150,6 @@
"#{EXT_DIR}/*.o",
"#{EXT_DIR}/gecode.{cc,hh}",
"#{EXT_DIR}/Makefile",
"#{EXT_DIR}/mkmf.log"
].to_a.each{ |file| rm file if File.exists? file }
-end
-
-desc 'Publish packages on RubyForge'
-task :publish_packages => [:publish_gecoder_packages,
- :publish_gecoder_with_gecode_packages]
-
-# Files included in the vanilla Gecode/R release.
-vanilla_release_files = [
- "pkg/#{PKG_FILE_NAME}.gem",
- "pkg/#{PKG_FILE_NAME}.tgz",
- "pkg/#{PKG_FILE_NAME}.zip"
-]
-desc 'Publish Gecode/R packages on RubyForge'
-task :publish_gecoder_packages => [:verify_user] + vanilla_release_files do
- require 'meta_project'
- require 'rake/contrib/xforge'
-
- Rake::XForge::Release.new(MetaProject::Project::XForge::RubyForge.new(PROJECT_NAME)) do |xf|
- xf.user_name = ENV['RUBYFORGE_USER']
- xf.files = vanilla_release_files.to_a
- xf.release_name = "Gecode/R #{PKG_VERSION}"
- xf.package_name = PKG_NAME
- end
-end
-
-# Files included in the release with Gecode.
-gecode_release_files = [
- "pkg/#{PKG_FILE_NAME_WITH_GECODE}.gem",
- #"pkg/#{PKG_FILE_NAME_WITH_GECODE}.tgz",
- #"pkg/#{PKG_FILE_NAME_WITH_GECODE}.zip",
- #"pkg/#{PKG_FILE_NAME_WITH_GECODE}-x86-mswin32-60.gem"
-]
-gecode_release_files.each do |pkg|
- file pkg => :extract_gecode
-end
-desc 'Publish Gecode/R with Gecode packages on RubyForge'
-task :publish_gecoder_with_gecode_packages =>
- [:verify_user] + gecode_release_files do
- require 'meta_project'
- require 'rake/contrib/xforge'
-
- Rake::XForge::Release.new(MetaProject::Project::XForge::RubyForge.new(PROJECT_NAME)) do |xf|
- xf.user_name = ENV['RUBYFORGE_USER']
- xf.files = gecode_release_files.to_a
- xf.release_name = "Gecode/R with Gecode #{PKG_VERSION}"
- xf.package_name = PKG_NAME_WITH_GECODE
- end
end