Sha256: 35bfeefc276b73ffcaad1060cd06f98f9eb0c770926882ac0f400abe6015705e

Contents?: true

Size: 1.64 KB

Versions: 104

Compression:

Stored size: 1.64 KB

Contents

require 'bundler/gem_tasks'
require 'rspec'
require 'rspec/core/rake_task'

## safely load all the rake tasks in the `tasks` directory
def safe_load(file)
  begin
    load file
  rescue LoadError => ex
    puts "Error loading rake tasks from '#{file}' but will continue..."
    puts ex.message
  end
end

Dir.glob('tasks/**/*.rake').each do |rakefile|
  safe_load rakefile
end

task :default => :test

if defined?(JRUBY_VERSION)
  require 'ant'

  directory 'pkg/classes'
  directory 'pkg/tests'

  desc "Clean up build artifacts"
  task :clean do
    rm_rf "pkg/classes"
    rm_rf "pkg/tests"
    rm_rf "lib/thread_safe/jruby_cache_backend.jar"
  end

  desc "Compile the extension"
  task :compile => "pkg/classes" do |t|
    ant.javac :srcdir => "ext", :destdir => t.prerequisites.first,
      :source => "1.5", :target => "1.5", :debug => true,
      :classpath => "${java.class.path}:${sun.boot.class.path}"
  end

  desc "Build the jar"
  task :jar => :compile do
    ant.jar :basedir => "pkg/classes", :destfile => "lib/thread_safe/jruby_cache_backend.jar", :includes => "**/*.class"
  end

  desc "Build test jar"
  task 'test-jar' => 'pkg/tests' do |t|
    ant.javac :srcdir => 'spec/src', :destdir => t.prerequisites.first,
      :source => "1.5", :target => "1.5", :debug => true

    ant.jar :basedir => 'pkg/tests', :destfile => 'spec/package.jar', :includes => '**/*.class'
  end

  task :package => [ :clean, :compile, :jar, 'test-jar' ]
else
  # No need to package anything for non-jruby rubies
  task :package
end

RSpec::Core::RakeTask.new :test => :package do |t|
  t.rspec_opts = '--color --backtrace --tag ~unfinished --seed 1 --format documentation ./spec'
end

Version data entries

104 entries across 98 versions & 30 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/thread_safe-0.3.6/Rakefile
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/thread_safe-0.3.6/Rakefile
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/thread_safe-0.3.6/Rakefile
mumukit-content-type-1.12.1 vendor/bundle/ruby/2.7.0/gems/thread_safe-0.3.6/Rakefile
mumukit-content-type-1.12.0 vendor/bundle/ruby/2.7.0/gems/thread_safe-0.3.6/Rakefile
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/thread_safe-0.3.6-java/Rakefile
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/thread_safe-0.3.6-java/Rakefile
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/thread_safe-0.3.6-java/Rakefile
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/thread_safe-0.3.6-java/Rakefile
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/thread_safe-0.3.6-java/Rakefile
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/thread_safe-0.3.6-java/Rakefile
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/thread_safe-0.3.6-java/Rakefile
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/thread_safe-0.3.6-java/Rakefile
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/thread_safe-0.3.6-java/Rakefile
mumukit-content-type-1.11.1 vendor/bundle/ruby/2.6.0/gems/thread_safe-0.3.6/Rakefile
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/thread_safe-0.3.6-java/Rakefile
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/thread_safe-0.3.6-java/Rakefile
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/thread_safe-0.3.6-java/Rakefile
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/thread_safe-0.3.6-java/Rakefile
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/thread_safe-0.3.6-java/Rakefile