Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Clean up rake tasks

To build native gems: rake gem
To build JRuby gems: rake java gem
  • Loading branch information...
commit b809176722660f240c8894acbacd01eb3013da48 1 parent 83d3cfc
@jfirebaugh jfirebaugh authored
Showing with 30 additions and 50 deletions.
  1. +30 −50 Rakefile
View
80 Rakefile
@@ -11,40 +11,29 @@ lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "ruby-debug-base/version"
-ROOT_DIR = File.dirname(__FILE__)
-
-ext = File.join(ROOT_DIR, 'ext')
-
-desc "Test everything."
-Rake::TestTask.new(:test) do |t|
- t.libs += %W(#{ROOT_DIR}/lib #{ROOT_DIR}/cli)
- t.libs << ext if File.exist?(ext)
- t.test_files = FileList['test/cli/commands/unit/*.rb',
- 'test/cli/commands/*_test.rb',
- 'test/cli/**/*_test.rb',
- 'test/test-*.rb']
- t.options = '--verbose' if $VERBOSE
- t.ruby_opts << "--debug" if defined?(JRUBY_VERSION)
-end
-
-task :test => :test_base if File.exist?(ext)
-
-desc "Test ruby-debug-base."
-Rake::TestTask.new(:test_base) do |t|
- t.libs += ['./ext', './lib']
- t.test_files = FileList['test/base/*.rb']
- t.options = '--verbose' if $VERBOSE
- t.ruby_opts << "--debug" if defined?(JRUBY_VERSION)
-end
+namespace :test do
+ desc "Test ruby-debug-base"
+ Rake::TestTask.new(:base => :compile) do |t|
+ t.libs += %w(./ext ./lib)
+ t.test_files = FileList['test/base/*.rb']
+ t.options = '--verbose' if $VERBOSE
+ t.ruby_opts << "--debug" if defined?(JRUBY_VERSION)
+ end
-if defined?(JRUBY_VERSION)
- task :test_base => 'jruby:compile:java'
-else
- task :test_base => :compile
+ desc "Test ruby-debug"
+ Rake::TestTask.new(:cli => :compile) do |t|
+ t.libs += %W(./lib ./cli ./ext)
+ t.test_files = FileList['test/cli/commands/unit/*.rb',
+ 'test/cli/commands/*_test.rb',
+ 'test/cli/**/*_test.rb',
+ 'test/test-*.rb']
+ t.options = '--verbose' if $VERBOSE
+ t.ruby_opts << "--debug" if defined?(JRUBY_VERSION)
+ end
end
-desc "Test everything - same as test."
-task :check => :test
+desc "Test everything"
+task :test => %w(test:base test:cli)
desc "Create a GNU-style ChangeLog via svn2cl"
task :ChangeLog do
@@ -56,13 +45,19 @@ end
base_spec = Gem::Specification.load("ruby-debug-base.gemspec")
cli_spec = Gem::Specification.load("ruby-debug.gemspec")
+if defined?(JRUBY_VERSION)
+ Rake::JavaExtensionTask.new('ruby_debug', base_spec) do |t|
+ t.ext_dir = "src"
+ end
+else
+ Rake::ExtensionTask.new('ruby_debug', base_spec) do |t|
+ t.ext_dir = "ext"
+ end
+end
+
Gem::PackageTask.new(base_spec) {}
Gem::PackageTask.new(cli_spec) {}
-Rake::ExtensionTask.new('ruby_debug', base_spec) do |t|
- t.ext_dir = "ext"
-end
-
task :default => :test
desc "Remove built files"
@@ -78,7 +73,6 @@ task :clean do
rm 'lib/ruby_debug.jar' if File.exists?("lib/ruby_debug.jar")
end
-# --------- RDoc Documentation ------
desc "Generate rdoc documentation"
RDoc::Task.new("rdoc") do |rdoc|
rdoc.rdoc_dir = 'doc/rdoc'
@@ -95,17 +89,3 @@ RDoc::Task.new("rdoc") do |rdoc|
'README',
'LICENSE')
end
-
-namespace :jruby do
- jruby_spec = base_spec.clone
- jruby_spec.platform = "java"
- jruby_spec.files = jruby_spec.files.reject {|f| f =~ /^ext/ }
- jruby_spec.files += ['lib/ruby_debug.jar']
- jruby_spec.extensions = []
-
- Gem::PackageTask.new(jruby_spec) {}
-
- Rake::JavaExtensionTask.new('ruby_debug') do |t|
- t.ext_dir = "src"
- end
-end
Please sign in to comment.
Something went wrong with that request. Please try again.