Rakefile in ruby-debug-base-0.10.0-mswin32 vs Rakefile in ruby-debug-base-0.10.1

- old
+ new

@@ -6,56 +6,67 @@ require 'rake/testtask' SO_NAME = "ruby_debug.so" # ------- Default Package ---------- -RUBY_DEBUG_VERSION = open("ext/ruby_debug.c"){|f| f.grep(/^#define DEBUG_VERSION/).first[/"(.+)"/,1]} +RUBY_DEBUG_VERSION = open("ext/ruby_debug.c") do |f| + f.grep(/^#define DEBUG_VERSION/).first[/"(.+)"/,1] +end COMMON_FILES = FileList[ 'AUTHORS', 'CHANGES', 'LICENSE', 'README', 'Rakefile', ] -CLI_TEST_FILE_LIST = 'test/**/*test-*.rb' +CLI_TEST_FILE_LIST = 'test/test-*.rb' CLI_FILES = COMMON_FILES + FileList[ "cli/**/*", 'ChangeLog', 'bin/*', 'doc/rdebug.1', - 'test/**/*.cmd', - 'test/**/*.right', - 'test/**/gcd.rb', - 'test/**/helper.rb', - 'test/**/info-var-bug.rb', - 'test/**/tdebug.rb', - 'test/**/test-*.cmd', - 'runner.sh', + 'test/**/data/*.cmd', + 'test/**/data/*.right', + 'test/**/*.rb', + 'rdbg.rb', CLI_TEST_FILE_LIST, ] -BASE_TEST_FILE_LIST = 'test/test-ruby-debug-base.rb' +BASE_TEST_FILE_LIST = %w( + test/base/base.rb + test/base/binding.rb + test/base/catchpoint.rb) BASE_FILES = COMMON_FILES + FileList[ - 'lib/**/*', - 'ext/ChangeLog', - 'ext/ruby_debug.c', + 'ext/breakpoint.c', 'ext/extconf.rb', + 'ext/ruby_debug.c', + 'ext/ruby_debug.h', 'ext/win32/*', + 'lib/**/*', BASE_TEST_FILE_LIST, ] desc "Test everything." -test_task = task :test => :lib do +test_task = task :test => [:lib, :test_base] do Rake::TestTask.new(:test) do |t| t.libs << ['./ext', './lib', './cli'] t.pattern = CLI_TEST_FILE_LIST t.verbose = true end end +desc "Test ruby-debug-base." +test_task = task :test_base => :lib do + Rake::TestTask.new(:test_base) do |t| + t.libs << ['./ext', './lib'] + t.test_files = FileList[BASE_TEST_FILE_LIST] + t.verbose = true + end +end + desc "Test everything - same as test." task :check => :test desc "Create the core ruby-debug shared library extension" task :lib do @@ -97,16 +108,16 @@ spec.author = "Kent Sibilev" spec.email = "ksibilev@yahoo.com" spec.platform = Gem::Platform::RUBY spec.require_path = "lib" spec.extensions = ["ext/extconf.rb"] - spec.autorequire = "ruby-debug-base" spec.files = BASE_FILES.to_a spec.required_ruby_version = '>= 1.8.2' spec.date = Time.now spec.rubyforge_project = 'ruby-debug' + spec.add_dependency('linecache', '>= 0.3') spec.test_files = FileList[BASE_TEST_FILE_LIST] # rdoc spec.has_rdoc = true @@ -128,16 +139,16 @@ spec.email = "ksibilev@yahoo.com" spec.platform = Gem::Platform::RUBY spec.require_path = "cli" spec.bindir = "bin" spec.executables = ["rdebug"] - spec.autorequire = "ruby-debug" spec.files = CLI_FILES.to_a spec.required_ruby_version = '>= 1.8.2' spec.date = Time.now spec.rubyforge_project = 'ruby-debug' + spec.add_dependency('columnize', '>= 0.1') spec.add_dependency('ruby-debug-base', RUBY_DEBUG_VERSION) # FIXME: work out operational logistics for this # spec.test_files = FileList[CLI_TEST_FILE_LIST] @@ -157,35 +168,36 @@ task :default => [:package] # Windows specification win_spec = base_spec.clone win_spec.extensions = [] -win_spec.platform = Gem::Platform::WIN32 +## win_spec.platform = Gem::Platform::WIN32 # deprecated +win_spec.platform = 'mswin32' win_spec.files += ["lib/#{SO_NAME}"] desc "Create Windows Gem" task :win32_gem do # Copy the win32 extension the top level directory current_dir = File.expand_path(File.dirname(__FILE__)) source = File.join(current_dir, "ext", "win32", SO_NAME) target = File.join(current_dir, "lib", SO_NAME) cp(source, target) - # Create the gem, then move it to pkg - Gem::Builder.new(win_spec).build - gem_file = "#{win_spec.name}-#{win_spec.version}-#{win_spec.platform}.gem" + # Create the gem, then move it to pkg. + Gem::Builder.new(win_spec).build + gem_file = "#{win_spec.name}-#{win_spec.version}-#{win_spec.platform}.gem" mv(gem_file, "pkg/#{gem_file}") - # Remove win extension fro top level directory - rm(target) + # Remove win extension from top level directory. + rm(target) end desc "Publish ruby-debug to RubyForge." task :publish do require 'rake/contrib/sshpublisher' - # Get ruby-debug path + # Get ruby-debug path. ruby_debug_path = File.expand_path(File.dirname(__FILE__)) publisher = Rake::SshDirPublisher.new("kent@rubyforge.org", "/var/www/gforge-projects/ruby-debug", ruby_debug_path) end @@ -216,5 +228,24 @@ 'ext/**/ruby_debug.c', 'README', 'LICENSE') end +desc "Publish the release files to RubyForge." +task :rubyforge_upload do + `rubyforge login` + release_command = "rubyforge add_release #{PKG_NAME} #{PKG_NAME} '#{PKG_NAME}-#{PKG_VERSION}' pkg/#{PKG_NAME}-#{PKG_VERSION}.gem" + puts release_command + system(release_command) +end + +PKG_NAME = 'ruby-debug' +desc "Publish the release files to RubyForge." +task :rubyforge_upload do + `rubyforge login` + for pkg_name in ['ruby-debug', 'ruby-debug-base'] do + pkg_file_name = "#{pkg_name}-#{pkg_version}" + release_command = "rubyforge add_release ruby-debug #{pkg_name} '#{pkg_file_name}' pkg/#{pkg_file_name}.gem" + puts release_command + system(release_command) + end +end